<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yli273</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yli273"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Yli273"/>
	<updated>2026-09-19T09:42:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=142304</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=142304"/>
		<updated>2021-11-30T04:04:42Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* RSpec Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Force the student to add revision plan before submit their work at round 2 submission.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
[[File:E2152_Rationale.png|410px|center]]&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Force the students to add revision plan before submit their work at round 2 submission&lt;br /&gt;
The revision plan cannot be operated in all of the phases but before round 2 submission. In the round 2 submission, the &amp;quot;Your Work&amp;quot; part cannot be chosen only if you finish to edit the &amp;quot;Revision Planning&amp;quot; part. By doing this, we can let students add revision plan before submit their work at round 2 submission.&lt;br /&gt;
&lt;br /&gt;
Changes:&lt;br /&gt;
&lt;br /&gt;
Change the logic, before the round 2 submission, there is no need to judge, directly let the &amp;quot;Revision planning&amp;quot; part invalid. And when it comes to the round 2 submission, the &amp;quot;Your Work&amp;quot; part is invalid, and the &amp;quot;Revision planning&amp;quot; part can be edited.&lt;br /&gt;
&lt;br /&gt;
 past code:&lt;br /&gt;
         &lt;br /&gt;
 &amp;lt;% if @assignment.submission_allowed(@topic_id) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 modified code:&lt;br /&gt;
 app/views/student_task/view.html.erb        &lt;br /&gt;
 &amp;lt;% if (!@can_submit_revision_plan &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) || &lt;br /&gt;
 (@can_submit_revision_plan &amp;amp;&amp;amp; @revision_plan_questionnaire_id &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
Firstly, before the round 2 submission, you can look into your work, but the revision plan.&lt;br /&gt;
[[File:211129-2.png|700px|thumb|center]]&lt;br /&gt;
And then, when it comes to the round 2 submission, if we didn't deal with the &amp;quot;Revision Planning&amp;quot;, then the &amp;quot;Your work&amp;quot; part becomes gray.&lt;br /&gt;
[[File:211129-5.png|700px|thumb|center]]&lt;br /&gt;
After editing the &amp;quot;Revision Planning&amp;quot;, we can submit our work.&lt;br /&gt;
[[File:211129-6.png|700px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review&lt;br /&gt;
Set up assignment with 2 rounds of review. The result is shown above. And here's the figure in the background. We can set the rounds whatever we want.&lt;br /&gt;
[[File:211129-7.png|700px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*3. Revision-planning rubric&lt;br /&gt;
the revision-planning rubric was allowed to be edited after the first round of revision, using a shared template with normal rubric. &lt;br /&gt;
This page will be unavailable during all review periods.&lt;br /&gt;
[[File:gsj_5.png|700px|thumb|center|Revision Plan page exists]]&lt;br /&gt;
The Revision Plan Questionnaire could be edited by specifying the amount of questions and their type. &lt;br /&gt;
Questions can be removed by clicking Remove in the leftmost column. &lt;br /&gt;
Once the questionnaire is complete, it can be saved.&lt;br /&gt;
[[File:gsj_fall2021.png|700px|thumb|center|Edit Revision Plan page demonstrating]]&lt;br /&gt;
In the second round of review, the revision plan questionnaire which edited by autohrs could be seen in a separate section.&lt;br /&gt;
[[File:gsj_1.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
[[File:gsj_3.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
*4. Relocate the method &lt;br /&gt;
The method for determining who's on a team was in RevisionPlanQuestionnairesController, now has been reloacted in team.rb.&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
app/controllers/revision_plan_questionnaires_controller.rb&lt;br /&gt;
    TeamsUser.where([&amp;quot;team_id = ?&amp;quot;, params[:team_id]]).each do |teamuser|&lt;br /&gt;
       @team_members.push( teamuser.user_id)&lt;br /&gt;
    end&lt;br /&gt;
    (user_logged_in? &amp;amp;&amp;amp; @team_members.collect { |u|  }.include?(session[:user].id)) || 1&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
app/models/team.rb &lt;br /&gt;
&lt;br /&gt;
  def self.is_team_members?(team_id,user_id)&lt;br /&gt;
    @team_members = Array.new&lt;br /&gt;
    TeamsUser.where([&amp;quot;team_id = ?&amp;quot;, team_id]).each do |teamuser|&lt;br /&gt;
      @team_members.push(teamuser.user_id)&lt;br /&gt;
    end&lt;br /&gt;
    return @team_members.collect { |u|  }.include?(user_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*5. Code Optimization&lt;br /&gt;
 *Delete the duplicated current_round method.&lt;br /&gt;
 *Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
This is a list of files modified.&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb&lt;br /&gt;
*app/models/team.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/helpers/grades_helper.rb&lt;br /&gt;
*app/models/assignment_participant.rb&lt;br /&gt;
*app/models/response_map.rb &lt;br /&gt;
*app/views/grades/_participant_charts.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*config/routes.rb&lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
*spec/features/assignment_creation_general_tab_spec.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Review Restriction Change====&lt;br /&gt;
In the previous version, students cannot edit the revision plan in the review during the submission phase. However, they just cannot edit during the review phase. There's the change for this mistake.&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Previous1.png|700px|thumb|center|Reviews cannot be done during the submission phase]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:after1.png|700px|thumb|center|Reviews cannot be done during the submission phase]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*rspec spec/controllers/grades_controller_spec.rb &lt;br /&gt;
[[Grades_controller_spec_new.png]]&lt;br /&gt;
*rspec spec/controllers/questionnaires_controller_spec.rb &lt;br /&gt;
*rspec spec/controllers/questions_controller_spec.rb &lt;br /&gt;
*rspec spec/controllers/student_teams_controller_spec.rb &lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec by stubbing get_questions method to pass.&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: Updated spec by adding four examples to test revision plan questionnaires controller&lt;br /&gt;
*spec/factories/revision_plan_factory.rb: Create a new factory.rb to create objects unique to revision plans, including RevisionPlanQuestionnaire RevisionPlanTeamMap&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec by updating expected html output to pass.&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec by updating expected html output to pass.&lt;br /&gt;
&lt;br /&gt;
Helpers&lt;br /&gt;
&lt;br /&gt;
*rspec spec/heplers/grades_helper.rb&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
&lt;br /&gt;
*Can an assignment with revision planning enabled be created?&lt;br /&gt;
*Can an assignment with 2 rounds of review be set up?&lt;br /&gt;
*If the revision-planning rubric can be edited or not?&lt;br /&gt;
*Is the revision plan a separate section?&lt;br /&gt;
*Does the method determining the members of a team existed in team.rb?&lt;br /&gt;
*Dose the system have redundant functions?&lt;br /&gt;
*Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished?&lt;br /&gt;
*Is revision plan editing disabled when assignment is in review stage?&lt;br /&gt;
*Are reviewers shown questions created by reviewees?&lt;br /&gt;
*Does participants show summary of score for revision plan after review deadline has expired?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since we are still working on our project, the following is part of our UI testing.&lt;br /&gt;
&lt;br /&gt;
1. Go to the overview page of the assignment, the revision planning should only be available at 1st review phase.&lt;br /&gt;
[[File:E2152_Revision_Plan_avaliable.png|1000px|center]]&lt;br /&gt;
[[File:E2152_Revision_Plan_unavaliable.png|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=142122</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=142122"/>
		<updated>2021-11-30T00:55:06Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* RSpec Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Force the student to add revision plan before submit their work at round 2 submission.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*In the second round of review, the revision plan questionnaire can be seen in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
[[File:E2152_Rationale.png|410px|center]]&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Force the students to add revision plan before submit their work at round 2 submission&lt;br /&gt;
The revision plan cannot be operated in all of the phases but before round 2 submission. In the round 2 submission, the &amp;quot;Your Work&amp;quot; part cannot be chosen only if you finish to edit the &amp;quot;Revision Planning&amp;quot; part. By doing this, we can let students add revision plan before submit their work at round 2 submission.&lt;br /&gt;
&lt;br /&gt;
Changes:&lt;br /&gt;
&lt;br /&gt;
Change the logic, before the round 2 submission, there is no need to judge, directly let the &amp;quot;Revision planning&amp;quot; part invalid. And when it comes to the round 2 submission, the &amp;quot;Your Work&amp;quot; part is invalid, and the &amp;quot;Revision planning&amp;quot; part can be edited.&lt;br /&gt;
&lt;br /&gt;
 past code:&lt;br /&gt;
         &lt;br /&gt;
 &amp;lt;% if @assignment.submission_allowed(@topic_id) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 modified code:&lt;br /&gt;
 app/views/student_task/view.html.erb        &lt;br /&gt;
 &amp;lt;% if (!@can_submit_revision_plan &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) || &lt;br /&gt;
 (@can_submit_revision_plan &amp;amp;&amp;amp; @revision_plan_questionnaire_id &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
Firstly, before the round 2 submission, you can look into your work, but the revision plan.&lt;br /&gt;
[[File:211129-2.png|700px|thumb|center]]&lt;br /&gt;
And then, when it comes to the round 2 submission, if we didn't deal with the &amp;quot;Revision Planning&amp;quot;, then the &amp;quot;Your work&amp;quot; part becomes gray.&lt;br /&gt;
[[File:211129-5.png|700px|thumb|center]]&lt;br /&gt;
After editing the &amp;quot;Revision Planning&amp;quot;, we can submit our work.&lt;br /&gt;
[[File:211129-6.png|700px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review&lt;br /&gt;
Set up assignment with 2 rounds of review. The result is shown above. And here's the figure in the background. We can set the rounds whatever we want.&lt;br /&gt;
[[File:211129-7.png|700px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*3. Revision-planning rubric&lt;br /&gt;
the revision-planning rubric was allowed to be edited after the first round of revision, using a shared template with normal rubric. &lt;br /&gt;
This page will be unavailable during all review periods.&lt;br /&gt;
&lt;br /&gt;
The Revision Plan Questionnaire could be edited by specifying the amount of questions and their type. &lt;br /&gt;
Questions can be removed by clicking Remove in the leftmost column. &lt;br /&gt;
Once the questionnaire is complete, it can be saved.&lt;br /&gt;
[[File:gsj_fall2021.png|700px|thumb|center|Edit Revision Plan page demonstrating]]&lt;br /&gt;
In the second round of review, the revision plan questionnaire which edited by autohrs could be seen in a separate section.&lt;br /&gt;
[[File:gsj_1.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
[[File:gsj_3.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
*4. Relocate the method &lt;br /&gt;
The method for determining who's on a team was in RevisionPlanQuestionnairesController, now has been reloacted in team.rb.&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
app/controllers/revision_plan_questionnaires_controller.rb&lt;br /&gt;
    TeamsUser.where([&amp;quot;team_id = ?&amp;quot;, params[:team_id]]).each do |teamuser|&lt;br /&gt;
       @team_members.push( teamuser.user_id)&lt;br /&gt;
    end&lt;br /&gt;
    (user_logged_in? &amp;amp;&amp;amp; @team_members.collect { |u|  }.include?(session[:user].id)) || 1&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
app/models/team.rb &lt;br /&gt;
&lt;br /&gt;
  def self.is_team_members?(team_id,user_id)&lt;br /&gt;
    @team_members = Array.new&lt;br /&gt;
    TeamsUser.where([&amp;quot;team_id = ?&amp;quot;, team_id]).each do |teamuser|&lt;br /&gt;
      @team_members.push(teamuser.user_id)&lt;br /&gt;
    end&lt;br /&gt;
    return @team_members.collect { |u|  }.include?(user_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*5. Code Optimization&lt;br /&gt;
 *Delete the duplicated current_round method.&lt;br /&gt;
 *Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Review Restriction Change====&lt;br /&gt;
In the previous version, students cannot edit the revision plan in the review during the submission phase. However, they just cannot edit during the review phase. There's the change for this mistake.&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Previous1.png|700px|thumb|center|Reviews cannot be done during the submission phase]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:after1.png|700px|thumb|center|Reviews cannot be done during the submission phase]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
*change the conditions for submission, which means the second round of assignment cannot be submitted without revision_plan being subbmited first &lt;br /&gt;
 app/views/student_task/view.html.erb&lt;br /&gt;
        before&lt;br /&gt;
        &amp;lt;% if @assignment.submission_allowed(@topic_id) %&amp;gt;&lt;br /&gt;
        after&lt;br /&gt;
        &amp;lt;% if (!@can_submit_revision_plan &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) || &lt;br /&gt;
              (@can_submit_revision_plan &amp;amp;&amp;amp; @revision_plan_questionnaire_id &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*rspec spec/controllers/grades_controller_spec.rb &lt;br /&gt;
[[Grades_controller_spec_result.png]]&lt;br /&gt;
*rspec spec/controllers/questionnaires_controller_spec.rb &lt;br /&gt;
*rspec spec/controllers/questions_controller_spec.rb &lt;br /&gt;
*rspec spec/controllers/student_teams_controller_spec.rb &lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec by stubbing get_questions method to pass.&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: Updated spec by adding four examples to test revision plan questionnaires controller&lt;br /&gt;
*spec/factories/revision_plan_factory.rb: Create a new factory.rb to create objects unique to revision plans, including RevisionPlanQuestionnaire RevisionPlanTeamMap&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec by updating expected html output to pass.&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec by updating expected html output to pass.&lt;br /&gt;
&lt;br /&gt;
Helpers&lt;br /&gt;
&lt;br /&gt;
*rspec spec/heplers/grades_helper.rb&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
&lt;br /&gt;
*Can an assignment with revision planning enabled be created?&lt;br /&gt;
*Can an assignment with 2 rounds of review be set up?&lt;br /&gt;
*If the revision-planning rubric can be edited or not?&lt;br /&gt;
*Is the revision plan a separate section?&lt;br /&gt;
*Does the method determining the members of a team existed in team.rb?&lt;br /&gt;
*Dose the system have redundant functions?&lt;br /&gt;
*Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished?&lt;br /&gt;
*Is revision plan editing disabled when assignment is in review stage?&lt;br /&gt;
*Are reviewers shown questions created by reviewees?&lt;br /&gt;
*Does participants show summary of score for revision plan after review deadline has expired?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since we are still working on our project, the following is part of our UI testing.&lt;br /&gt;
&lt;br /&gt;
1. Go to the overview page of the assignment, the revision planning should only be available at 1st review phase.&lt;br /&gt;
[[File:E2152_Revision_Plan_avaliable.png|1000px|center]]&lt;br /&gt;
[[File:E2152_Revision_Plan_unavaliable.png|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Grades_controller_spec_result.png&amp;diff=142120</id>
		<title>File:Grades controller spec result.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Grades_controller_spec_result.png&amp;diff=142120"/>
		<updated>2021-11-30T00:54:43Z</updated>

		<summary type="html">&lt;p&gt;Yli273: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=142112</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=142112"/>
		<updated>2021-11-30T00:52:45Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* RSpec Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Force the student to add revision plan before submit their work at round 2 submission.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*In the second round of review, the revision plan questionnaire can be seen in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
[[File:E2152_Rationale.png|410px|center]]&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Force the students to add revision plan before submit their work at round 2 submission&lt;br /&gt;
The revision plan cannot be operated in all of the phases but before round 2 submission. In the round 2 submission, the &amp;quot;Your Work&amp;quot; part cannot be chosen only if you finish to edit the &amp;quot;Revision Planning&amp;quot; part. By doing this, we can let students add revision plan before submit their work at round 2 submission.&lt;br /&gt;
&lt;br /&gt;
Changes:&lt;br /&gt;
&lt;br /&gt;
Change the logic, before the round 2 submission, there is no need to judge, directly let the &amp;quot;Revision planning&amp;quot; part invalid. And when it comes to the round 2 submission, the &amp;quot;Your Work&amp;quot; part is invalid, and the &amp;quot;Revision planning&amp;quot; part can be edited.&lt;br /&gt;
&lt;br /&gt;
 past code:&lt;br /&gt;
         &lt;br /&gt;
 &amp;lt;% if @assignment.submission_allowed(@topic_id) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 modified code:&lt;br /&gt;
 app/views/student_task/view.html.erb        &lt;br /&gt;
 &amp;lt;% if (!@can_submit_revision_plan &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) || &lt;br /&gt;
 (@can_submit_revision_plan &amp;amp;&amp;amp; @revision_plan_questionnaire_id &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
Firstly, before the round 2 submission, you can look into your work, but the revision plan.&lt;br /&gt;
[[File:211129-2.png|700px|thumb|center]]&lt;br /&gt;
And then, when it comes to the round 2 submission, if we didn't deal with the &amp;quot;Revision Planning&amp;quot;, then the &amp;quot;Your work&amp;quot; part becomes gray.&lt;br /&gt;
[[File:211129-5.png|700px|thumb|center]]&lt;br /&gt;
After editing the &amp;quot;Revision Planning&amp;quot;, we can submit our work.&lt;br /&gt;
[[File:211129-6.png|700px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review&lt;br /&gt;
Set up assignment with 2 rounds of review. The result is shown above. And here's the figure in the background. We can set the rounds whatever we want.&lt;br /&gt;
[[File:211129-7.png|700px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*3. Revision-planning rubric&lt;br /&gt;
the revision-planning rubric was allowed to be edited after the first round of revision, using a shared template with normal rubric. &lt;br /&gt;
This page will be unavailable during all review periods.&lt;br /&gt;
&lt;br /&gt;
The Revision Plan Questionnaire could be edited by specifying the amount of questions and their type. &lt;br /&gt;
Questions can be removed by clicking Remove in the leftmost column. &lt;br /&gt;
Once the questionnaire is complete, it can be saved.&lt;br /&gt;
[[File:gsj_fall2021.png|700px|thumb|center|Edit Revision Plan page demonstrating]]&lt;br /&gt;
In the second round of review, the revision plan questionnaire which edited by autohrs could be seen in a separate section.&lt;br /&gt;
[[File:gsj_1.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
[[File:gsj_3.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
*4. Relocate the method &lt;br /&gt;
The method for determining who's on a team was in RevisionPlanQuestionnairesController, now has been reloacted in team.rb.&lt;br /&gt;
Before&lt;br /&gt;
 app/controllers/revision_plan_questionnaires_controller.rb&lt;br /&gt;
&lt;br /&gt;
After&lt;br /&gt;
 app/models/team.rb &lt;br /&gt;
&lt;br /&gt;
  def self.is_team_members?(team_id,user_id)&lt;br /&gt;
    @team_members = Array.new&lt;br /&gt;
    TeamsUser.where([&amp;quot;team_id = ?&amp;quot;, team_id]).each do |teamuser|&lt;br /&gt;
      @team_members.push(teamuser.user_id)&lt;br /&gt;
    end&lt;br /&gt;
    return @team_members.collect { |u|  }.include?(user_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*5. Code Optimization&lt;br /&gt;
 *Delete the duplicated current_round method.&lt;br /&gt;
 *Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Review Restriction Change====&lt;br /&gt;
In the previous version, students cannot edit the revision plan in the review during the submission phase. However, they just cannot edit during the review phase. There's the change for this mistake.&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Previous1.png|700px|thumb|center|Reviews cannot be done during the submission phase]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:after1.png|700px|thumb|center|Reviews cannot be done during the submission phase]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
*change the conditions for submission, which means the second round of assignment cannot be submitted without revision_plan being subbmited first &lt;br /&gt;
 app/views/student_task/view.html.erb&lt;br /&gt;
        before&lt;br /&gt;
        &amp;lt;% if @assignment.submission_allowed(@topic_id) %&amp;gt;&lt;br /&gt;
        after&lt;br /&gt;
        &amp;lt;% if (!@can_submit_revision_plan &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) || &lt;br /&gt;
              (@can_submit_revision_plan &amp;amp;&amp;amp; @revision_plan_questionnaire_id &amp;amp;&amp;amp; @assignment.submission_allowed(@topic_id)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*rspec spec/controllers/grades_controller_spec.rb &lt;br /&gt;
*rspec spec/controllers/questionnaires_controller_spec.rb &lt;br /&gt;
*rspec spec/controllers/questions_controller_spec.rb &lt;br /&gt;
*rspec spec/controllers/student_teams_controller_spec.rb &lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec by stubbing get_questions method to pass.&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: Updated spec by adding four examples to test revision plan questionnaires controller&lt;br /&gt;
*spec/factories/revision_plan_factory.rb: Create a new factory.rb to create objects unique to revision plans, including RevisionPlanQuestionnaire RevisionPlanTeamMap&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec by updating expected html output to pass.&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec by updating expected html output to pass.&lt;br /&gt;
&lt;br /&gt;
Helpers&lt;br /&gt;
&lt;br /&gt;
*rspec spec/heplers/grades_helper.rb&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
&lt;br /&gt;
*Can an assignment with revision planning enabled be created?&lt;br /&gt;
*Can an assignment with 2 rounds of review be set up?&lt;br /&gt;
*If the revision-planning rubric can be edited or not?&lt;br /&gt;
*Is the revision plan a separate section?&lt;br /&gt;
*Does the method determining the members of a team existed in team.rb?&lt;br /&gt;
*Dose the system have redundant functions?&lt;br /&gt;
*Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished?&lt;br /&gt;
*Is revision plan editing disabled when assignment is in review stage?&lt;br /&gt;
*Are reviewers shown questions created by reviewees?&lt;br /&gt;
*Does participants show summary of score for revision plan after review deadline has expired?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since we are still working on our project, the following is part of our UI testing.&lt;br /&gt;
&lt;br /&gt;
1. Go to the overview page of the assignment, the revision planning should only be available at 1st review phase.&lt;br /&gt;
[[File:E2152_Revision_Plan_avaliable.png|1000px|center]]&lt;br /&gt;
[[File:E2152_Revision_Plan_unavaliable.png|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141029</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141029"/>
		<updated>2021-11-06T21:56:29Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Rationale.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan check box should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
*2. Set up assignments&lt;br /&gt;
Set up assignment with 2 rounds of review. The Revision Planning link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking Revision Planning students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan @can_submit_revision_plan field is added to StudentTaskController's view action. If a revision plan questionnaire (@revision_plan_questionnaire_id) exists for the current round then clicking the link performs RevisionPlanQuestionnairesController's edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
*3. Revision-planning rubric&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template. After creating the Revision Plan Questionnaire, it must be edited. Questions can be added by specifying the amount of questions and their type. Questions can be removed by clicking Remove in the leftmost column. Once the questionnaire is complete, it can be saved. This page will be visible during each submission period after the first and will be unavailable during all review periods.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
*4. Report Summary&lt;br /&gt;
Instructors and students can view the review report with the revision plan placed in a separate section. When a project has been reviewed at least once, a participant is able to view their team's score. The UI below shows what this looks like after the second round of reviews. For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under Assignment Questionnaire. The results of the questions created by the team are shown under Improvement Plan.&lt;br /&gt;
&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
*5. Code Optimization&lt;br /&gt;
 *Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
 *Delete the duplicated current_round method.&lt;br /&gt;
 *Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141027</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141027"/>
		<updated>2021-11-06T21:55:59Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Rationale.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan check box should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
*2. Set up assignments&lt;br /&gt;
Set up assignment with 2 rounds of review. The Revision Planning link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking Revision Planning students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan @can_submit_revision_plan field is added to StudentTaskController's view action. If a revision plan questionnaire (@revision_plan_questionnaire_id) exists for the current round then clicking the link performs RevisionPlanQuestionnairesController's edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
*3. Revision-planning rubric&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template. After creating the Revision Plan Questionnaire, it must be edited. Questions can be added by specifying the amount of questions and their type. Questions can be removed by clicking Remove in the leftmost column. Once the questionnaire is complete, it can be saved. This page will be visible during each submission period after the first and will be unavailable during all review periods.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
*4. Report Summary&lt;br /&gt;
Instructors and students can view the review report with the revision plan placed in a separate section. When a project has been reviewed at least once, a participant is able to view their team's score. The UI below shows what this looks like after the second round of reviews. For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under Assignment Questionnaire. The results of the questions created by the team are shown under Improvement Plan.&lt;br /&gt;
&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
*5. Code Optimization&lt;br /&gt;
Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
Delete the duplicated current_round method.&lt;br /&gt;
Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141026</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141026"/>
		<updated>2021-11-06T21:53:43Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Rationale.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan check box should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
*2. Set up assignments&lt;br /&gt;
Set up assignment with 2 rounds of review. The Revision Planning link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking Revision Planning students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan @can_submit_revision_plan field is added to StudentTaskController's view action. If a revision plan questionnaire (@revision_plan_questionnaire_id) exists for the current round then clicking the link performs RevisionPlanQuestionnairesController's edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
*3. Revision-planning rubric&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Code Optimization&lt;br /&gt;
Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
Delete the duplicated current_round method.&lt;br /&gt;
Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141025</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141025"/>
		<updated>2021-11-06T21:48:33Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Rationale.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan check box should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
*2. Set up assignments&lt;br /&gt;
Set up assignment with 2 rounds of review. The Revision Planning link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking Revision Planning students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan @can_submit_revision_plan field is added to StudentTaskController's view action. If a revision plan questionnaire (@revision_plan_questionnaire_id) exists for the current round then clicking the link performs RevisionPlanQuestionnairesController's edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141024</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141024"/>
		<updated>2021-11-06T21:48:05Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Rationale.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan check box should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
*2. Set up assignment with 2 rounds of review&lt;br /&gt;
The Revision Planning link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking Revision Planning students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan @can_submit_revision_plan field is added to StudentTaskController's view action. If a revision plan questionnaire (@revision_plan_questionnaire_id) exists for the current round then clicking the link performs RevisionPlanQuestionnairesController's edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141023</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141023"/>
		<updated>2021-11-06T21:46:14Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Proposed Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Rationale.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase.&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan check box should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
*2. Set up assignment with 2 rounds of review.&lt;br /&gt;
The Revision Planning link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking Revision Planning students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan @can_submit_revision_plan field is added to StudentTaskController's view action. If a revision plan questionnaire (@revision_plan_questionnaire_id) exists for the current round then clicking the link performs RevisionPlanQuestionnairesController's edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141016</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141016"/>
		<updated>2021-11-06T21:35:29Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase.&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan check box should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The general workflow is shown bellow.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Rationale.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2152_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141009</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141009"/>
		<updated>2021-11-06T21:32:46Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase.&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan? should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141008</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141008"/>
		<updated>2021-11-06T21:32:19Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
=Proposed Solution=&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase.&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan? should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141006</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141006"/>
		<updated>2021-11-06T21:31:11Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Enable Revision Planning during the review phase.&lt;br /&gt;
Let the author make a choice to decide whether to enable revision planning during the review phase. In order to enable Revision Planning, the setting must be enabled when creating or editing an assignment under the General tab. The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly. Revision plan? should be checked to enable this option.&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141005</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141005"/>
		<updated>2021-11-06T21:27:12Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
*1. Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141004</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141004"/>
		<updated>2021-11-06T21:27:03Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
1. Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
6. Delete the duplicated current_round method.&lt;br /&gt;
7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141003</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141003"/>
		<updated>2021-11-06T21:26:53Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
1. Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
6. Delete the duplicated current_round method.&lt;br /&gt;
7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*1. Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141002</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141002"/>
		<updated>2021-11-06T21:22:34Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Problems with Previous Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*1. Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141001</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=141001"/>
		<updated>2021-11-06T21:22:10Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Problems with Previous Implementation===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*1. Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140997</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140997"/>
		<updated>2021-11-06T21:14:44Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
[[File:E2152_Problem_Statement.png|400px|center]]&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
*Delete the duplicated current_round method.&lt;br /&gt;
*Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*1. Let the authors be able to edit the revision plan during the review phase.&lt;br /&gt;
&lt;br /&gt;
*2. Set up an assignment with 2 rounds of review.&lt;br /&gt;
&lt;br /&gt;
*3. Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
&lt;br /&gt;
*4. Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
&lt;br /&gt;
*5. Relocate the method for determining who's on a team in RevisionPlanQuestionnairesController to team.rb.&lt;br /&gt;
&lt;br /&gt;
*6. Delete the duplicated current_round method.&lt;br /&gt;
&lt;br /&gt;
*7. Split the conditional statements of generate_heatgrid into smaller subclass methods.&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
* The revision-planning rubric can be edited.&lt;br /&gt;
*The revision plan will be placed in a separate section.&lt;br /&gt;
*The method for determining who's on a team would be located in team.rb.&lt;br /&gt;
*Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140868</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140868"/>
		<updated>2021-11-04T02:32:06Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. &lt;br /&gt;
*However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
*7. Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*8. Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*9. Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140866</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140866"/>
		<updated>2021-11-04T02:31:53Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then the second round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. &lt;br /&gt;
*However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
*There should be 2 rounds of reviews. And reviews should only be available at the review phase, not at the submission phase. Also, students should not be able to edit the revision plan during the review phase.	&lt;br /&gt;
*After implementation, only a reasonable number of the most important and directly related files have been modified.	&lt;br /&gt;
*There will be concise comments for new code to indicate the purpose.	&lt;br /&gt;
*Compared to the previous teams, there will only be a reasonable amount of new code.&lt;br /&gt;
*7 Delete the redundant functions and test the system's integrity.&lt;br /&gt;
*8 Break down the long functions into small functions and reduce conditional cases, then test the system's integrity.&lt;br /&gt;
*9 Reduce the score calculation and test the system's integrity.&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140367</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140367"/>
		<updated>2021-11-01T23:49:28Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Previous Implementations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second�round reviewers would assess how well they did it. In essence,&lt;br /&gt;
this means that authors would be adding criteria to the second�round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented three times before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875], once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. &lt;br /&gt;
*However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140366</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140366"/>
		<updated>2021-11-01T23:48:52Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Previous Implementations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second�round reviewers would assess how well they did it. In essence,&lt;br /&gt;
this means that authors would be adding criteria to the second�round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016 E2083]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. &lt;br /&gt;
*However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140364</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140364"/>
		<updated>2021-11-01T23:48:23Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Previous Implementations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] and another one in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. &lt;br /&gt;
*However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140363</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140363"/>
		<updated>2021-11-01T23:46:39Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Previous Implementations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. &lt;br /&gt;
*However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140362</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140362"/>
		<updated>2021-11-01T23:45:47Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Goals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
*Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. &lt;br /&gt;
*However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
*Set up an assignment with 2 rounds of review.&lt;br /&gt;
*Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template.&lt;br /&gt;
*Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
*In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
*The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
*The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
*A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
*Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
*The code should have more comments.&lt;br /&gt;
*The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140361</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140361"/>
		<updated>2021-11-01T23:44:11Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Huangxing Chen (hchen63)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Yi Li (yli273)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shengjie Guo (sguo25)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Nicholas Himes (nnhimes@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140357</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140357"/>
		<updated>2021-11-01T23:38:53Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Rationale */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second round reviewers would assess how well they did it. In essence,&lt;br /&gt;
this means that authors would be adding criteria to the second round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140356</id>
		<title>CSC/ECE 517 Fall 2021 - E2152. Revision planning tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool&amp;diff=140356"/>
		<updated>2021-11-01T23:38:47Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
Students cannot edit the revision plan in the review phase so the review doesn't get changed while other students are reviewing. However, it assumes that reviews cannot be done during the submission phase. Code needs to be written to take care of this part.&lt;br /&gt;
Set up an assignment with 2 rounds of review.&lt;br /&gt;
Allow editing the revision-planning rubric just like editing a normal rubric, using a shared template&lt;br /&gt;
.Instructors and students can view the review report with the revision plan placed in a separate section.&lt;br /&gt;
In RevisionPlanQuestionnairesController, the method for determining who's on a team would be better located in team.rb.&lt;br /&gt;
The current_round method duplicates a method elsewhere in the system.&lt;br /&gt;
The generate_heatgrid has too many conditional statements. It would be better to split it into smaller methods.&lt;br /&gt;
A lot of code deals with score calculations, which shouldn't be a concern for this project.&lt;br /&gt;
Too many files are involved, although they seem to make reasonable decisions about their changes.&lt;br /&gt;
The code should have more comments.&lt;br /&gt;
The team had a good initial design but took as twice much as LoC compared to the previous teams.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
&lt;br /&gt;
===Goals===&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=140046</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=140046"/>
		<updated>2021-10-25T21:40:41Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Manual UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Description of the project ==&lt;br /&gt;
The focus of the project is on a controller named ReviewMappingController and the primary goal is to make changes to the internal structure of the controller to make it easier to read and cheaper to maintain without changing its observable behavior. This can be achieved through refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing redundant code, etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Pull Request Submitted: [https://github.com/expertiza/expertiza/pull/2060] &amp;lt;br/&amp;gt;&lt;br /&gt;
link to the deployed project: [http://152.7.176.14:8080/] &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Repository: [https://github.com/JesseChen1031/expertiza] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flow Chart &amp;amp; Design Pattern ==&lt;br /&gt;
[[File:Work_flow.png|1000px]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were asked to refactor the long methods in review_mapping_controller.rb. We followed the flow chart above during the refactoring process. It happened many times when the Rspec test suit and Cucumber tests passed locally, but ran into an issue when we commit changes on GitHub. The error log from the TRAVIS CI helped us identify the issue. Then we debugged on local machine and followed the whole implementation process again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimal issues.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer review.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :i_dont_care to :no_particular_topic. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:i_dont_care1.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :add_reviewer to :assign_reviewer_dynamically. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Add_Reviewer.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :student_review_num to :num_reviews_per_students. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :submission_review_num to :num_reviews_per_submission. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Student_review_num.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :participants_hash to :team_participants_hash. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Participants_hash.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :replace hardcoded parameter (e.g.,0 and 1) with meaningful zero_review and one_review naming scheme.  &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Hardcoded.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
According to the introduction, the modification of this project is about review_mapping_controller.rb. The main job of this controller is to correctly assign the review to each student who is requesting them for a certain assignment. Unfortunately, the deployed project database is not complete, and student accounts cannot be created. Therefore, we cannot use the deployed project to give a complete UI test plan. &lt;br /&gt;
&lt;br /&gt;
In fact, due to system reasons, the internal logic of these controllers cannot be tested using UI tests because they are work flow and logic that have nothing to do with the UI. (The work flow can be found here [https://expertiza.csc.ncsu.edu/index.php/Review_mappings]) So we will re-introduce and emphasis the tests in Rspec unit test section to explain why the project is still complete after modification.&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a refactoring project, We followed the implementation flowchart provided in the above section step by step. In the refactoring process, we made sure that the changes did not break any functionality and passed all the existing test cases. Additionally, we added select_metareviewer to capture one edge case scenario. New test case select_metareviewer makes sure that ReponseMap can be correctly found. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current test suit carefully follows Test Driven Development (TDD) approach, and offers testers automated testing environment using rSpec. The tests take advantages of double and stub features of rSpec gems, and pre-define different user types (e.g., instructor and student) in each case for different purpose. Testers can enter &amp;quot;rspec spec/controllers/review_mapping_controller_spec.rb&amp;quot; command in the terminal to execute the automated rspec test suit. After execution of the test cases, result of passing all test cases is shown as below.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png|1000px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If you are interested in what each test case does, the link below is highly recommended for you to review as you could get better understanding by reading the assertion per test case: &amp;lt;br/&amp;gt;&lt;br /&gt;
https://github.com/JesseChen1031/expertiza/blob/master/spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
Our project passed the Travis CI build test.&lt;br /&gt;
&lt;br /&gt;
[[File:Build_pass.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
The code Coverage for Controllers has increased as shown below. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43657457/source?filename=app%2Fcontrollers%2Freview_mapping_controller.rb] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:Coverall.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=140045</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=140045"/>
		<updated>2021-10-25T21:40:26Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Manual UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Description of the project ==&lt;br /&gt;
The focus of the project is on a controller named ReviewMappingController and the primary goal is to make changes to the internal structure of the controller to make it easier to read and cheaper to maintain without changing its observable behavior. This can be achieved through refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing redundant code, etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Pull Request Submitted: [https://github.com/expertiza/expertiza/pull/2060] &amp;lt;br/&amp;gt;&lt;br /&gt;
link to the deployed project: [http://152.7.176.14:8080/] &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Repository: [https://github.com/JesseChen1031/expertiza] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flow Chart &amp;amp; Design Pattern ==&lt;br /&gt;
[[File:Work_flow.png|1000px]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were asked to refactor the long methods in review_mapping_controller.rb. We followed the flow chart above during the refactoring process. It happened many times when the Rspec test suit and Cucumber tests passed locally, but ran into an issue when we commit changes on GitHub. The error log from the TRAVIS CI helped us identify the issue. Then we debugged on local machine and followed the whole implementation process again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimal issues.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer review.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :i_dont_care to :no_particular_topic. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:i_dont_care1.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :add_reviewer to :assign_reviewer_dynamically. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Add_Reviewer.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :student_review_num to :num_reviews_per_students. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :submission_review_num to :num_reviews_per_submission. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Student_review_num.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :participants_hash to :team_participants_hash. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Participants_hash.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :replace hardcoded parameter (e.g.,0 and 1) with meaningful zero_review and one_review naming scheme.  &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Hardcoded.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
According to the introduction, the modification of this project is about review_mapping_controller.rb. The main job of this controller is to correctly assign the review to each student who is requesting them for a certain assignment. Unfortunately, the deployed project database is not complete, and student accounts cannot be created. Therefore, we cannot use the deployed project to give a complete UI test plan. &lt;br /&gt;
&lt;br /&gt;
In fact, due to system reasons, the internal logic of these controllers cannot be tested using UI tests because they are work flow and logic that have nothing to do with the UI. (The work flow can be found here [https://expertiza.csc.ncsu.edu/index.php/Review_mappings])So we will re-introduce and emphasis the tests in Rspec unit test section to explain why the project is still complete after modification.&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a refactoring project, We followed the implementation flowchart provided in the above section step by step. In the refactoring process, we made sure that the changes did not break any functionality and passed all the existing test cases. Additionally, we added select_metareviewer to capture one edge case scenario. New test case select_metareviewer makes sure that ReponseMap can be correctly found. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current test suit carefully follows Test Driven Development (TDD) approach, and offers testers automated testing environment using rSpec. The tests take advantages of double and stub features of rSpec gems, and pre-define different user types (e.g., instructor and student) in each case for different purpose. Testers can enter &amp;quot;rspec spec/controllers/review_mapping_controller_spec.rb&amp;quot; command in the terminal to execute the automated rspec test suit. After execution of the test cases, result of passing all test cases is shown as below.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png|1000px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If you are interested in what each test case does, the link below is highly recommended for you to review as you could get better understanding by reading the assertion per test case: &amp;lt;br/&amp;gt;&lt;br /&gt;
https://github.com/JesseChen1031/expertiza/blob/master/spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
Our project passed the Travis CI build test.&lt;br /&gt;
&lt;br /&gt;
[[File:Build_pass.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
The code Coverage for Controllers has increased as shown below. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43657457/source?filename=app%2Fcontrollers%2Freview_mapping_controller.rb] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:Coverall.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=140044</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=140044"/>
		<updated>2021-10-25T21:39:25Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Description of the project ==&lt;br /&gt;
The focus of the project is on a controller named ReviewMappingController and the primary goal is to make changes to the internal structure of the controller to make it easier to read and cheaper to maintain without changing its observable behavior. This can be achieved through refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing redundant code, etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Pull Request Submitted: [https://github.com/expertiza/expertiza/pull/2060] &amp;lt;br/&amp;gt;&lt;br /&gt;
link to the deployed project: [http://152.7.176.14:8080/] &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Repository: [https://github.com/JesseChen1031/expertiza] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flow Chart &amp;amp; Design Pattern ==&lt;br /&gt;
[[File:Work_flow.png|1000px]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were asked to refactor the long methods in review_mapping_controller.rb. We followed the flow chart above during the refactoring process. It happened many times when the Rspec test suit and Cucumber tests passed locally, but ran into an issue when we commit changes on GitHub. The error log from the TRAVIS CI helped us identify the issue. Then we debugged on local machine and followed the whole implementation process again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimal issues.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer review.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :i_dont_care to :no_particular_topic. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:i_dont_care1.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :add_reviewer to :assign_reviewer_dynamically. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Add_Reviewer.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :student_review_num to :num_reviews_per_students. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :submission_review_num to :num_reviews_per_submission. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Student_review_num.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :participants_hash to :team_participants_hash. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Participants_hash.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :replace hardcoded parameter (e.g.,0 and 1) with meaningful zero_review and one_review naming scheme.  &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Hardcoded.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
&lt;br /&gt;
According to the introduction, the modification of this project is about review_mapping_controller.rb. The main job of this controller is to correctly assign the review to each student who is requesting them for a certain assignment. Unfortunately, the deployed project database is not complete, and student accounts cannot be created. Therefore, we cannot use the deployed project to give a complete UI test plan. In fact, due to system reasons, the internal logic of these controllers cannot be tested using UI tests because they are work flow and logic that have nothing to do with the UI. So we will re-introduce and emphasis the tests in Rspec unit test section to explain why the project is still complete after modification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a refactoring project, We followed the implementation flowchart provided in the above section step by step. In the refactoring process, we made sure that the changes did not break any functionality and passed all the existing test cases. Additionally, we added select_metareviewer to capture one edge case scenario. New test case select_metareviewer makes sure that ReponseMap can be correctly found. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current test suit carefully follows Test Driven Development (TDD) approach, and offers testers automated testing environment using rSpec. The tests take advantages of double and stub features of rSpec gems, and pre-define different user types (e.g., instructor and student) in each case for different purpose. Testers can enter &amp;quot;rspec spec/controllers/review_mapping_controller_spec.rb&amp;quot; command in the terminal to execute the automated rspec test suit. After execution of the test cases, result of passing all test cases is shown as below.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png|1000px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If you are interested in what each test case does, the link below is highly recommended for you to review as you could get better understanding by reading the assertion per test case: &amp;lt;br/&amp;gt;&lt;br /&gt;
https://github.com/JesseChen1031/expertiza/blob/master/spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
Our project passed the Travis CI build test.&lt;br /&gt;
&lt;br /&gt;
[[File:Build_pass.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
The code Coverage for Controllers has increased as shown below. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43657457/source?filename=app%2Fcontrollers%2Freview_mapping_controller.rb] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:Coverall.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=140040</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=140040"/>
		<updated>2021-10-25T21:29:41Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Rspec Unit Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Description of the project ==&lt;br /&gt;
The focus of the project is on a controller named ReviewMappingController and the primary goal is to make changes to the internal structure of the controller to make it easier to read and cheaper to maintain without changing its observable behavior. This can be achieved through refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing redundant code, etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Pull Request Submitted: [https://github.com/expertiza/expertiza/pull/2060] &amp;lt;br/&amp;gt;&lt;br /&gt;
link to the deployed project: [http://152.7.176.14:8080/] &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Repository: [https://github.com/JesseChen1031/expertiza] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flow Chart &amp;amp; Design Pattern ==&lt;br /&gt;
[[File:Work_flow.png|1000px]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were asked to refactor the long methods in review_mapping_controller.rb. We followed the flow chart above during the refactoring process. It happened many times when the Rspec test suit and Cucumber tests passed locally, but ran into an issue when we commit changes on GitHub. The error log from the TRAVIS CI helped us identify the issue. Then we debugged on local machine and followed the whole implementation process again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimal issues.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer review.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :i_dont_care to :no_particular_topic. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:i_dont_care1.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :add_reviewer to :assign_reviewer_dynamically. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Add_Reviewer.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :student_review_num to :num_reviews_per_students. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :submission_review_num to :num_reviews_per_submission. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Student_review_num.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :participants_hash to :team_participants_hash. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Participants_hash.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :replace hardcoded parameter (e.g.,0 and 1) with meaningful zero_review and one_review naming scheme.  &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Hardcoded.png|1000px]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a refactoring project, We followed the implementation flowchart provided in the above section step by step. In the refactoring process, we made sure that the changes did not break any functionality and passed all the existing test cases. Additionally, we added select_metareviewer to capture one edge case scenario. New test case select_metareviewer makes sure that ReponseMap can be correctly found. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current test suit carefully follows Test Driven Development (TDD) approach, and offers testers automated testing environment using rSpec. The tests take advantages of double and stub features of rSpec gems, and pre-define different user types (e.g., instructor and student) in each case for different purpose. Testers can enter &amp;quot;rspec spec/controllers/review_mapping_controller_spec.rb&amp;quot; command in the terminal to execute the automated rspec test suit. After execution of the test cases, result of passing all test cases is shown as below.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png|1000px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are interested in what each test case does, the link below is highly recommended for you to review as you could get better understanding by the assertion per test case: &amp;lt;br/&amp;gt;&lt;br /&gt;
https://github.com/JesseChen1031/expertiza/blob/master/spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
Our project passed the Travis CI build test.&lt;br /&gt;
&lt;br /&gt;
[[File:Build_pass.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up as shown below. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43657457/source?filename=app%2Fcontrollers%2Freview_mapping_controller.rb] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:Coverall.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139846</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139846"/>
		<updated>2021-10-21T03:44:50Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Description of the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Description of the project ==&lt;br /&gt;
The focus of the project is on a controller named ReviewMappingController and the primary goal is to make changes to the internal structure of the controller to make it easier to read and cheaper to maintain without changing its observable behavior. This can be achieved through refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing redundant code, etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Pull Request Submitted: [https://github.com/expertiza/expertiza/pull/2060] &amp;lt;br/&amp;gt;&lt;br /&gt;
link to the deployed project: [http://152.7.98.115:8080/] &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Repository: [https://github.com/JesseChen1031/expertiza] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:Work_flow.png|1000px]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :i_dont_care to :no_particular_topic. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
Our project passed the Travis CI build test.&lt;br /&gt;
&lt;br /&gt;
[[File:Build_pass.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43657457/source?filename=app%2Fcontrollers%2Freview_mapping_controller.rb] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:Coverall.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139820</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139820"/>
		<updated>2021-10-21T03:29:46Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Description of the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Description of the project ==&lt;br /&gt;
The focus of the project is on a controller named ReviewMappingController and the primary goal is to make changes to the internal structure of the controller to make it easier to read and cheaper to maintain without changing its observable behavior. This can be achieved through refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing redundant code, etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Pull Request Submitted: [https://github.com/expertiza/expertiza/pull/2060] &amp;lt;br/&amp;gt;&lt;br /&gt;
link to the deployed project: [http://152.46.17.120:8080/] &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Repository: [https://github.com/JesseChen1031/expertiza] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:Work_flow.png|1000px]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :i_dont_care to :no_particular_topic. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139819</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139819"/>
		<updated>2021-10-21T03:27:50Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Description of the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Description of the project ==&lt;br /&gt;
The focus of the project is on a controller named ReviewMappingController and the primary goal is to make changes to the internal structure of the controller to make it easier to read and cheaper to maintain without changing its observable behavior. This can be achieved through refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing redundant code, etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Pull Request Submitted: [] &amp;lt;br/&amp;gt;&lt;br /&gt;
link to the deployed project: [http://152.46.17.120:8080/] &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Repository: [] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:Work_flow.png|1000px]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :i_dont_care to :no_particular_topic. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png|1000px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png|1000px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139807</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139807"/>
		<updated>2021-10-21T03:19:08Z</updated>

		<summary type="html">&lt;p&gt;Yli273: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Description of the project ==&lt;br /&gt;
The focus of the project is on a controller named ReviewMappingController and the primary goal is to make changes to the internal structure of the controller to make it easier to read and cheaper to maintain without changing its observable behavior. This can be achieved through refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing redundant code, etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Pull Request Submitted: [1] &amp;lt;br/&amp;gt;&lt;br /&gt;
link to the deployed project:&amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the Repository: [2] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:Work_flow.png]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :i_dont_care to :no_particular_topic. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139795</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139795"/>
		<updated>2021-10-21T03:01:42Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Details of the changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:flowchart.png]]&lt;br /&gt;
[[File:Example.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Changed :i_dont_care to :no_particular_topic. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139794</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139794"/>
		<updated>2021-10-21T03:01:10Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Details of the changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:flowchart.png]]&lt;br /&gt;
[[File:Example.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Rename variable names and remove hardcoded paramters.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Changed :i_dont_care to :no_particular_topic.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Jialin Cui (jcui9@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yi Li (yli273@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Zijun Lu (zlu5@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Huangxing Chen (hchen63@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139781</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139781"/>
		<updated>2021-10-21T02:53:15Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Details of the changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:FlowchartOODD.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Long and reusable code were sorted out to form a new helper function.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Changed :i_dont_care to :no_particular_topic&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Refactored Peer_review_strategy by using a helper method gen_random_participant_id &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  ## Helper Method for generating a random participant which is to be used in peer_review_strategy method.&lt;br /&gt;
  def gen_random_participant_id(iterator, participants_hash, num_participants, participants)&lt;br /&gt;
    if iterator.zero?&lt;br /&gt;
        rand_num = rand(0..num_participants - 1)&lt;br /&gt;
    else&lt;br /&gt;
        min_value = participants_hash.values.min&lt;br /&gt;
        # get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
        participants_with_min_assigned_reviews = []&lt;br /&gt;
        participants.each do |participant|&lt;br /&gt;
          participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
        end&lt;br /&gt;
    # if participants_with_min_assigned_reviews is blank&lt;br /&gt;
    no_particpants = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
    # or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
    participant_is_owner = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
    rand_num = if no_particpants or participant_is_owner&lt;br /&gt;
                 # use original method to get random number&lt;br /&gt;
                 rand(0..num_participants - 1)&lt;br /&gt;
               else&lt;br /&gt;
                 # rand_num should be the position of this participant in original array&lt;br /&gt;
                 participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size - 1)]&lt;br /&gt;
               end&lt;br /&gt;
    end&lt;br /&gt;
    return rand_num&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. Refactored automatic_review_mapping by using a helper method check_num_reviews_args &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Parameters such as num_reviews_per_student, num_calibrated_artifacts etc passed are first verified to check if they are in acceptable range or pattern  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *To increase readability, the not-so good looking sets of if-else statements have been moved into check_num_reviews_args method.  &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Helper Method to check num_reviews_per_student and num_reviews_per_submission arguments passed in by params hash.&lt;br /&gt;
  def check_num_reviews_args(num_reviews_per_student, num_reviews_per_submission, teams)&lt;br /&gt;
    has_error_not_raised = true&lt;br /&gt;
    # check for exit paths first&lt;br /&gt;
    if num_reviews_per_student == 0 and num_reviews_per_submission == 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student).&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student != 0 and num_reviews_per_submission != 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student), not both.&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student &amp;gt;= teams.size&lt;br /&gt;
      # Exception detection: If instructor want to assign too many reviews done&lt;br /&gt;
      # by each student, there will be an error msg.&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done ' \&lt;br /&gt;
                       'by each student to be greater than or equal to total number of teams ' \&lt;br /&gt;
                       '[or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
7. Modularized helper methods into a module and was mixed in the ReviewMappingController Class. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Only some of the  methods written in the class have external usage i.e called by another controllers, views etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The other methods are just helpers and as such moved into a Helper method module and mixed in the class &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Before Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
    512 Lines &amp;amp; 25 Methods Defined (After moving a few methods into separate controllers)&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  module Helper_methods&lt;br /&gt;
  ...................&lt;br /&gt;
  5 Methods and 170 lines&lt;br /&gt;
  ...................&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    include Helper_methods&lt;br /&gt;
    ...................&lt;br /&gt;
    340 Lines &amp;amp; 20 Methods (All of those are used elsewhere directly in the application)&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Abided to the principles of Magic Tricks of testing and did not test any internally used methods, The other tests are written were already following this principle. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Internally used methods were not tested &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Tests for newly created controllers have been moved into a separate spec files. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. Isolated AssignQuizDynamically method into a separate controller as the functionality was not related to ReviewMappingController. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method assigns a quiz(Stored as an assignment object) to the participant. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method is not related to ReviewMapping functionality, so it was made into a new controller. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Associated Specs/routes/views/partials have been modified to adapt the change in controllers. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths present in the views/partials have to be changed to not to break the functionality &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths in views/partials/routes have been changed for the newly created controller of AssignQuizDynamically &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
View File Affected by the creation of AssinQuizController&lt;br /&gt;
[[File:View.png]]&lt;br /&gt;
&lt;br /&gt;
11. student_review_num sounds like a number or an id associated with a student review, while it actually stores the number of reviews that a student can perform. So it is renamed num_reviews_per_student. &amp;lt;br/&amp;gt;&lt;br /&gt;
12. submission_review_num sounds like a number or an id associated with a submission review, while it actually stores the total number of reviews that can be performed on a single submission. So it is renamed num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
13. calibrated_artifacts_num sounds like a number or an id associated with the calibrated artifacts, while it actually stores the number of calibrated artifacts. So it is renamed num_calibrated_artifacts. Similarly, uncalibrated_artifacts_num is renamed num_uncalibrated_artifacts.&amp;lt;br/&amp;gt;&lt;br /&gt;
14. participants_hash is not an appropriate name for a hash whose keys are participant ids and values are number of reviews performed by corresponding participants. So it is renamed num_reviews_by_participant_hash.&amp;lt;br/&amp;gt;&lt;br /&gt;
15. Extracted a method make_review_strategy (from automatic_review_mapping_strategy) that returns a review_strategy based on the values of num_reviews_per_submission and num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
16. add_calibration is a method that changes the attribute of a ReviewResponseMap and has little to do with Review Mapping. So it is now put in a separate controller named ReviewResponseMapController.&amp;lt;br/&amp;gt;&lt;br /&gt;
17. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yaswanth Soodini (ysoodin@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Saurabh Shingte (svshingt@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Vivek Karri (vkarri@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Links for Demo Videos ==&lt;br /&gt;
&lt;br /&gt;
Assign Reviewer Manually Demo[https://drive.google.com/file/d/1o9vJQ7fCwk0hwHJdErwpg1z_XjsN_XRT/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Regression and Unit Testing of Controllers Demo[https://youtu.be/XejKHQKtpuA]&lt;br /&gt;
&lt;br /&gt;
Automatic Assignment of Reviewer Demo [https://drive.google.com/file/d/17wpo7mTDenLvEcgubVflLtF_vmLb623a/view?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139778</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139778"/>
		<updated>2021-10-21T02:51:08Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Details of the changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:FlowchartOODD.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller#peer_review_strategy. Two variables were being initialized containing the same value. One was in the before(:each) loop and other was being called in first three test cases.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Changed :i_dont_care to :no_particular_topic&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Refactored Peer_review_strategy by using a helper method gen_random_participant_id &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  ## Helper Method for generating a random participant which is to be used in peer_review_strategy method.&lt;br /&gt;
  def gen_random_participant_id(iterator, participants_hash, num_participants, participants)&lt;br /&gt;
    if iterator.zero?&lt;br /&gt;
        rand_num = rand(0..num_participants - 1)&lt;br /&gt;
    else&lt;br /&gt;
        min_value = participants_hash.values.min&lt;br /&gt;
        # get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
        participants_with_min_assigned_reviews = []&lt;br /&gt;
        participants.each do |participant|&lt;br /&gt;
          participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
        end&lt;br /&gt;
    # if participants_with_min_assigned_reviews is blank&lt;br /&gt;
    no_particpants = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
    # or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
    participant_is_owner = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
    rand_num = if no_particpants or participant_is_owner&lt;br /&gt;
                 # use original method to get random number&lt;br /&gt;
                 rand(0..num_participants - 1)&lt;br /&gt;
               else&lt;br /&gt;
                 # rand_num should be the position of this participant in original array&lt;br /&gt;
                 participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size - 1)]&lt;br /&gt;
               end&lt;br /&gt;
    end&lt;br /&gt;
    return rand_num&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. Refactored automatic_review_mapping by using a helper method check_num_reviews_args &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Parameters such as num_reviews_per_student, num_calibrated_artifacts etc passed are first verified to check if they are in acceptable range or pattern  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *To increase readability, the not-so good looking sets of if-else statements have been moved into check_num_reviews_args method.  &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Helper Method to check num_reviews_per_student and num_reviews_per_submission arguments passed in by params hash.&lt;br /&gt;
  def check_num_reviews_args(num_reviews_per_student, num_reviews_per_submission, teams)&lt;br /&gt;
    has_error_not_raised = true&lt;br /&gt;
    # check for exit paths first&lt;br /&gt;
    if num_reviews_per_student == 0 and num_reviews_per_submission == 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student).&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student != 0 and num_reviews_per_submission != 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student), not both.&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student &amp;gt;= teams.size&lt;br /&gt;
      # Exception detection: If instructor want to assign too many reviews done&lt;br /&gt;
      # by each student, there will be an error msg.&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done ' \&lt;br /&gt;
                       'by each student to be greater than or equal to total number of teams ' \&lt;br /&gt;
                       '[or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
7. Modularized helper methods into a module and was mixed in the ReviewMappingController Class. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Only some of the  methods written in the class have external usage i.e called by another controllers, views etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The other methods are just helpers and as such moved into a Helper method module and mixed in the class &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Before Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
    512 Lines &amp;amp; 25 Methods Defined (After moving a few methods into separate controllers)&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  module Helper_methods&lt;br /&gt;
  ...................&lt;br /&gt;
  5 Methods and 170 lines&lt;br /&gt;
  ...................&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    include Helper_methods&lt;br /&gt;
    ...................&lt;br /&gt;
    340 Lines &amp;amp; 20 Methods (All of those are used elsewhere directly in the application)&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Abided to the principles of Magic Tricks of testing and did not test any internally used methods, The other tests are written were already following this principle. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Internally used methods were not tested &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Tests for newly created controllers have been moved into a separate spec files. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. Isolated AssignQuizDynamically method into a separate controller as the functionality was not related to ReviewMappingController. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method assigns a quiz(Stored as an assignment object) to the participant. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method is not related to ReviewMapping functionality, so it was made into a new controller. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Associated Specs/routes/views/partials have been modified to adapt the change in controllers. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths present in the views/partials have to be changed to not to break the functionality &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths in views/partials/routes have been changed for the newly created controller of AssignQuizDynamically &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
View File Affected by the creation of AssinQuizController&lt;br /&gt;
[[File:View.png]]&lt;br /&gt;
&lt;br /&gt;
11. student_review_num sounds like a number or an id associated with a student review, while it actually stores the number of reviews that a student can perform. So it is renamed num_reviews_per_student. &amp;lt;br/&amp;gt;&lt;br /&gt;
12. submission_review_num sounds like a number or an id associated with a submission review, while it actually stores the total number of reviews that can be performed on a single submission. So it is renamed num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
13. calibrated_artifacts_num sounds like a number or an id associated with the calibrated artifacts, while it actually stores the number of calibrated artifacts. So it is renamed num_calibrated_artifacts. Similarly, uncalibrated_artifacts_num is renamed num_uncalibrated_artifacts.&amp;lt;br/&amp;gt;&lt;br /&gt;
14. participants_hash is not an appropriate name for a hash whose keys are participant ids and values are number of reviews performed by corresponding participants. So it is renamed num_reviews_by_participant_hash.&amp;lt;br/&amp;gt;&lt;br /&gt;
15. Extracted a method make_review_strategy (from automatic_review_mapping_strategy) that returns a review_strategy based on the values of num_reviews_per_submission and num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
16. add_calibration is a method that changes the attribute of a ReviewResponseMap and has little to do with Review Mapping. So it is now put in a separate controller named ReviewResponseMapController.&amp;lt;br/&amp;gt;&lt;br /&gt;
17. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yaswanth Soodini (ysoodin@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Saurabh Shingte (svshingt@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Vivek Karri (vkarri@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Links for Demo Videos ==&lt;br /&gt;
&lt;br /&gt;
Assign Reviewer Manually Demo[https://drive.google.com/file/d/1o9vJQ7fCwk0hwHJdErwpg1z_XjsN_XRT/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Regression and Unit Testing of Controllers Demo[https://youtu.be/XejKHQKtpuA]&lt;br /&gt;
&lt;br /&gt;
Automatic Assignment of Reviewer Demo [https://drive.google.com/file/d/17wpo7mTDenLvEcgubVflLtF_vmLb623a/view?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139777</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139777"/>
		<updated>2021-10-21T02:50:11Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Details of the changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:FlowchartOODD.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. A couple of long and coplex methods such as peer_review_strategy were refactored from this controller. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller_spec.rb. Two variables were being initialized containing the same value. One was in the before(:each) loop and other was being called in first three test cases.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Changed :i_dont_care to :no_particular_topic&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Refactored Peer_review_strategy by using a helper method gen_random_participant_id &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  ## Helper Method for generating a random participant which is to be used in peer_review_strategy method.&lt;br /&gt;
  def gen_random_participant_id(iterator, participants_hash, num_participants, participants)&lt;br /&gt;
    if iterator.zero?&lt;br /&gt;
        rand_num = rand(0..num_participants - 1)&lt;br /&gt;
    else&lt;br /&gt;
        min_value = participants_hash.values.min&lt;br /&gt;
        # get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
        participants_with_min_assigned_reviews = []&lt;br /&gt;
        participants.each do |participant|&lt;br /&gt;
          participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
        end&lt;br /&gt;
    # if participants_with_min_assigned_reviews is blank&lt;br /&gt;
    no_particpants = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
    # or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
    participant_is_owner = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
    rand_num = if no_particpants or participant_is_owner&lt;br /&gt;
                 # use original method to get random number&lt;br /&gt;
                 rand(0..num_participants - 1)&lt;br /&gt;
               else&lt;br /&gt;
                 # rand_num should be the position of this participant in original array&lt;br /&gt;
                 participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size - 1)]&lt;br /&gt;
               end&lt;br /&gt;
    end&lt;br /&gt;
    return rand_num&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. Refactored automatic_review_mapping by using a helper method check_num_reviews_args &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Parameters such as num_reviews_per_student, num_calibrated_artifacts etc passed are first verified to check if they are in acceptable range or pattern  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *To increase readability, the not-so good looking sets of if-else statements have been moved into check_num_reviews_args method.  &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Helper Method to check num_reviews_per_student and num_reviews_per_submission arguments passed in by params hash.&lt;br /&gt;
  def check_num_reviews_args(num_reviews_per_student, num_reviews_per_submission, teams)&lt;br /&gt;
    has_error_not_raised = true&lt;br /&gt;
    # check for exit paths first&lt;br /&gt;
    if num_reviews_per_student == 0 and num_reviews_per_submission == 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student).&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student != 0 and num_reviews_per_submission != 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student), not both.&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student &amp;gt;= teams.size&lt;br /&gt;
      # Exception detection: If instructor want to assign too many reviews done&lt;br /&gt;
      # by each student, there will be an error msg.&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done ' \&lt;br /&gt;
                       'by each student to be greater than or equal to total number of teams ' \&lt;br /&gt;
                       '[or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
7. Modularized helper methods into a module and was mixed in the ReviewMappingController Class. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Only some of the  methods written in the class have external usage i.e called by another controllers, views etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The other methods are just helpers and as such moved into a Helper method module and mixed in the class &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Before Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
    512 Lines &amp;amp; 25 Methods Defined (After moving a few methods into separate controllers)&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  module Helper_methods&lt;br /&gt;
  ...................&lt;br /&gt;
  5 Methods and 170 lines&lt;br /&gt;
  ...................&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    include Helper_methods&lt;br /&gt;
    ...................&lt;br /&gt;
    340 Lines &amp;amp; 20 Methods (All of those are used elsewhere directly in the application)&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Abided to the principles of Magic Tricks of testing and did not test any internally used methods, The other tests are written were already following this principle. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Internally used methods were not tested &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Tests for newly created controllers have been moved into a separate spec files. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. Isolated AssignQuizDynamically method into a separate controller as the functionality was not related to ReviewMappingController. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method assigns a quiz(Stored as an assignment object) to the participant. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method is not related to ReviewMapping functionality, so it was made into a new controller. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Associated Specs/routes/views/partials have been modified to adapt the change in controllers. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths present in the views/partials have to be changed to not to break the functionality &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths in views/partials/routes have been changed for the newly created controller of AssignQuizDynamically &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
View File Affected by the creation of AssinQuizController&lt;br /&gt;
[[File:View.png]]&lt;br /&gt;
&lt;br /&gt;
11. student_review_num sounds like a number or an id associated with a student review, while it actually stores the number of reviews that a student can perform. So it is renamed num_reviews_per_student. &amp;lt;br/&amp;gt;&lt;br /&gt;
12. submission_review_num sounds like a number or an id associated with a submission review, while it actually stores the total number of reviews that can be performed on a single submission. So it is renamed num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
13. calibrated_artifacts_num sounds like a number or an id associated with the calibrated artifacts, while it actually stores the number of calibrated artifacts. So it is renamed num_calibrated_artifacts. Similarly, uncalibrated_artifacts_num is renamed num_uncalibrated_artifacts.&amp;lt;br/&amp;gt;&lt;br /&gt;
14. participants_hash is not an appropriate name for a hash whose keys are participant ids and values are number of reviews performed by corresponding participants. So it is renamed num_reviews_by_participant_hash.&amp;lt;br/&amp;gt;&lt;br /&gt;
15. Extracted a method make_review_strategy (from automatic_review_mapping_strategy) that returns a review_strategy based on the values of num_reviews_per_submission and num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
16. add_calibration is a method that changes the attribute of a ReviewResponseMap and has little to do with Review Mapping. So it is now put in a separate controller named ReviewResponseMapController.&amp;lt;br/&amp;gt;&lt;br /&gt;
17. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yaswanth Soodini (ysoodin@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Saurabh Shingte (svshingt@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Vivek Karri (vkarri@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Links for Demo Videos ==&lt;br /&gt;
&lt;br /&gt;
Assign Reviewer Manually Demo[https://drive.google.com/file/d/1o9vJQ7fCwk0hwHJdErwpg1z_XjsN_XRT/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Regression and Unit Testing of Controllers Demo[https://youtu.be/XejKHQKtpuA]&lt;br /&gt;
&lt;br /&gt;
Automatic Assignment of Reviewer Demo [https://drive.google.com/file/d/17wpo7mTDenLvEcgubVflLtF_vmLb623a/view?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139772</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139772"/>
		<updated>2021-10-21T02:48:21Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Details of the changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:FlowchartOODD.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. Changed 'instructor = build(:instructor)' to ‘@instructor = build(:instructor, id: 1)’. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller_spec.rb. Two variables were being initialized containing the same value. One was in the before(:each) loop and other was being called in first three test cases.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Changed :i_dont_care to :no_particular_topic&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Refactored Peer_review_strategy by using a helper method gen_random_participant_id &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  ## Helper Method for generating a random participant which is to be used in peer_review_strategy method.&lt;br /&gt;
  def gen_random_participant_id(iterator, participants_hash, num_participants, participants)&lt;br /&gt;
    if iterator.zero?&lt;br /&gt;
        rand_num = rand(0..num_participants - 1)&lt;br /&gt;
    else&lt;br /&gt;
        min_value = participants_hash.values.min&lt;br /&gt;
        # get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
        participants_with_min_assigned_reviews = []&lt;br /&gt;
        participants.each do |participant|&lt;br /&gt;
          participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
        end&lt;br /&gt;
    # if participants_with_min_assigned_reviews is blank&lt;br /&gt;
    no_particpants = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
    # or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
    participant_is_owner = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
    rand_num = if no_particpants or participant_is_owner&lt;br /&gt;
                 # use original method to get random number&lt;br /&gt;
                 rand(0..num_participants - 1)&lt;br /&gt;
               else&lt;br /&gt;
                 # rand_num should be the position of this participant in original array&lt;br /&gt;
                 participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size - 1)]&lt;br /&gt;
               end&lt;br /&gt;
    end&lt;br /&gt;
    return rand_num&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. Refactored automatic_review_mapping by using a helper method check_num_reviews_args &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Parameters such as num_reviews_per_student, num_calibrated_artifacts etc passed are first verified to check if they are in acceptable range or pattern  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *To increase readability, the not-so good looking sets of if-else statements have been moved into check_num_reviews_args method.  &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Helper Method to check num_reviews_per_student and num_reviews_per_submission arguments passed in by params hash.&lt;br /&gt;
  def check_num_reviews_args(num_reviews_per_student, num_reviews_per_submission, teams)&lt;br /&gt;
    has_error_not_raised = true&lt;br /&gt;
    # check for exit paths first&lt;br /&gt;
    if num_reviews_per_student == 0 and num_reviews_per_submission == 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student).&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student != 0 and num_reviews_per_submission != 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student), not both.&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student &amp;gt;= teams.size&lt;br /&gt;
      # Exception detection: If instructor want to assign too many reviews done&lt;br /&gt;
      # by each student, there will be an error msg.&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done ' \&lt;br /&gt;
                       'by each student to be greater than or equal to total number of teams ' \&lt;br /&gt;
                       '[or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
7. Modularized helper methods into a module and was mixed in the ReviewMappingController Class. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Only some of the  methods written in the class have external usage i.e called by another controllers, views etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The other methods are just helpers and as such moved into a Helper method module and mixed in the class &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Before Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
    512 Lines &amp;amp; 25 Methods Defined (After moving a few methods into separate controllers)&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  module Helper_methods&lt;br /&gt;
  ...................&lt;br /&gt;
  5 Methods and 170 lines&lt;br /&gt;
  ...................&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    include Helper_methods&lt;br /&gt;
    ...................&lt;br /&gt;
    340 Lines &amp;amp; 20 Methods (All of those are used elsewhere directly in the application)&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Abided to the principles of Magic Tricks of testing and did not test any internally used methods, The other tests are written were already following this principle. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Internally used methods were not tested &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Tests for newly created controllers have been moved into a separate spec files. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. Isolated AssignQuizDynamically method into a separate controller as the functionality was not related to ReviewMappingController. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method assigns a quiz(Stored as an assignment object) to the participant. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method is not related to ReviewMapping functionality, so it was made into a new controller. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Associated Specs/routes/views/partials have been modified to adapt the change in controllers. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths present in the views/partials have to be changed to not to break the functionality &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths in views/partials/routes have been changed for the newly created controller of AssignQuizDynamically &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
View File Affected by the creation of AssinQuizController&lt;br /&gt;
[[File:View.png]]&lt;br /&gt;
&lt;br /&gt;
11. student_review_num sounds like a number or an id associated with a student review, while it actually stores the number of reviews that a student can perform. So it is renamed num_reviews_per_student. &amp;lt;br/&amp;gt;&lt;br /&gt;
12. submission_review_num sounds like a number or an id associated with a submission review, while it actually stores the total number of reviews that can be performed on a single submission. So it is renamed num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
13. calibrated_artifacts_num sounds like a number or an id associated with the calibrated artifacts, while it actually stores the number of calibrated artifacts. So it is renamed num_calibrated_artifacts. Similarly, uncalibrated_artifacts_num is renamed num_uncalibrated_artifacts.&amp;lt;br/&amp;gt;&lt;br /&gt;
14. participants_hash is not an appropriate name for a hash whose keys are participant ids and values are number of reviews performed by corresponding participants. So it is renamed num_reviews_by_participant_hash.&amp;lt;br/&amp;gt;&lt;br /&gt;
15. Extracted a method make_review_strategy (from automatic_review_mapping_strategy) that returns a review_strategy based on the values of num_reviews_per_submission and num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
16. add_calibration is a method that changes the attribute of a ReviewResponseMap and has little to do with Review Mapping. So it is now put in a separate controller named ReviewResponseMapController.&amp;lt;br/&amp;gt;&lt;br /&gt;
17. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yaswanth Soodini (ysoodin@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Saurabh Shingte (svshingt@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Vivek Karri (vkarri@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Links for Demo Videos ==&lt;br /&gt;
&lt;br /&gt;
Assign Reviewer Manually Demo[https://drive.google.com/file/d/1o9vJQ7fCwk0hwHJdErwpg1z_XjsN_XRT/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Regression and Unit Testing of Controllers Demo[https://youtu.be/XejKHQKtpuA]&lt;br /&gt;
&lt;br /&gt;
Automatic Assignment of Reviewer Demo [https://drive.google.com/file/d/17wpo7mTDenLvEcgubVflLtF_vmLb623a/view?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Peer_review.png&amp;diff=139771</id>
		<title>File:Peer review.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Peer_review.png&amp;diff=139771"/>
		<updated>2021-10-21T02:47:34Z</updated>

		<summary type="html">&lt;p&gt;Yli273: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Peer_review_strategy.png&amp;diff=139768</id>
		<title>File:Peer review strategy.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Peer_review_strategy.png&amp;diff=139768"/>
		<updated>2021-10-21T02:46:15Z</updated>

		<summary type="html">&lt;p&gt;Yli273: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139767</id>
		<title>CSC/ECE 517 Fall 2021 - E2124. Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2124._Refactor_review_mapping_controller.rb&amp;diff=139767"/>
		<updated>2021-10-21T02:45:47Z</updated>

		<summary type="html">&lt;p&gt;Yli273: /* Details of the changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2124 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
== About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Functionality of review_mapping_controller ==&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for reviewer and assignment. Basically, the controller handles assignment of reviews to different teams or single student user, such as the event of peer review and self review. Also, this controller is responsible to respond student user request for extra bonus reviews based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The  review_mapping_controller is a long and complex file. Most of the methods are sparsely commented on. Some methods are way too long to understand, please break them down into pieces for better understanding. Also, the few instances of code duplication that exist should also be removed.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
-Refactor the long methods in review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
-Rename variable names such as student_review_num, submission_review_num, calibrated_artifacts_num, participants_hash to convey what they are actually used for&amp;lt;br/&amp;gt;&lt;br /&gt;
-Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
-Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
-Remove hardcoded parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[File:FlowchartOODD.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
We were tasked to refactor the review_mapping_controller.rb and solve any cascading issues or bugs we could find. We followed the above work plan to complete this task. There were many times when all the Rspec and Cucumber tests passed locally but ran into an issue when we uploaded the changes on GitHub. Prompt feedback from the TRAVIS CI helped us recognize the issue. Then we went on local machine and followed the whole process of refactoring again. In this way, we covered every refactoring we did and ensured that the TRAVIS CI get passed with minimum issues on the code-climate.&lt;br /&gt;
&lt;br /&gt;
== Files modified/created in the current project ==&lt;br /&gt;
&lt;br /&gt;
1. review_mapping_controller.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
2. review_mapping_controller_spec.rb &amp;lt;br/&amp;gt;&lt;br /&gt;
3. select_reviewer.html.haml &amp;lt;br/&amp;gt;&lt;br /&gt;
4. app/views/assignments/edit/_calibration.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
5. app/views/review_mapping/select_reviewer.html.haml&amp;lt;br/&amp;gt;&lt;br /&gt;
6. app/views/student_quizzes/_set_dynamic_quiz.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
7. app/views/student_review/_set_dynamic_review.html.erb&amp;lt;br/&amp;gt;&lt;br /&gt;
8. config/routes.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
9. db/schema.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
10. spec/controllers/review_mapping_controller_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
11. spec/features/assignment_creation_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
12. spec/features/review_assignment_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
13. spec/features/review_mapping_spec.rb&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReviewMappingController ===&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Test Cases were created for the newly created controllers such as assign_quiz_controller etc.&lt;br /&gt;
&lt;br /&gt;
=== review_mapping_controller_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Added a test in this file.&lt;br /&gt;
&lt;br /&gt;
=== _set_dynamic_review.html.erb &amp;amp; review_assignment_spec.rb &amp;amp; review_mapping_spec.rb &amp;amp; routes.rb &amp;amp; assignment_creation_review_strategy_spec.rb &amp;amp; assignment_creation_spec.rb ===&lt;br /&gt;
 &lt;br /&gt;
Modified due to the variable name change.&lt;br /&gt;
&lt;br /&gt;
=== views/partials ===&lt;br /&gt;
&lt;br /&gt;
Routes were changed in the views and partials.&lt;br /&gt;
&lt;br /&gt;
==== Modified View Files: ====&lt;br /&gt;
app\views\review_mapping\select_reviewer.html.haml   &amp;lt;br&amp;gt;&lt;br /&gt;
app/views/student_quizzes/_set_dynamic_quiz.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Details of the changes made==&lt;br /&gt;
1. Changed 'instructor = build(:instructor)' to ‘@instructor = build(:instructor, id: 1)’. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Removed code redundancy from review_mapping_controller_spec.rb. Two variables were being initialized containing the same value. One was in the before(:each) loop and other was being called in first three test cases.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Replaced the one in the before(:each) loop by @instructor = build(:instructor, id: 1) and used @instructor class variable, wherever required. &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Peer_review_strategy.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Changed :i_dont_care to :no_particular_topic&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *:i_dont_care was used in the /app/views/student_review/_set_dynamic_review.html.erb as a flag to store if student is interested in any particular topic or doesn't care which topic to review.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *It was also used in review_mapping_controller.rb to check if student has selected any particular topic.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Since, name :i_dont_care was very difficult to understand, we replaced it with something logical such as :no_particular_topic. It gives hint about what the symbol stores.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Replace switch statements with subclasses methods &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We used &amp;quot;check_num_reviews_args&amp;quot; function to represent the switch statements in &amp;quot;automatic review mapping&amp;quot; function to simply it.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:Subfunc_for_switch.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create models for the subclasses&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; We created 3 modules and put relative subclasses methods in to make the controller more organized.&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;br/&amp;gt; [[File:3_modules.png]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Refactored Peer_review_strategy by using a helper method gen_random_participant_id &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *A random participant_id is generated from the possible pool of candidates but the code block for that is kind of a query, i.e. it does not change or set anything.  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *And it is equally complex enough to confuse the reader. So this has been put into a helper method with an expressive name to increase readability. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  ## Helper Method for generating a random participant which is to be used in peer_review_strategy method.&lt;br /&gt;
  def gen_random_participant_id(iterator, participants_hash, num_participants, participants)&lt;br /&gt;
    if iterator.zero?&lt;br /&gt;
        rand_num = rand(0..num_participants - 1)&lt;br /&gt;
    else&lt;br /&gt;
        min_value = participants_hash.values.min&lt;br /&gt;
        # get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
        participants_with_min_assigned_reviews = []&lt;br /&gt;
        participants.each do |participant|&lt;br /&gt;
          participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
        end&lt;br /&gt;
    # if participants_with_min_assigned_reviews is blank&lt;br /&gt;
    no_particpants = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
    # or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
    participant_is_owner = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
    rand_num = if no_particpants or participant_is_owner&lt;br /&gt;
                 # use original method to get random number&lt;br /&gt;
                 rand(0..num_participants - 1)&lt;br /&gt;
               else&lt;br /&gt;
                 # rand_num should be the position of this participant in original array&lt;br /&gt;
                 participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size - 1)]&lt;br /&gt;
               end&lt;br /&gt;
    end&lt;br /&gt;
    return rand_num&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. Refactored automatic_review_mapping by using a helper method check_num_reviews_args &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Parameters such as num_reviews_per_student, num_calibrated_artifacts etc passed are first verified to check if they are in acceptable range or pattern  &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *To increase readability, the not-so good looking sets of if-else statements have been moved into check_num_reviews_args method.  &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Helper Method to check num_reviews_per_student and num_reviews_per_submission arguments passed in by params hash.&lt;br /&gt;
  def check_num_reviews_args(num_reviews_per_student, num_reviews_per_submission, teams)&lt;br /&gt;
    has_error_not_raised = true&lt;br /&gt;
    # check for exit paths first&lt;br /&gt;
    if num_reviews_per_student == 0 and num_reviews_per_submission == 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student).&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student != 0 and num_reviews_per_submission != 0&lt;br /&gt;
      flash[:error] = &amp;quot;Please choose either the number of reviews per student or the number of reviewers per team (student), not both.&amp;quot;&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    elsif num_reviews_per_student &amp;gt;= teams.size&lt;br /&gt;
      # Exception detection: If instructor want to assign too many reviews done&lt;br /&gt;
      # by each student, there will be an error msg.&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done ' \&lt;br /&gt;
                       'by each student to be greater than or equal to total number of teams ' \&lt;br /&gt;
                       '[or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
      has_error_not_raised = false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
7. Modularized helper methods into a module and was mixed in the ReviewMappingController Class. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Only some of the  methods written in the class have external usage i.e called by another controllers, views etc. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The other methods are just helpers and as such moved into a Helper method module and mixed in the class &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Before Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
    512 Lines &amp;amp; 25 Methods Defined (After moving a few methods into separate controllers)&lt;br /&gt;
    ...................&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After Modularization&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  module Helper_methods&lt;br /&gt;
  ...................&lt;br /&gt;
  5 Methods and 170 lines&lt;br /&gt;
  ...................&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class ReviewMappingController &amp;lt; ApplicationController&lt;br /&gt;
    include Helper_methods&lt;br /&gt;
    ...................&lt;br /&gt;
    340 Lines &amp;amp; 20 Methods (All of those are used elsewhere directly in the application)&lt;br /&gt;
    ...................&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Abided to the principles of Magic Tricks of testing and did not test any internally used methods, The other tests are written were already following this principle. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Internally used methods were not tested &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *Tests for newly created controllers have been moved into a separate spec files. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. Isolated AssignQuizDynamically method into a separate controller as the functionality was not related to ReviewMappingController. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method assigns a quiz(Stored as an assignment object) to the participant. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *This method is not related to ReviewMapping functionality, so it was made into a new controller. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Associated Specs/routes/views/partials have been modified to adapt the change in controllers. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths present in the views/partials have to be changed to not to break the functionality &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; *The controller paths in views/partials/routes have been changed for the newly created controller of AssignQuizDynamically &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
View File Affected by the creation of AssinQuizController&lt;br /&gt;
[[File:View.png]]&lt;br /&gt;
&lt;br /&gt;
11. student_review_num sounds like a number or an id associated with a student review, while it actually stores the number of reviews that a student can perform. So it is renamed num_reviews_per_student. &amp;lt;br/&amp;gt;&lt;br /&gt;
12. submission_review_num sounds like a number or an id associated with a submission review, while it actually stores the total number of reviews that can be performed on a single submission. So it is renamed num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
13. calibrated_artifacts_num sounds like a number or an id associated with the calibrated artifacts, while it actually stores the number of calibrated artifacts. So it is renamed num_calibrated_artifacts. Similarly, uncalibrated_artifacts_num is renamed num_uncalibrated_artifacts.&amp;lt;br/&amp;gt;&lt;br /&gt;
14. participants_hash is not an appropriate name for a hash whose keys are participant ids and values are number of reviews performed by corresponding participants. So it is renamed num_reviews_by_participant_hash.&amp;lt;br/&amp;gt;&lt;br /&gt;
15. Extracted a method make_review_strategy (from automatic_review_mapping_strategy) that returns a review_strategy based on the values of num_reviews_per_submission and num_reviews_per_submission.&amp;lt;br/&amp;gt;&lt;br /&gt;
16. add_calibration is a method that changes the attribute of a ReviewResponseMap and has little to do with Review Mapping. So it is now put in a separate controller named ReviewResponseMapController.&amp;lt;br/&amp;gt;&lt;br /&gt;
17. Added one test case and modified &amp;quot;select_metaviewver&amp;quot; to check if a mapping can be found correctly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:Test_case.png]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
&lt;br /&gt;
Since this is a Refactoring Project, We made sure that the changes made did not break any functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_test_passed.png]]&lt;br /&gt;
&lt;br /&gt;
=== Capybara Integration and Functional Tests === &lt;br /&gt;
&lt;br /&gt;
As the controller routes have been modified in the routes.rb and the other view files, there are potential chances of failures in Integration tests.&lt;br /&gt;
&lt;br /&gt;
However, no such failure has been reported by Travis build.&lt;br /&gt;
&lt;br /&gt;
[[File:Travis CI.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:FeaturesCI.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Coverage == &lt;br /&gt;
&lt;br /&gt;
Code Coverage for Controllers section climbed up. &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/26607665] # Link for the COVERALLS stats of our pull request.&lt;br /&gt;
&lt;br /&gt;
[[File:CCC1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yaswanth Soodini (ysoodin@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Saurabh Shingte (svshingt@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Vivek Karri (vkarri@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Links for Demo Videos ==&lt;br /&gt;
&lt;br /&gt;
Assign Reviewer Manually Demo[https://drive.google.com/file/d/1o9vJQ7fCwk0hwHJdErwpg1z_XjsN_XRT/view?usp=sharing]&lt;br /&gt;
&lt;br /&gt;
Regression and Unit Testing of Controllers Demo[https://youtu.be/XejKHQKtpuA]&lt;br /&gt;
&lt;br /&gt;
Automatic Assignment of Reviewer Demo [https://drive.google.com/file/d/17wpo7mTDenLvEcgubVflLtF_vmLb623a/view?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Yli273</name></author>
	</entry>
</feed>