<?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=Verapal</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=Verapal"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Verapal"/>
	<updated>2026-06-05T22:27:20Z</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_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146721</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146721"/>
		<updated>2022-11-16T05:33:16Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Final Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:networking.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Proposed Workflow ===&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode === &lt;br /&gt;
&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146720</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146720"/>
		<updated>2022-11-16T05:32:48Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:networking.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Proposed Workflow ===&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode === &lt;br /&gt;
&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146719</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146719"/>
		<updated>2022-11-16T05:27:20Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:networking.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Proposed Workflow ===&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode === &lt;br /&gt;
&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146718</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146718"/>
		<updated>2022-11-16T05:26:44Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:networking.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode === &lt;br /&gt;
&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146717</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146717"/>
		<updated>2022-11-16T05:26:15Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode === &lt;br /&gt;
&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146716</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146716"/>
		<updated>2022-11-16T05:25:14Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:networking.png|1200px]]&lt;br /&gt;
=== Proposed Workflow ===&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode === &lt;br /&gt;
&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146715</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146715"/>
		<updated>2022-11-16T05:25:03Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:networking.png|1400px]]&lt;br /&gt;
=== Proposed Workflow ===&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode === &lt;br /&gt;
&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146714</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146714"/>
		<updated>2022-11-16T05:24:50Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:networking.png|1000px]]&lt;br /&gt;
=== Proposed Workflow ===&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode === &lt;br /&gt;
&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146713</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146713"/>
		<updated>2022-11-16T05:24:35Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:networking.png|500px]]]&lt;br /&gt;
=== Proposed Workflow ===&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode === &lt;br /&gt;
&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146710</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146710"/>
		<updated>2022-11-16T05:18:55Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:networking.png]]&lt;br /&gt;
=== Proposed Workflow ===&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode ===&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:FlowOSS2.png&amp;diff=146709</id>
		<title>File:FlowOSS2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:FlowOSS2.png&amp;diff=146709"/>
		<updated>2022-11-16T05:17:47Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146708</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146708"/>
		<updated>2022-11-16T05:17:20Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
