CSC/ECE 517 Fall 2019 - E1944. Refactor review mapping controller: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 50: Line 50:
WI4 : Test the conflict_notification method to test the changes made.<br/>
WI4 : Test the conflict_notification method to test the changes made.<br/>
WI5 : Move the repeated code in view and view_my_scores methods to a separate method retrieve_questions<br/>
WI5 : Move the repeated code in view and view_my_scores methods to a separate method retrieve_questions<br/>
WI6 : Change the repeated varaible decalreation and put into single common block.<br/>
WI6 : Change the repeated variable declaration and put into single common block.<br/>
WI7 : Change ambiguous variable names in more sensible variable names<br/>
WI7 : Change ambiguous variable names to more sensible variable names<br/>
WI8 : Assign variables to hardcoded values.

Revision as of 03:48, 29 October 2019

This wiki page is for the description of changes made under E1555 OSS assignment for Fall 2015, CSC/ECE 517.

Expertiza Background

Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NC State University. It’s an open-source project developed on Ruby on Rails platform and its codebase is available on Github. It facilitates peer review among the students allowing them to improve their work from the feedback. It also assists the faculty in customizing the specifications for the projects and Assignments.

Description of the current project

The following is an Expertiza based OSS project which deals primarily with a controller namely review_mapping_controller.rb. It focusses on refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing redundant code etc among the other things. The goal of this project is to attempt to make this part of the application easier to read and maintain.

Files modified in the current project

A controller and a helper file were modified for this project namely:
1. review_mapping_controller.rb
2. review_mapping_controller_spec.rb
3. assign_quiz_controller.rb
4. assign_quiz_controller_spec.rb
5. review_response_map_controller.rb
6. review_response_map_controller_spec.rb
7. routes.rb
8. Other views & partials associated affected by these changes

ReviewMappingController

This controller will map the submissions made by the teams to the students for facilitating peer-reviewing. A couple of long and complex methods such as peer_review_strategy and automatic_review_mapping were refactored from this controller along with the removal of some non-related methods such as add_calibration and assign_quiz_dynamically. Variable names have been changed and code has been modularized and helper methods were separated from the important methods into a module and were included in the class.

Test Cases were created for the newly created controllers such as assign_quiz_controller etc.

review_mapping_controller_spec.rb

Tests were removed from this file which belongs to the isolated methods.

AssignQuizController

Assigning Quizzes (Quizzes are also stored in the Assignment table) is not a seemingly/semantically related task to review mapping. Hence this was moved into a separate controller.

assign_quiz_controller_spec.rb

Tests related to assign_quiz_controller were moved into this file.

assign_quiz_controller_spec.rb

Tests related to assign_quiz_controller were moved into this file.

List of changes

We worked on the following work items(WIs)
WI1 : Refactor calculate_all_penalties method into smaller methods
WI2 : Move the repeated code in conflict_notification & edit methods to a separate method list_questions.
WI3 : Refactor the code as per the Ruby style guidelines and incorporate the good practices
WI4 : Test the conflict_notification method to test the changes made.
WI5 : Move the repeated code in view and view_my_scores methods to a separate method retrieve_questions
WI6 : Change the repeated variable declaration and put into single common block.
WI7 : Change ambiguous variable names to more sensible variable names
WI8 : Assign variables to hardcoded values.