E1909 Refactor review mapping controller: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 19: Line 19:


The Review Mapping Controller handles mapping a given group's assignment submission to students working in other groups for peer review. The controller handles items associated with routing submissions to reviewers, handling permissions for instructor review calibration, and controlling drafts or uncompleted reviews. Included in this controller is the ability for the instructor to specify the number of required reviews per student or the number of reviewers per team in order to have group submission automatically sent to all students' review queues.
The Review Mapping Controller handles mapping a given group's assignment submission to students working in other groups for peer review. The controller handles items associated with routing submissions to reviewers, handling permissions for instructor review calibration, and controlling drafts or uncompleted reviews. Included in this controller is the ability for the instructor to specify the number of required reviews per student or the number of reviewers per team in order to have group submission automatically sent to all students' review queues.
===Examples of Code Modification===
in automatic_review_mapping method, the following bits of code were added to separate methods:
<pre>
participants.each do |participant|
    user = participant.user
    next if TeamsUser.team_id(assignment_id, user.id)
    team = AssignmentTeam.create_team_and_node(assignment_id)
        ApplicationController.helpers.create_team_users(user, team.id)
    teams << team
  end
</pre>

Revision as of 02:22, 26 March 2019

E1909. Refactoring the Review Mapping Controller

About Expertiza

Expertiza is an open source project based on the Ruby on Rails framework. Expertiza provides a platform for instructors to create assignments and for students to set up teams to facilitate early communication and teamwork in these assignments. Expertiza also provides an environment where students can peer review other students, allowing these users to view feedback on their assignments in a timely manner. Expertiza supports submission across various document types, including the URLs and wiki pages.

Refactoring Considerations

The following items were improved in the refactoring of the given file:

  • Long blocks of code converted into separate methods
  • Ambiguous variable names changed to meaningful variable names
  • Code clarity
  • Test Coverage

About the Review Mapping Controller

The Review Mapping Controller handles mapping a given group's assignment submission to students working in other groups for peer review. The controller handles items associated with routing submissions to reviewers, handling permissions for instructor review calibration, and controlling drafts or uncompleted reviews. Included in this controller is the ability for the instructor to specify the number of required reviews per student or the number of reviewers per team in order to have group submission automatically sent to all students' review queues.

Examples of Code Modification

in automatic_review_mapping method, the following bits of code were added to separate methods:

participants.each do |participant|
    	user = participant.user
    	next if TeamsUser.team_id(assignment_id, user.id)
    	team = AssignmentTeam.create_team_and_node(assignment_id)
        ApplicationController.helpers.create_team_users(user, team.id)
    	teams << team
  	end