[[File:networking.png]]&lt;br /&gt;
&lt;br /&gt;
=== Proposed Workflow ===&lt;br /&gt;
&lt;br /&gt;
[[File:flowOSS2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode ===&lt;br /&gt;
#Get all SubmissionRecords with assignment_id = old_assignment_id&lt;br /&gt;
#For each submission_record&lt;br /&gt;
##Create duplicate new_submission_record from submission_record&lt;br /&gt;
##Set new_submission_record.assignment_id = new_assignment_id&lt;br /&gt;
##Save new_submission_record&lt;br /&gt;
#Get all teams with parent_id = old_assignment_id&lt;br /&gt;
#For each team&lt;br /&gt;
##Create duplicate new_team from team&lt;br /&gt;
##Set new_team.parent_id = new_assignment_id&lt;br /&gt;
##Save new_team&lt;br /&gt;
##Copy members of team to new_team&lt;br /&gt;
##Get ReviewResponseMap with reviewee_id = team&lt;br /&gt;
##For each review_response_map&lt;br /&gt;
###Create duplicate new_review_response_map from review_response_map&lt;br /&gt;
###Set new_review_response_map.reviewed_object_id = new_assignment_id&lt;br /&gt;
###Set new_review_response_map.reviewee_id = new_team.id&lt;br /&gt;
###Save the new_review_response_map&lt;br /&gt;
###Get all Responses with map_id = review_response_map.id&lt;br /&gt;
###For each response&lt;br /&gt;
####Create duplicate new_response from response&lt;br /&gt;
####Set new_response.map_id = new_review_response_map.id&lt;br /&gt;
####Save new_response&lt;br /&gt;
#Get all participants with parent_id = old_assignment_id&lt;br /&gt;
#For each participant&lt;br /&gt;
##Create duplicate new_participant&lt;br /&gt;
##Set new_participant.parent_id = new_assignment_id&lt;br /&gt;
##Save new_participant&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146703</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146703"/>
		<updated>2022-11-16T02:25:32Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
[[File:networking.png]]&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Networking.png&amp;diff=146702</id>
		<title>File:Networking.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Networking.png&amp;diff=146702"/>
		<updated>2022-11-16T02:15:16Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146701</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146701"/>
		<updated>2022-11-16T02:14:47Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.'''&lt;br /&gt;
&lt;br /&gt;
*This is extra trouble. An instructor needn't have to resubmit the same calibration submissions every semester.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
''' Issue 6: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
As of now, when one clicks on the copy button next to the assignment and a copy is created, you can observe that the calibration tab of the copied assignment renders no results at all. &lt;br /&gt;
An empty table is shown &lt;br /&gt;
&lt;br /&gt;
[[File:networking.png]]&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146700</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146700"/>
		<updated>2022-11-16T02:05:43Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Automated Testing using Rspec */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
# They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
# Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
# Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
# Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
## Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
##Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
###Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
# Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.'''&lt;br /&gt;
&lt;br /&gt;
*This is extra trouble. An instructor needn't have to resubmit the same calibration submissions every semester.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
''' Issue 6: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
* Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
* Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
* Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
* Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
* Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
* Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
* Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
* Added a method for copying extra participants, to not copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
===Manual UI Testing===&lt;br /&gt;
&lt;br /&gt;
This feature is accessible only by an instructor.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor.&lt;br /&gt;
&lt;br /&gt;
2. Go to Assignments and select an existing assignment. &lt;br /&gt;
&lt;br /&gt;
3. Make sure that the assignment has a calibration tab since this feature handles only calibration assignments. &lt;br /&gt;
&lt;br /&gt;
4. Click on the copy option next to the assignment name and this creates a copy of the assignment and a number is appended to the name in order to name the new copied assignment. &lt;br /&gt;
&lt;br /&gt;
5. After the successful implementation of the feature, you should be able to click on the calibration tab of the copied assignment and this should enlist all the participants, submissions, and reviews.&lt;br /&gt;
&lt;br /&gt;
6. This shows that the feature of copying submissions from old calibration assignments to new calibration assignments was successful.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146694</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146694"/>
		<updated>2022-11-16T01:28:42Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Behaviors to Verify */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
1. They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
2. Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
3. Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
4. Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
  * Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
  **. Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
  **. Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
5. Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.''' - &lt;br /&gt;
&lt;br /&gt;
*This is extra trouble. An instructor needn't have to resubmit the same calibration submissions every semester.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
''' Issue 6: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
  Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
  Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
  Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
  Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
  Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
  Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
  Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
  Added a method for copying extra participants should be here, we wouldn't need to copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146693</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146693"/>
		<updated>2022-11-16T01:28:32Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Behaviors to Verify */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
1. They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
2. Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
3. Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
4. Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
  * Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
  **. Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
  **. Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
5. Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.''' - &lt;br /&gt;
&lt;br /&gt;
*This is extra trouble. An instructor needn't have to resubmit the same calibration submissions every semester.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
''' Issue 6: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
  Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
  Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
  Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
  Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
  Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
  Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
  Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
  Added a method for copying extra participants should be here, we wouldn't need to copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
&lt;br /&gt;
2. Extra participants are copied.&lt;br /&gt;
&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146691</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146691"/>
		<updated>2022-11-16T01:27:57Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Automated Unit Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. The instructor (or TA) adds a few extra participants to the assignment to set up calibration.  The instructor (or TA) then impersonates the extra participants and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== Previous Submission ==&lt;br /&gt;
&lt;br /&gt;
=== What was Done ===&lt;br /&gt;
&lt;br /&gt;
They created a new class method that checks if the an assignment was calibrated and if it was, it calls methods from models. It performs the following:&lt;br /&gt;
&lt;br /&gt;
  1. They copy all submission records with the assignment_id matching the original assignment. &lt;br /&gt;
  2. Copy all participants with the parent_id matching the original assignment ID.    &lt;br /&gt;
  3. Copy all the teams with a parent_id matching the original assignment ID.  &lt;br /&gt;
  4. Recreated mappings needed to associate participants with teams and review_response maps.&lt;br /&gt;
    4.1. Their copy methods for teams and participants return hash maps that are used to lookup previous mappings.&lt;br /&gt;
      4.1.1. Create new TeamsUsers.  Associates participants with teams.  &lt;br /&gt;
      4.1.2. Create new ReviewResponseMap.  Associates reviewers and reviewees, linked to an assignment, together.  &lt;br /&gt;
  5. Copy all review_responses, using the original review response map as the reference.  &lt;br /&gt;
&lt;br /&gt;
Their 'copy_calibrated_reviews' is called in the existing assignment_form class method 'copy', if the copied assignment is able to be saved (to avoid creating new records).  &lt;br /&gt;
&lt;br /&gt;
They also added methods for copy naming schemes so that the assignment model validates uniqueness of both the assignment name and directory_path.&lt;br /&gt;
&lt;br /&gt;
=== Issues ===&lt;br /&gt;
&lt;br /&gt;
'''Issue 1: To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.''' - &lt;br /&gt;
&lt;br /&gt;
*This is extra trouble. An instructor needn't have to resubmit the same calibration submissions every semester.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
*self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
'''Issue 3: Returns a mapping from the old response map to the new response map.&lt;br /&gt;
&lt;br /&gt;
*self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
'''Issue 4: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
*Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
'''Issue 5: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
*New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
''' Issue 6: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
=== Files Changed ===&lt;br /&gt;
&lt;br /&gt;
'''assignment_form.rb'''&lt;br /&gt;
  Added a new method &amp;quot;copy_name&amp;quot; to name copied assignments. Where they changed the name of the copied assignments to “copy of copy” and &amp;quot;copy of copy of copy&amp;quot;, etc to &amp;quot;Copy of &amp;lt;name&amp;gt; &amp;lt;copy number&amp;gt;&amp;quot;&lt;br /&gt;
  Added new method for copying objects needed to recreate calibration reviews&lt;br /&gt;
&lt;br /&gt;
'''participant.rb'''&lt;br /&gt;
  Wrote a &amp;quot;createparticipant&amp;quot; method in assignment_participant in place of a similar method in participant.rb&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
  Implemented a method for copying previous responses &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
  Implemented a method to create ReviewResponse mapping based on mapping of copied assignment&lt;br /&gt;
&lt;br /&gt;
'''submission_record.rb'''&lt;br /&gt;
  Added method for copying submission records of an assignment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''teams_user.rb'''&lt;br /&gt;
  Added a method to create new teams_users so that new participants and teams are associated the same way they were for the previous assignment&lt;br /&gt;
&lt;br /&gt;
'''assignment_participant.rb'''&lt;br /&gt;
  Added a method for copying extra participants should be here, we wouldn't need to copy participants with type 'CourseParticipant'&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Final Implementation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Testing Goals ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== Automated Testing using Rspec===&lt;br /&gt;
&lt;br /&gt;
====Context====&lt;br /&gt;
When the original assignment to be copied is a calibrated assignment&lt;br /&gt;
&lt;br /&gt;
====Behaviors to Verify====&lt;br /&gt;
&lt;br /&gt;
For the copied assignment, we need to verify if:&lt;br /&gt;
1. All the submission records are copied from the old assignment to the new assignment. &lt;br /&gt;
2. Extra participants are copied/&lt;br /&gt;
3. All review responses are copied.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
Dr. Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
Pradyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146363</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146363"/>
		<updated>2022-11-11T23:10:30Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Changed Files  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff-member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
* '''Issue 1: To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.''' - &lt;br /&gt;
&lt;br /&gt;
This is extra trouble. An instructor needn't have to resubmit the same calibration submissions every semester.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3: Returns a mapping from old response map to new response map.&lt;br /&gt;
&lt;br /&gt;
self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
* '''Issue 4: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 5: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
*''' Issue 6: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''Tasks''' ===&lt;br /&gt;
&lt;br /&gt;
== '''Design''' ==&lt;br /&gt;
&lt;br /&gt;
==='''Changed Files '''===&lt;br /&gt;
&lt;br /&gt;
1. app/assets/javascripts/tree_display.jsx&lt;br /&gt;
&lt;br /&gt;
2. app/controllers/assessment360_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. app/controllers/review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. app/models/assignment_participant.rb&lt;br /&gt;
&lt;br /&gt;
5. app/models/metareview_questionnaire.rb&lt;br /&gt;
&lt;br /&gt;
6. app/models/vm_question_response.rb&lt;br /&gt;
&lt;br /&gt;
7. app/views/assessment360/all_students_all_reviews.html.erb&lt;br /&gt;
&lt;br /&gt;
8. app/views/assessment360/index.html.erb&lt;br /&gt;
&lt;br /&gt;
9. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
10. lib/average.rb&lt;br /&gt;
&lt;br /&gt;
11. spec/controllers/assessment360_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
12. spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
13. spec/models/assignment_participant_spec.rb&lt;br /&gt;
&lt;br /&gt;
14. spec/models/student_task_spec.rb&lt;br /&gt;
&lt;br /&gt;
15. spec/models/vm_question_response_spec.rb&lt;br /&gt;
&lt;br /&gt;
== '''Final Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
=== '''Testing Goals''' ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== '''Automated Unit Tests''' ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion ''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Team Information''' ==&lt;br /&gt;
&lt;br /&gt;
Mentor: Dr. Ed Gehringer (efg@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Pradhyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Resources''' ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146362</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146362"/>
		<updated>2022-11-11T22:55:16Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Previous Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff-member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
* '''Issue 1: To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.''' - &lt;br /&gt;
&lt;br /&gt;
This is extra trouble. An instructor needn't have to resubmit the same calibration submissions every semester.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2: Not all uses of class methods are good. '''&lt;br /&gt;
&lt;br /&gt;
self.copy_participants_for_assignment: copies old participants to new --&amp;gt; assignment_participant.rb, it is in teams_users.rb, which seems misplaced.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3: Returns a mapping from old response map to new response map.&lt;br /&gt;
&lt;br /&gt;
self.copy_review_response_map, returns a mapping from the old response map to the new response map. It is in review_response_map.rb. This can be an instance method. There is a copy_review_responses in this class too. &lt;br /&gt;
&lt;br /&gt;
* '''Issue 4: Code missing without causing a bug&lt;br /&gt;
&lt;br /&gt;
Line 65 of submit_hyperlink has missing code.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 5: Old code not reused.'''&lt;br /&gt;
&lt;br /&gt;
New code was written to copy a team in teams_user.rb. There already exists code to copy a team.&lt;br /&gt;
&lt;br /&gt;
*''' Issue 6: No Automated tests written'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''Tasks''' ===&lt;br /&gt;
&lt;br /&gt;
== '''Design''' ==&lt;br /&gt;
&lt;br /&gt;
==='''Changed Files '''===&lt;br /&gt;
&lt;br /&gt;
== '''Final Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
=== '''Testing Goals''' ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== '''Automated Unit Tests''' ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion ''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Team Information''' ==&lt;br /&gt;
&lt;br /&gt;
Mentor: Dr. Ed Gehringer (efg@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Pradhyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Resources''' ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022&amp;diff=146357</id>
		<title>CSC/ECE 517 Fall 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022&amp;diff=146357"/>
		<updated>2022-11-11T22:38:53Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* OSS Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2250. Refactor suggestion controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp;amp; password retrieval controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2253.Refactor delayed mailer.rb and scheduled task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2254: Refactor teams_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2255. Refactor student_quizzes_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2256: Refactor late_policies_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2257: Refactor questionnaires_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2258. Refactor submitted_content_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2260. Refactor review_mapping_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2255. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2262: Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2263.Refactor student teams functionality]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2276. Fix &amp;quot;Back&amp;quot; link on “New Late Policy” page]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022&amp;diff=146356</id>
		<title>CSC/ECE 517 Fall 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022&amp;diff=146356"/>
		<updated>2022-11-11T22:38:08Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Final Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2250. Refactor suggestion controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp;amp; password retrieval controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2253.Refactor delayed mailer.rb and scheduled task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2254: Refactor teams_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2255. Refactor student_quizzes_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2256: Refactor late_policies_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2257: Refactor questionnaires_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2258. Refactor submitted_content_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2260. Refactor review_mapping_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2255. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2262: Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2263.Refactor student teams functionality]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2276. Fix &amp;quot;Back&amp;quot; link on “New Late Policy” page]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146270</id>
		<title>CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2284._Calibration_submissions_should_be_copied_along_with_calibration_assignments&amp;diff=146270"/>
		<updated>2022-11-09T00:23:37Z</updated>

		<summary type="html">&lt;p&gt;Verapal: Created page with &amp;quot;== '''Introduction''' == A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staf...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
A “calibration assignment” is an assignment where the students are asked to review work that has also been reviewed by a member of the course staff.  If the student’s review “resembles” the staff-member’s review, then the student is presumed to be a competent reviewer.  Here is a further description of calibration assignments. To set up calibration, the instructor (or TA) adds a few extra participants to the assignment.  The instructor (or TA) then impersonates the extra participants, and submits work on behalf of each of the extra participants.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
Having the instructor (or TA) impersonate the extra participants, and submit work on behalf of each of the extra participants is extra trouble. It would be nice if an instructor didn’t have to resubmit the same calibration submissions every semester.  Copying the extra participants along with their teams, submissions, and responses when copying an assignment makes things much easier.&lt;br /&gt;
&lt;br /&gt;
== '''Previous Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== '''Tasks''' ===&lt;br /&gt;
&lt;br /&gt;
== '''Design''' ==&lt;br /&gt;
&lt;br /&gt;
==='''Changed Files '''===&lt;br /&gt;
&lt;br /&gt;
== '''Final Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
=== '''Testing Goals''' ===&lt;br /&gt;
&lt;br /&gt;
  The main goal of our testing is to ensure that when a new calibration assignment is added, all of the qualifying previous calibration submissions &lt;br /&gt;
  and reviews are successfully copied over without overwriting any existing submissions.&lt;br /&gt;
&lt;br /&gt;
=== '''Automated Unit Tests''' ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion ''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Team Information''' ==&lt;br /&gt;
&lt;br /&gt;
Mentor: Dr. Ed Gehringer (efg@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Pradhyumna Khawas (ppkhawas@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Abhimanyu Bellam (abellam2@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
Vishnu Vinod Erapalli (verapal@ncsu.edu) &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Resources''' ==&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022&amp;diff=146269</id>
		<title>CSC/ECE 517 Fall 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022&amp;diff=146269"/>
		<updated>2022-11-09T00:19:51Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* OSS Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2250. Refactor suggestion controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb &amp;amp; password retrieval controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2253.Refactor delayed mailer.rb and scheduled task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2254: Refactor teams_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2255. Refactor student_quizzes_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2256: Refactor late_policies_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2257: Refactor questionnaires_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2258. Refactor submitted_content_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2260. Refactor review_mapping_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2255. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2262: Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2263.Refactor student teams functionality]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2284. Calibration submissions should be copied along with calibration assignments]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146268</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146268"/>
		<updated>2022-11-08T22:48:51Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* How to peer review and navigate through this refactoring project? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Manual UI testing is not applicable to this project. Refer to the section on''' [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;br /&gt;
&lt;br /&gt;
4. To view our project board, visit this [[https://github.com/users/AbhimanyuBellam/projects/3/views/1 link]].&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan &lt;br /&gt;
&lt;br /&gt;
[[File: FlowchartVishnu.png]]&lt;br /&gt;
&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File: testpassing2260.png]]&lt;br /&gt;
&lt;br /&gt;
; Increase in Code Coverage&lt;br /&gt;
: Two test cases were added and the code coverage increased. &lt;br /&gt;
&lt;br /&gt;
[[File: testextra22601.png]]&lt;br /&gt;
&lt;br /&gt;
[[File: testextra22602.png]]&lt;br /&gt;
&lt;br /&gt;
; Travis CI Build Passed&lt;br /&gt;
&lt;br /&gt;
[[File:buildpassE2260.png]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Testextra22602.png&amp;diff=146235</id>
		<title>File:Testextra22602.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Testextra22602.png&amp;diff=146235"/>
		<updated>2022-11-02T02:16:23Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Testextra22601.png&amp;diff=146234</id>
		<title>File:Testextra22601.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Testextra22601.png&amp;diff=146234"/>
		<updated>2022-11-02T02:15:59Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Testpassing2260.png&amp;diff=146233</id>
		<title>File:Testpassing2260.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Testpassing2260.png&amp;diff=146233"/>
		<updated>2022-11-02T02:15:31Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146232</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146232"/>
		<updated>2022-11-02T02:15:11Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Manual UI testing is not applicable to this project. Refer to the section on''' [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan &lt;br /&gt;
&lt;br /&gt;
[[File: FlowchartVishnu.png]]&lt;br /&gt;
&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File: testpassing2260.png]]&lt;br /&gt;
&lt;br /&gt;
; Increase in Code Coverage&lt;br /&gt;
: Two test cases were added and the code coverage increased. &lt;br /&gt;
&lt;br /&gt;
[[File: testextra22601.png]]&lt;br /&gt;
&lt;br /&gt;
[[File: testextra22602.png]]&lt;br /&gt;
&lt;br /&gt;
; Travis CI Build Passed&lt;br /&gt;
&lt;br /&gt;
[[File:buildpassE2260.png]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146155</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146155"/>
		<updated>2022-10-30T19:17:32Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Manual UI testing is not applicable to this project. Refer to the section on''' [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan &lt;br /&gt;
&lt;br /&gt;
[[File: FlowchartVishnu.png]]&lt;br /&gt;
&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Travis CI Build Passed&lt;br /&gt;
&lt;br /&gt;
[[File:buildpassE2260.png]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146154</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146154"/>
		<updated>2022-10-30T19:15:31Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Manual UI testing is not applicable to this project. Refer to the section on''' [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan &lt;br /&gt;
&lt;br /&gt;
[[File: FlowchartVishnu.png]]&lt;br /&gt;
&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Travis CI Build Passed&lt;br /&gt;
&lt;br /&gt;
[[File:buildpassE2260.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146153</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146153"/>
		<updated>2022-10-30T19:14:18Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan &lt;br /&gt;
&lt;br /&gt;
[[File: FlowchartVishnu.png]]&lt;br /&gt;
&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Travis CI Build Passed&lt;br /&gt;
&lt;br /&gt;
[[File:buildpassE2260.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:BuildpassE2260.png&amp;diff=146152</id>
		<title>File:BuildpassE2260.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:BuildpassE2260.png&amp;diff=146152"/>
		<updated>2022-10-30T19:13:36Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146151</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146151"/>
		<updated>2022-10-30T19:13:14Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan &lt;br /&gt;
&lt;br /&gt;
[[File: FlowchartVishnu.png]]&lt;br /&gt;
&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
; Travis CI Build Passed&lt;br /&gt;
&lt;br /&gt;
[[File:buildpassE2260.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146150</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146150"/>
		<updated>2022-10-30T19:12:43Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan &lt;br /&gt;
&lt;br /&gt;
[[File: FlowchartVishnu.png]]&lt;br /&gt;
&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
; Travis CI Build Passed&lt;br /&gt;
&lt;br /&gt;
[[File:build_pass.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:FlowchartVishnu.png&amp;diff=146149</id>
		<title>File:FlowchartVishnu.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:FlowchartVishnu.png&amp;diff=146149"/>
		<updated>2022-10-30T19:06:24Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146148</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146148"/>
		<updated>2022-10-30T19:05:59Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan &lt;br /&gt;
&lt;br /&gt;
[[File: FlowchartVishnu.png]]&lt;br /&gt;
&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146147</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146147"/>
		<updated>2022-10-30T19:05:44Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan ;&lt;br /&gt;
&lt;br /&gt;
[[File: FlowchartVishnu.png]]&lt;br /&gt;
&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146146</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146146"/>
		<updated>2022-10-30T19:04:32Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
; Testing Plan ;&lt;br /&gt;
&lt;br /&gt;
[[File: Flowchart.png]]&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146145</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146145"/>
		<updated>2022-10-30T18:25:12Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* About Controller and Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
[[https://expertiza.csc.ncsu.edu/index.php/Review_mappings Control Flow]]&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146144</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146144"/>
		<updated>2022-10-30T18:19:17Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146143</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146143"/>
		<updated>2022-10-30T18:16:53Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* How to peer review and navigate through this refactoring project? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to be refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza Expertiza Repository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
&lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146142</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146142"/>
		<updated>2022-10-30T18:15:52Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;br /&gt;
&lt;br /&gt;
== How to peer review and navigate through this refactoring project? ==&lt;br /&gt;
&lt;br /&gt;
The review mapping controller had to refactored and hence the code was pulled from [[https://github.com/expertiza/expertiza expertizaRepository]] onto our working [[https://github.com/AbhimanyuBellam/expertiza/commits/beta repository]]. During the course of refactoring, a lot of files changed other than the 4 refactored files and hence the changes were cherry-picked and continued at this [[https://github.com/Vishnu-ve56/expertiza/tree/beta repository]].&lt;br /&gt;
&lt;br /&gt;
In order to review the code, one can:&lt;br /&gt;
1. Go to [[https://github.com/Vishnu-ve56/expertiza/tree/beta main repo]] and check for the refactored changes. &lt;br /&gt;
2. Go to [[https://github.com/expertiza/expertiza/pull/2474 Pull Request]] and check the PR.&lt;br /&gt;
3. To understand changes, commit-by-commit, one can visit our old working repository  [[https://github.com/AbhimanyuBellam/expertiza/commits/beta commit history]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146141</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146141"/>
		<updated>2022-10-30T18:02:18Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
The older working repository used for review 1 where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
This previous repository and PR were discontinued after review 1 since too many files were changed.&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146140</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146140"/>
		<updated>2022-10-30T17:58:04Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
The older working repository where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146139</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146139"/>
		<updated>2022-10-30T17:56:18Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Vishnu-ve56/expertiza/tree/beta Link to Respository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2474 Link to PR]&lt;br /&gt;
&lt;br /&gt;
The older working repository where all step-by-step commits are made:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/commits/beta Link to previous working Respository]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146138</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146138"/>
		<updated>2022-10-30T17:50:44Z</updated>

		<summary type="html">&lt;p&gt;Verapal: /* About Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/tree/beta Link to Repository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2464 Link to Pull Request]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller and Functionality == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
&lt;br /&gt;
The functionality of review_mapping_controller is to provide mapping for the reviewer and assignment. The controller handles the assignment of reviews to different teams or single student users, such as events of peer review and self-review. This controller is responsible to respond to student user requests for extra bonus reviews, based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146137</id>
		<title>CSC/ECE 517 Fall 2022 - E2260. Refactor review mapping controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller&amp;diff=146137"/>
		<updated>2022-10-30T16:56:37Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2260 OSS assignment for Fall 2022, CSC/ECE 517.&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Vishal Veera Reddy (vveerar2)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Abhimanyu Bellam (abellam)&lt;br /&gt;
* Pradeep Balaji Muthukumar (pmuthuk)&lt;br /&gt;
* Vishnu Vinod Erapalli (verapal)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well-developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Description == &lt;br /&gt;
&lt;br /&gt;
The project is aimed at refactoring the review_mapping_controller as it is a long and complex file with methods that do not include comments. This project restructures the file without modifying the functionality and improves readability by using illustrious comments and indicative variable names.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AbhimanyuBellam/expertiza/tree/beta Link to Repository]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2464 Link to Pull Request]&lt;br /&gt;
&lt;br /&gt;
[http://152.7.177.190:8080 Link to the deployed project]&lt;br /&gt;
&lt;br /&gt;
Manual UI testing is not applicable to this project. Refer to the section on [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2022_-_E2260._Refactor_review_mapping_controller#Project_Description:~:text=expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df-,Testing,-%5Bedit%5D Testing].&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The review mapping controller &lt;br /&gt;
* Map reviewer and assignment&lt;br /&gt;
* Allows assigning topics/assignments to different teams or single student teams.&lt;br /&gt;
* Respond to a student user request for an extra bonus based on assignment policy.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
* Long methods are present in the file of review_mapping_controller.rb and to name a few, we have: assign_reviewer_dynamically, add_reviewer and automatic_review_mapping. &lt;br /&gt;
* Variables have been named in a manner that is not indicative of what they are meant to do. &lt;br /&gt;
* There are repetitive if-else constructs that affect the single responsibility of a particular function.These computations must be done in other methods.&lt;br /&gt;
* There are hard-coded parameters.&lt;br /&gt;
* Some methods have no comments and are not indicative of their functionalities. Some comments have not been written accurately.&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
1. Refactoring conditionals: Aims to improve the readability of the code. Placed the block of code present in a conditional statement in a different method and called that method.&lt;br /&gt;
&lt;br /&gt;
2. Extract Method: Functionalities of Long and Complex methods were moved to different methods to enhance readability.&lt;br /&gt;
&lt;br /&gt;
== Files modified == &lt;br /&gt;
1. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
2. review_mapping_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
3. _calibration.html.erb&lt;br /&gt;
&lt;br /&gt;
4. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed add_calibration function name to add_calibration_for_instructor and added necessary comments. The add_calibration function was called only on an instructor and hence the name for the function 'add_calibration_for_instructor' is more meaningful. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/40179533beeb258fc43a8d7b1bb00c6f71118fac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Refactored add_reviewer function- changed function name, split function to 2 parts. The initial function did two things: I) it fetched the details of the user and a topic and checked if the topic belongs to the same user's team, in which case he/she cannot review it. II) It assigned the user to a team to peer review. These two functionalities were split logically into two functions: add_reviewer_to team and add_unseen_reviewer_to_team which means that the user has not performed a review yet and he/she will be assigned a topic that is not of their own to review. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/c3df6eabb47bc92f52452d4bbd31f4f3de1078cb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Refactored function assign_reviewer_dynamically, split function into parts: This method was used to assign submissions to students for peer review and was also used for an instructor to assign reviewers to an instructor-selected assignment. This method was broken down into assign_reviewer_with topic and assign_reviewer_without_topic because both these functionalities were implemented in the same function and the checking was also done there. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/cc2fc9038c3dddca24df1b36759c113d94e31f45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Added illustrious comments to signify the functionality of the meta-reviewer methods&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/3a1bf601fad19f130f46dbfbadedf640e486f419&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Added explanative comments for delete_reviewer and delete_metareviewer&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/01e6b55f4ea41673cfe5944435ecc94dc40ac141&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit5.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Refactored automatic_review_mapping, split functions, and added explanative comments: The automatic_review_mapping created a team and it also computes the number of reviews performed by a student and if admissible, it goes on to call a review mapping strategy function. These functionalities can be split into two methods and each method will handle one functionality each. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/61ed8664f526a9e087fe82bab08cde4ceaed0764&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit6.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Refactored automatic_review_mapping- changed variable names, added comments: Added explanatory comments to the existing function and added conditions to check if the variable is not null. Also renamed variables to indicate their significance. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/0107572655798b199d95ca216d548cbb67711bd6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit7.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Added comments to save_grade_and_comment_for_reviewer: Added comments to the function to explain what functionality it holds.&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/e20fed656d40bbf1cc92cf331abeb4b575223840&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit8.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Added explanatory comments for start_self_review&lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/141227a5aa7a94f9d35287a60a5ed28bab4bdac4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:commit9.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. Refactored peer_review_strategy- split into functions, wrote explanatory comments: This method performed three functions I) TO allocate reviews to participants II)To distribute reviews among teams using a strategy, and III) Generate random participant index. Hence, three separate functions were made and each function handled one functionality. &lt;br /&gt;
Changes can be found at:&lt;br /&gt;
https://github.com/AbhimanyuBellam/expertiza/commit/7779c8a3530f4f0e6bcfd2ff76b82a11d7e2b2df&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; Manual UI Test&lt;br /&gt;
: The deployed project database is incomplete and the accounts for students cannot be created. A complete UI test plan cannot be hence proposed. Also, the internal functionalities of the controllers cannot be tested using UI tests. In the demo setup of our VCL, we cannot simulate the real working of the website highlighting the role of the controller since we cannot make the same kind of submissions and review it. The logic of the controller is not related to the UI and hence we cannot perform the UI test plan on the deployed project.&lt;br /&gt;
: Link to the original workflow for the controller can be found here : &lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/Review_mappings&lt;br /&gt;
&lt;br /&gt;
; RSpec &lt;br /&gt;
: No functionality has been changed and only refactoring has been done. Rspec tests were carefully run and checked. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/review_mapping_controller_spec.rb&lt;br /&gt;
[[File:rspec_output.png]]&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Commit9.png&amp;diff=146136</id>
		<title>File:Commit9.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Commit9.png&amp;diff=146136"/>
		<updated>2022-10-30T16:53:52Z</updated>

		<summary type="html">&lt;p&gt;Verapal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Verapal</name></author>
	</entry>
</feed>