<?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=Nnparik2</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=Nnparik2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Nnparik2"/>
	<updated>2026-05-09T12:17:56Z</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_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=131364</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=131364"/>
		<updated>2019-12-18T00:23:41Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Test from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb file. We added jquery tablesorter in the script section to sort the columns. We had to enable the sorting on various columns so we added &amp;quot;sorter-true&amp;quot; in class of all the table headers. To make the UI consistent, we used the glyphicon that is used uniformly across expertiza and placed it behind table header data. &lt;br /&gt;
&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&lt;br /&gt;
[[File:ReviewReport.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:trtd.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:3.PNG]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We used jQuery tablesoter to sort the data in app/views/reports/_feedback_report.html.erb. We created custom parser to sort the dates in the last column and placed it tablesorter script. The custom date parser parses the date in the form of mmddyyyy. In rejoinder column, the student is displayed only once for entire feedback as shown in figure below. This led to blank data entries in the &amp;lt;td&amp;gt;. Due to blank columns the tablesorter threw an error. To rectify this, we created a CSS style tag and Javascript function to dynamically change the visibility of data in &amp;lt;td&amp;gt; tags. When the sorting is done based on rejoinder column, student data in rejoinder column will be hidden. While sorting on other columns, data in rejoinder column will be made visible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:4.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:5.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:6.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:7.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:dashdash.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:weirdFormat.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We used jQuery tablesoter to sort the data in app/views/reports/_teammate_review_report.html.erb. We created custom parser to sort the dates in the last column and placed it tablesorter script. The custom date parser parses the date in the form of mm/dd/yyyy. In reviewer column, the student is displayed only once for all students he has reviewed as shown in figure below. This led to blank data entries in the &amp;lt;td&amp;gt;. Due to blank columns the tablesorter threw an error. To rectify this, we created a CSS style tag and Javascript function to dynamically change the visibility of data in &amp;lt;td&amp;gt; tags. When the sorting is done based on Reviewer column, student data in reviewer column will be hidden. While sorting on other columns, data in rejoinder column will be made visible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:8.PNG]]&lt;br /&gt;
[[File:9.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:10.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignname.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&lt;br /&gt;
[[File:11.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
1)Expertiza Github[https://github.com/expertiza/expertiza]&lt;br /&gt;
&lt;br /&gt;
2)Github Pull Request[https://github.com/expertiza/expertiza/pull/1623]&lt;br /&gt;
&lt;br /&gt;
3)TableSorter Documentation[https://plugins.jquery.com/tablesorter/]&lt;br /&gt;
&lt;br /&gt;
4)Live Expertiza[http://152.7.99.55:8080/]&lt;br /&gt;
&lt;br /&gt;
5)Youtube Video[https://youtu.be/1rLfS0i2uJE]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=131350</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=131350"/>
		<updated>2019-12-17T17:34:42Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Test from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb file. We added jquery tablesorter in the script section to sort the columns. We had to enable the sorting on various columns so we added &amp;quot;sorter-true&amp;quot; in class of all the table headers. To make the UI consistent, we used the glyphicon that is used uniformly across expertiza and placed it behind table header data. &lt;br /&gt;
&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&lt;br /&gt;
[[File:ReviewReport.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:trtd.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:3.PNG]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We used jQuery tablesoter to sort the data in app/views/reports/_feedback_report.html.erb. We created custom parser to sort the dates in the last column and placed it tablesorter script. The custom date parser parses the date in the form of mmddyyyy. In rejoinder column, the student is displayed only once for entire feedback as shown in figure below. This led to blank data entries in the &amp;lt;td&amp;gt;. Due to blank columns the tablesorter threw an error. To rectify this, we created a CSS style tag and Javascript function to dynamically change the visibility of data in &amp;lt;td&amp;gt; tags. When the sorting is done based on rejoinder column, student data in rejoinder column will be hidden. While sorting on other columns, data in rejoinder column will be made visible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:4.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:5.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:6.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:7.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:dashdash.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:weirdFormat.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We used jQuery tablesoter to sort the data in app/views/reports/_teammate_review_report.html.erb. We created custom parser to sort the dates in the last column and placed it tablesorter script. The custom date parser parses the date in the form of mm/dd/yyyy. In reviewer column, the student is displayed only once for all students he has reviewed as shown in figure below. This led to blank data entries in the &amp;lt;td&amp;gt;. Due to blank columns the tablesorter threw an error. To rectify this, we created a CSS style tag and Javascript function to dynamically change the visibility of data in &amp;lt;td&amp;gt; tags. When the sorting is done based on Reviewer column, student data in reviewer column will be hidden. While sorting on other columns, data in rejoinder column will be made visible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:8.PNG]]&lt;br /&gt;
[[File:9.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:10.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignname.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&lt;br /&gt;
[[File:11.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
1)Expertiza Github[https://github.com/expertiza/expertiza]&lt;br /&gt;
&lt;br /&gt;
2)Github Pull Request[https://github.com/expertiza/expertiza/pull/1623]&lt;br /&gt;
&lt;br /&gt;
3)TableSorter Documentation[https://plugins.jquery.com/tablesorter/]&lt;br /&gt;
&lt;br /&gt;
4)Live Expertiza[http://152.7.99.55:8080/]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130949</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130949"/>
		<updated>2019-12-07T04:07:48Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Issue 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb file. We added jquery tablesorter in the script section to sort the columns. We had to enable the sorting on various columns so we added &amp;quot;sorter-true&amp;quot; in class of all the table headers. To make the UI consistent, we used the glyphicon that is used uniformly across expertiza and placed it behind table header data. &lt;br /&gt;
&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&lt;br /&gt;
[[File:ReviewReport.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewreporthtml.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:3.PNG]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We used jQuery tablesoter to sort the data in app/views/reports/_feedback_report.html.erb. We created custom parser to sort the dates in the last column and placed it tablesorter script. The custom date parser parses the date in the form of mmddyyyy. In rejoinder column, the student is displayed only once for entire feedback as shown in figure below. This led to blank data entries in the &amp;lt;td&amp;gt;. Due to blank columns the tablesorter threw an error. To rectify this, we created a CSS style tag and Javascript function to dynamically change the visibility of data in &amp;lt;td&amp;gt; tags. When the sorting is done based on rejoinder column, student data in rejoinder column will be hidden. While sorting on other columns, data in rejoinder column will be made visible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:4.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:5.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:6.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:7.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We used jQuery tablesoter to sort the data in app/views/reports/_teammate_review_report.html.erb. We created custom parser to sort the dates in the last column and placed it tablesorter script. The custom date parser parses the date in the form of mm/dd/yyyy. In reviewer column, the student is displayed only once for all students he has reviewed as shown in figure below. This led to blank data entries in the &amp;lt;td&amp;gt;. Due to blank columns the tablesorter threw an error. To rectify this, we created a CSS style tag and Javascript function to dynamically change the visibility of data in &amp;lt;td&amp;gt; tags. When the sorting is done based on Reviewer column, student data in reviewer column will be hidden. While sorting on other columns, data in rejoinder column will be made visible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:8.PNG]]&lt;br /&gt;
[[File:9.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:10.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&lt;br /&gt;
[[File:11.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
1)Expertiza Github[https://github.com/expertiza/expertiza]&lt;br /&gt;
&lt;br /&gt;
2)Github Pull Request[https://github.com/expertiza/expertiza/pull/1623]&lt;br /&gt;
&lt;br /&gt;
3)TableSorter Documentation[https://plugins.jquery.com/tablesorter/]&lt;br /&gt;
&lt;br /&gt;
4)Live Expertiza[http://152.46.19.132:8080/]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130940</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130940"/>
		<updated>2019-12-07T04:02:49Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Issue 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb file. We added jquery tablesorter in the script section to sort the columns. We had to enable the sorting on various columns so we added &amp;quot;sorter-true&amp;quot; in class of all the table headers. To make the UI consistent, we used the glyphicon that is used uniformly across expertiza and placed it behind table header data. &lt;br /&gt;
&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&lt;br /&gt;
[[File:ReviewReport.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewreporthtml.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:3.PNG]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We used jQuery tablesoter to sort the data in app/views/reports/_feedback_report.html.erb. We created custom parser to sort the dates in the last column and placed it tablesorter script. The custom date parser parses the date in the form of mmddyyyy. In rejoinder column, the student is displayed only once for entire feedback as shown in figure below. This led to blank data entries in the &amp;lt;td&amp;gt;. Due to blank columns the tablesorter threw an error. To rectify this, we created a CSS style tag and Javascript function to dynamically change the visibility of data in &amp;lt;td&amp;gt; tags. When the sorting is done based on rejoinder column, student data in rejoinder column will be hidden. While sorting on other columns, data in rejoinder column will be made visible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:4.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:5.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:6.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:7.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We have modified the app/views/reports/_teammate_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.This was much harder to implement because of some issues and the code was highly unstructured. Also, the JavaScript was not proper in terms of usability and there were some elements which were not working properly as the code was static. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.&lt;br /&gt;
&lt;br /&gt;
Added the following script to the file.The script contained style elements as well to render the table after sorting.&lt;br /&gt;
&lt;br /&gt;
[[File:8.PNG]]&lt;br /&gt;
[[File:9.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After this the table structure was also changed based on requirements of tablesorter class.&lt;br /&gt;
&lt;br /&gt;
[[File:10.PNG]]&lt;br /&gt;
&lt;br /&gt;
Here we faced multiple issue with rendering because of responses received so we implemented a responsecount to keep a track of the number of responses and render the sorted table keeping that in mind. we also removed unnecessary &amp;lt;tr&amp;gt; tags and rowspan and colspan elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&lt;br /&gt;
[[File:11.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
1)Expertiza Github[https://github.com/expertiza/expertiza]&lt;br /&gt;
&lt;br /&gt;
2)Github Pull Request[https://github.com/expertiza/expertiza/pull/1623]&lt;br /&gt;
&lt;br /&gt;
3)TableSorter Documentation[https://plugins.jquery.com/tablesorter/]&lt;br /&gt;
&lt;br /&gt;
4)Live Expertiza[http://152.46.19.132:8080/]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130890</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130890"/>
		<updated>2019-12-07T03:45:26Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Issue 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb file. We added jquery tablesorter in the script section to sort the columns. We had to enable the sorting on various columns so we added &amp;quot;sorter-true&amp;quot; in class of all the table headers. To make the UI consistent, we used the glyphicon that is used uniformly across expertiza and placed it behind table header data. &lt;br /&gt;
&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&lt;br /&gt;
[[File:ReviewReport.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewreporthtml.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:3.PNG]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We have modified the app/views/reports/_feedback_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file. We added custom parsers for sorting date because of it's different mmddyyyy format and also implemented visibility functionality for proper rendition of table after the complete sorting.  &lt;br /&gt;
&lt;br /&gt;
Added the following script to the file. &lt;br /&gt;
&lt;br /&gt;
[[File:4.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also we had to change the structure of the table .&lt;br /&gt;
&lt;br /&gt;
[[File:5.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also we needed to include the round count, total reviews and total iterations to completely sort the given columns. We also removed extra &amp;lt;tr&amp;gt; and &amp;lt;td&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
[[File:6.PNG]]&lt;br /&gt;
&lt;br /&gt;
This was a more complex implementation as we also had to consider the round in which the review was given. Also we were facing troubles for edge cases where in the data was absent for multiple columns in which sorting was implemented but due to the absence of the data the sort function would throw error. To handle such issues we included reviewer name and teammate reviews done for each and every response by that reviewer.&lt;br /&gt;
&lt;br /&gt;
[[File:7.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We have modified the app/views/reports/_teammate_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.This was much harder to implement because of some issues and the code was highly unstructured. Also, the JavaScript was not proper in terms of usability and there were some elements which were not working properly as the code was static. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.&lt;br /&gt;
&lt;br /&gt;
Added the following script to the file.The script contained style elements as well to render the table after sorting.&lt;br /&gt;
&lt;br /&gt;
[[File:8.PNG]]&lt;br /&gt;
[[File:9.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After this the table structure was also changed based on requirements of tablesorter class.&lt;br /&gt;
&lt;br /&gt;
[[File:10.PNG]]&lt;br /&gt;
&lt;br /&gt;
Here we faced multiple issue with rendering because of responses received so we implemented a responsecount to keep a track of the number of responses and render the sorted table keeping that in mind. we also removed unnecessary &amp;lt;tr&amp;gt; tags and rowspan and colspan elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&lt;br /&gt;
[[File:11.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
1)Expertiza Github[https://github.com/expertiza/expertiza]&lt;br /&gt;
&lt;br /&gt;
2)Github Pull Request[https://github.com/expertiza/expertiza/pull/1623]&lt;br /&gt;
&lt;br /&gt;
3)TableSorter Documentation[https://plugins.jquery.com/tablesorter/]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130886</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130886"/>
		<updated>2019-12-07T03:44:39Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Issue 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb file. We added jquery tablesorter in the script section to sort the columns. We had to enable the sorting on various columns so we added &amp;quot;sorter-true&amp;quot; in class of all the table headers. To make the UI consistent we used the glyphicon that is used uniformly across expertiza and placed it behind column. &lt;br /&gt;
&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&lt;br /&gt;
[[File:ReviewReport.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewreporthtml.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:3.PNG]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We have modified the app/views/reports/_feedback_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file. We added custom parsers for sorting date because of it's different mmddyyyy format and also implemented visibility functionality for proper rendition of table after the complete sorting.  &lt;br /&gt;
&lt;br /&gt;
Added the following script to the file. &lt;br /&gt;
&lt;br /&gt;
[[File:4.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also we had to change the structure of the table .&lt;br /&gt;
&lt;br /&gt;
[[File:5.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also we needed to include the round count, total reviews and total iterations to completely sort the given columns. We also removed extra &amp;lt;tr&amp;gt; and &amp;lt;td&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
[[File:6.PNG]]&lt;br /&gt;
&lt;br /&gt;
This was a more complex implementation as we also had to consider the round in which the review was given. Also we were facing troubles for edge cases where in the data was absent for multiple columns in which sorting was implemented but due to the absence of the data the sort function would throw error. To handle such issues we included reviewer name and teammate reviews done for each and every response by that reviewer.&lt;br /&gt;
&lt;br /&gt;
[[File:7.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We have modified the app/views/reports/_teammate_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.This was much harder to implement because of some issues and the code was highly unstructured. Also, the JavaScript was not proper in terms of usability and there were some elements which were not working properly as the code was static. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.&lt;br /&gt;
&lt;br /&gt;
Added the following script to the file.The script contained style elements as well to render the table after sorting.&lt;br /&gt;
&lt;br /&gt;
[[File:8.PNG]]&lt;br /&gt;
[[File:9.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After this the table structure was also changed based on requirements of tablesorter class.&lt;br /&gt;
&lt;br /&gt;
[[File:10.PNG]]&lt;br /&gt;
&lt;br /&gt;
Here we faced multiple issue with rendering because of responses received so we implemented a responsecount to keep a track of the number of responses and render the sorted table keeping that in mind. we also removed unnecessary &amp;lt;tr&amp;gt; tags and rowspan and colspan elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&lt;br /&gt;
[[File:11.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
&lt;br /&gt;
1)Expertiza Github[https://github.com/expertiza/expertiza]&lt;br /&gt;
&lt;br /&gt;
2)Github Pull Request[https://github.com/expertiza/expertiza/pull/1623]&lt;br /&gt;
&lt;br /&gt;
3)TableSorter Documentation[https://plugins.jquery.com/tablesorter/]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130616</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130616"/>
		<updated>2019-12-07T01:17:58Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&lt;br /&gt;
[[File:ReviewReport.PNG]]&lt;br /&gt;
&lt;br /&gt;
Then we changed the style of the table to the given requirement.&lt;br /&gt;
&lt;br /&gt;
[[File:Reviewreporthtml.PNG]]&lt;br /&gt;
&lt;br /&gt;
Then we also changed the structure of the table to fit the tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;16%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;10%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;24%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Team reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Score awarded / Avg. score&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Metrics&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th class=&amp;quot;sorter-false&amp;quot;&amp;gt;Assign grade and write comments &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We have modified the app/views/reports/_feedback_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.  &lt;br /&gt;
Added the following script to the file. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#feedbacktable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat : &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            sortList: [[0,0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we had to change the structure of the table .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id= &amp;quot;feedbacktable&amp;quot; cellspacing='0' cellpadding='2' border=0 class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1980: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Rejoinder&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;# author feedbacks done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Review responded to&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last responded at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we needed to include the round count, total reviews and total iterations to completely sort the given columns. We also removed extra &amp;lt;tr&amp;gt; and &amp;lt;td&amp;gt; tags.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% @roundCount = instance_variable_get(&amp;quot;@rspan_round_#{round}&amp;quot;) %&amp;gt;&lt;br /&gt;
&amp;lt;% @totalreviews = @roundCount  #ISSUE1980%&amp;gt;&lt;br /&gt;
&amp;lt;% @totalIteration=0 ## ISSSUE-1980%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was a more complex implementation as we also had to consider the round in which the review was given. Also we were facing troubles for edge cases where in the data was absent for multiple columns in which sorting was implemented but due to the absence of the data the sort function would throw error. To handle such issues we included reviewer name and teammate reviews done for each and every response by that reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%if @totalIteration &amp;lt; @totalreviews-1  %&amp;gt;&lt;br /&gt;
                &amp;lt;/tr&amp;gt;&lt;br /&gt;
                &amp;lt;tr&amp;gt;&lt;br /&gt;
                  &amp;lt;td class = changeVisibility&amp;gt;&lt;br /&gt;
                        &amp;lt;%= link_to @reviewer_name, :controller =&amp;gt; 'popup', :action =&amp;gt; 'reviewer_details_popup', :id =&amp;gt; r.id, :assignment_id =&amp;gt; @id %&amp;gt;&lt;br /&gt;
                  &amp;lt;/td&amp;gt;&lt;br /&gt;
                    &amp;lt;!--# teammate reviews done--&amp;gt;&lt;br /&gt;
                &amp;lt;td bgcolor=&amp;lt;%= @bgcolor %&amp;gt;  align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;%= @count_certain_round %&amp;gt;/&amp;lt;%= @rspan_certain_round %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                 &amp;lt;% @totalIteration=@totalIteration+1  %&amp;gt;&lt;br /&gt;
                &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
	      &amp;lt;%end%&amp;gt;&lt;br /&gt;
	     &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We have modified the app/views/reports/_teammate_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.This was much harder to implement because of some issues and the code was highly unstructured. Also, the JavaScript was not proper in terms of usability and there were some elements which were not working properly as the code was static. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.&lt;br /&gt;
Added the following script to the file.The script contained style elements as well to render the table after sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $.tablesorter.addParser({&lt;br /&gt;
        id: &amp;quot;eudate&amp;quot;,&lt;br /&gt;
        is: function (s) {&lt;br /&gt;
            return false;&lt;br /&gt;
        },&lt;br /&gt;
        format: function (s, table) {&lt;br /&gt;
            s = s.replace(/\-/g, &amp;quot;/&amp;quot;);&lt;br /&gt;
            s = s.replace(/(\d{1,2})[\/\.](\d{1,2})[\/\.](\d{4})/, &amp;quot;$3/$1/$2&amp;quot;);&lt;br /&gt;
            s = s.split(&amp;quot; &amp;quot;)[0];&lt;br /&gt;
            $('#test').html(s);&lt;br /&gt;
            return $.tablesorter.formatFloat(new Date(s).getTime());&lt;br /&gt;
        },&lt;br /&gt;
        type: &amp;quot;numeric&amp;quot;&lt;br /&gt;
    });&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#teammateReviewTable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat: &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            dateFormat: &amp;quot;mm/dd/yyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            headers: {&lt;br /&gt;
                3: {sorter: 'eudate'}&lt;br /&gt;
            },&lt;br /&gt;
            sortList: [[0, 0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After this the table structure was also changed based on requirements of tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1877: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;# teammate reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Teammate reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last reviewed at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we faced multiple issue with rendering because of responses received so we implemented a responsecount to keep a track of the number of responses and render the sorted table keeping that in mind. we also removed unnecessary &amp;lt;tr&amp;gt; tags and rowspan and colspan elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def get_certain_round_review_and_feedback_response_map_for_feedback_report(author)&lt;br /&gt;
    @feedback_response_maps = FeedbackResponseMap.where([&amp;quot;reviewed_object_id IN (?) and reviewer_id = ?&amp;quot;, @all_review_response_ids, author.id])&lt;br /&gt;
    @team_id = TeamsUser.team_id(@id.to_i, author.user_id)&lt;br /&gt;
    @review_response_map_ids = ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and reviewee_id = ?&amp;quot;, @id, @team_id]).pluck(&amp;quot;id&amp;quot;)&lt;br /&gt;
    @review_responses = Response.where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
    @rspan = @review_responses.length&lt;br /&gt;
    if @rspan == 0&lt;br /&gt;
      @rspan = 1&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130583</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130583"/>
		<updated>2019-12-07T00:55:48Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Solution: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$(function () {&lt;br /&gt;
        /*Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#reviewReport&amp;quot;).tablesorter({&lt;br /&gt;
            sortList: [[0, 0]], //sort First Column by default when page loads&lt;br /&gt;
            widgets: ['zebra'], // Make sure to update the css when column is sorted&lt;br /&gt;
            headers: {&lt;br /&gt;
                4: {&lt;br /&gt;
                    sorter: 'customParser' //custom Parser to parse Metrics data for the custom parser&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we changed the style of the table to the given requirement.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;style&amp;gt;&lt;br /&gt;
        table,tr {&lt;br /&gt;
                border: 1px solid black;&lt;br /&gt;
                }&lt;br /&gt;
        th,td{&lt;br /&gt;
                padding: 0px 2px 0px 2px;&lt;br /&gt;
                border: 1px black solid;&lt;br /&gt;
       }&lt;br /&gt;
  &amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we also changed the structure of the table to fit the tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;16%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;10%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;24%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Team reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Score awarded / Avg. score&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Metrics&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th class=&amp;quot;sorter-false&amp;quot;&amp;gt;Assign grade and write comments &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We have modified the app/views/reports/_feedback_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.  &lt;br /&gt;
Added the following script to the file. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#feedbacktable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat : &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            sortList: [[0,0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we had to change the structure of the table .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id= &amp;quot;feedbacktable&amp;quot; cellspacing='0' cellpadding='2' border=0 class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1980: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Rejoinder&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;# author feedbacks done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Review responded to&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last responded at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we needed to include the round count, total reviews and total iterations to completely sort the given columns. We also removed extra &amp;lt;tr&amp;gt; and &amp;lt;td&amp;gt; tags.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% @roundCount = instance_variable_get(&amp;quot;@rspan_round_#{round}&amp;quot;) %&amp;gt;&lt;br /&gt;
&amp;lt;% @totalreviews = @roundCount  #ISSUE1980%&amp;gt;&lt;br /&gt;
&amp;lt;% @totalIteration=0 ## ISSSUE-1980%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was a more complex implementation as we also had to consider the round in which the review was given. Also we were facing troubles for edge cases where in the data was absent for multiple columns in which sorting was implemented but due to the absence of the data the sort function would throw error. To handle such issues we included reviewer name and teammate reviews done for each and every response by that reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%if @totalIteration &amp;lt; @totalreviews-1  %&amp;gt;&lt;br /&gt;
                &amp;lt;/tr&amp;gt;&lt;br /&gt;
                &amp;lt;tr&amp;gt;&lt;br /&gt;
                  &amp;lt;td class = changeVisibility&amp;gt;&lt;br /&gt;
                        &amp;lt;%= link_to @reviewer_name, :controller =&amp;gt; 'popup', :action =&amp;gt; 'reviewer_details_popup', :id =&amp;gt; r.id, :assignment_id =&amp;gt; @id %&amp;gt;&lt;br /&gt;
                  &amp;lt;/td&amp;gt;&lt;br /&gt;
                    &amp;lt;!--# teammate reviews done--&amp;gt;&lt;br /&gt;
                &amp;lt;td bgcolor=&amp;lt;%= @bgcolor %&amp;gt;  align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;%= @count_certain_round %&amp;gt;/&amp;lt;%= @rspan_certain_round %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                 &amp;lt;% @totalIteration=@totalIteration+1  %&amp;gt;&lt;br /&gt;
                &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
	      &amp;lt;%end%&amp;gt;&lt;br /&gt;
	     &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We have modified the app/views/reports/_teammate_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.This was much harder to implement because of some issues and the code was highly unstructured. Also, the JavaScript was not proper in terms of usability and there were some elements which were not working properly as the code was static. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.&lt;br /&gt;
Added the following script to the file.The script contained style elements as well to render the table after sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $.tablesorter.addParser({&lt;br /&gt;
        id: &amp;quot;eudate&amp;quot;,&lt;br /&gt;
        is: function (s) {&lt;br /&gt;
            return false;&lt;br /&gt;
        },&lt;br /&gt;
        format: function (s, table) {&lt;br /&gt;
            s = s.replace(/\-/g, &amp;quot;/&amp;quot;);&lt;br /&gt;
            s = s.replace(/(\d{1,2})[\/\.](\d{1,2})[\/\.](\d{4})/, &amp;quot;$3/$1/$2&amp;quot;);&lt;br /&gt;
            s = s.split(&amp;quot; &amp;quot;)[0];&lt;br /&gt;
            $('#test').html(s);&lt;br /&gt;
            return $.tablesorter.formatFloat(new Date(s).getTime());&lt;br /&gt;
        },&lt;br /&gt;
        type: &amp;quot;numeric&amp;quot;&lt;br /&gt;
    });&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#teammateReviewTable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat: &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            dateFormat: &amp;quot;mm/dd/yyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            headers: {&lt;br /&gt;
                3: {sorter: 'eudate'}&lt;br /&gt;
            },&lt;br /&gt;
            sortList: [[0, 0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After this the table structure was also changed based on requirements of tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1877: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;# teammate reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Teammate reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last reviewed at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we faced multiple issue with rendering because of responses received so we implemented a responsecount to keep a track of the number of responses and render the sorted table keeping that in mind. we also removed unnecessary &amp;lt;tr&amp;gt; tags and rowspan and colspan elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def get_certain_round_review_and_feedback_response_map_for_feedback_report(author)&lt;br /&gt;
    @feedback_response_maps = FeedbackResponseMap.where([&amp;quot;reviewed_object_id IN (?) and reviewer_id = ?&amp;quot;, @all_review_response_ids, author.id])&lt;br /&gt;
    @team_id = TeamsUser.team_id(@id.to_i, author.user_id)&lt;br /&gt;
    @review_response_map_ids = ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and reviewee_id = ?&amp;quot;, @id, @team_id]).pluck(&amp;quot;id&amp;quot;)&lt;br /&gt;
    @review_responses = Response.where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
    @rspan = @review_responses.length&lt;br /&gt;
    if @rspan == 0&lt;br /&gt;
      @rspan = 1&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130576</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130576"/>
		<updated>2019-12-07T00:52:41Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Solution: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will use tablesorter function of jQuery to sort the table. To sort the columns that have constraints, custom parser will be created and used on top of tablesorter. The approach is similar to the first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. Similar approach to first and second issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$(function () {&lt;br /&gt;
        /*Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#reviewReport&amp;quot;).tablesorter({&lt;br /&gt;
            sortList: [[0, 0]], //sort First Column by default when page loads&lt;br /&gt;
            widgets: ['zebra'], // Make sure to update the css when column is sorted&lt;br /&gt;
            headers: {&lt;br /&gt;
                4: {&lt;br /&gt;
                    sorter: 'customParser' //custom Parser to parse Metrics data for the custom parser&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we changed the style of the table to the given requirement.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;style&amp;gt;&lt;br /&gt;
        table,tr {&lt;br /&gt;
                border: 1px solid black;&lt;br /&gt;
                }&lt;br /&gt;
        th,td{&lt;br /&gt;
                padding: 0px 2px 0px 2px;&lt;br /&gt;
                border: 1px black solid;&lt;br /&gt;
       }&lt;br /&gt;
  &amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we also changed the structure of the table to fit the tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;16%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;10%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;24%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Team reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Score awarded / Avg. score&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Metrics&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th class=&amp;quot;sorter-false&amp;quot;&amp;gt;Assign grade and write comments &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We have modified the app/views/reports/_feedback_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.  &lt;br /&gt;
Added the following script to the file. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#feedbacktable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat : &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            sortList: [[0,0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we had to change the structure of the table .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id= &amp;quot;feedbacktable&amp;quot; cellspacing='0' cellpadding='2' border=0 class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1980: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Rejoinder&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;# author feedbacks done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Review responded to&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last responded at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we needed to include the round count, total reviews and total iterations to completely sort the given columns. We also removed extra &amp;lt;tr&amp;gt; and &amp;lt;td&amp;gt; tags.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% @roundCount = instance_variable_get(&amp;quot;@rspan_round_#{round}&amp;quot;) %&amp;gt;&lt;br /&gt;
&amp;lt;% @totalreviews = @roundCount  #ISSUE1980%&amp;gt;&lt;br /&gt;
&amp;lt;% @totalIteration=0 ## ISSSUE-1980%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was a more complex implementation as we also had to consider the round in which the review was given. Also we were facing troubles for edge cases where in the data was absent for multiple columns in which sorting was implemented but due to the absence of the data the sort function would throw error. To handle such issues we included reviewer name and teammate reviews done for each and every response by that reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%if @totalIteration &amp;lt; @totalreviews-1  %&amp;gt;&lt;br /&gt;
                &amp;lt;/tr&amp;gt;&lt;br /&gt;
                &amp;lt;tr&amp;gt;&lt;br /&gt;
                  &amp;lt;td class = changeVisibility&amp;gt;&lt;br /&gt;
                        &amp;lt;%= link_to @reviewer_name, :controller =&amp;gt; 'popup', :action =&amp;gt; 'reviewer_details_popup', :id =&amp;gt; r.id, :assignment_id =&amp;gt; @id %&amp;gt;&lt;br /&gt;
                  &amp;lt;/td&amp;gt;&lt;br /&gt;
                    &amp;lt;!--# teammate reviews done--&amp;gt;&lt;br /&gt;
                &amp;lt;td bgcolor=&amp;lt;%= @bgcolor %&amp;gt;  align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;%= @count_certain_round %&amp;gt;/&amp;lt;%= @rspan_certain_round %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                 &amp;lt;% @totalIteration=@totalIteration+1  %&amp;gt;&lt;br /&gt;
                &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
	      &amp;lt;%end%&amp;gt;&lt;br /&gt;
	     &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We have modified the app/views/reports/_teammate_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.This was much harder to implement because of some issues and the code was highly unstructured. Also, the JavaScript was not proper in terms of usability and there were some elements which were not working properly as the code was static. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.&lt;br /&gt;
Added the following script to the file.The script contained style elements as well to render the table after sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $.tablesorter.addParser({&lt;br /&gt;
        id: &amp;quot;eudate&amp;quot;,&lt;br /&gt;
        is: function (s) {&lt;br /&gt;
            return false;&lt;br /&gt;
        },&lt;br /&gt;
        format: function (s, table) {&lt;br /&gt;
            s = s.replace(/\-/g, &amp;quot;/&amp;quot;);&lt;br /&gt;
            s = s.replace(/(\d{1,2})[\/\.](\d{1,2})[\/\.](\d{4})/, &amp;quot;$3/$1/$2&amp;quot;);&lt;br /&gt;
            s = s.split(&amp;quot; &amp;quot;)[0];&lt;br /&gt;
            $('#test').html(s);&lt;br /&gt;
            return $.tablesorter.formatFloat(new Date(s).getTime());&lt;br /&gt;
        },&lt;br /&gt;
        type: &amp;quot;numeric&amp;quot;&lt;br /&gt;
    });&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#teammateReviewTable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat: &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            dateFormat: &amp;quot;mm/dd/yyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            headers: {&lt;br /&gt;
                3: {sorter: 'eudate'}&lt;br /&gt;
            },&lt;br /&gt;
            sortList: [[0, 0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After this the table structure was also changed based on requirements of tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1877: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;# teammate reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Teammate reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last reviewed at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we faced multiple issue with rendering because of responses received so we implemented a responsecount to keep a track of the number of responses and render the sorted table keeping that in mind. we also removed unnecessary &amp;lt;tr&amp;gt; tags and rowspan and colspan elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def get_certain_round_review_and_feedback_response_map_for_feedback_report(author)&lt;br /&gt;
    @feedback_response_maps = FeedbackResponseMap.where([&amp;quot;reviewed_object_id IN (?) and reviewer_id = ?&amp;quot;, @all_review_response_ids, author.id])&lt;br /&gt;
    @team_id = TeamsUser.team_id(@id.to_i, author.user_id)&lt;br /&gt;
    @review_response_map_ids = ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and reviewee_id = ?&amp;quot;, @id, @team_id]).pluck(&amp;quot;id&amp;quot;)&lt;br /&gt;
    @review_responses = Response.where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
    @rspan = @review_responses.length&lt;br /&gt;
    if @rspan == 0&lt;br /&gt;
      @rspan = 1&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130565</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130565"/>
		<updated>2019-12-07T00:45:42Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Solution: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table.To sort the columns that have constraints, custom scripts will be created. Tablesorter supports custom sorting. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must enable sorting on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. Similar approach to first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. Similar approach to first and second issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$(function () {&lt;br /&gt;
        /*Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#reviewReport&amp;quot;).tablesorter({&lt;br /&gt;
            sortList: [[0, 0]], //sort First Column by default when page loads&lt;br /&gt;
            widgets: ['zebra'], // Make sure to update the css when column is sorted&lt;br /&gt;
            headers: {&lt;br /&gt;
                4: {&lt;br /&gt;
                    sorter: 'customParser' //custom Parser to parse Metrics data for the custom parser&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we changed the style of the table to the given requirement.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;style&amp;gt;&lt;br /&gt;
        table,tr {&lt;br /&gt;
                border: 1px solid black;&lt;br /&gt;
                }&lt;br /&gt;
        th,td{&lt;br /&gt;
                padding: 0px 2px 0px 2px;&lt;br /&gt;
                border: 1px black solid;&lt;br /&gt;
       }&lt;br /&gt;
  &amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we also changed the structure of the table to fit the tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;16%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;10%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;24%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Team reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Score awarded / Avg. score&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Metrics&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th class=&amp;quot;sorter-false&amp;quot;&amp;gt;Assign grade and write comments &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We have modified the app/views/reports/_feedback_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.  &lt;br /&gt;
Added the following script to the file. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#feedbacktable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat : &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            sortList: [[0,0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we had to change the structure of the table .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id= &amp;quot;feedbacktable&amp;quot; cellspacing='0' cellpadding='2' border=0 class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1980: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Rejoinder&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;# author feedbacks done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Review responded to&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last responded at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we needed to include the round count, total reviews and total iterations to completely sort the given columns. We also removed extra &amp;lt;tr&amp;gt; and &amp;lt;td&amp;gt; tags.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% @roundCount = instance_variable_get(&amp;quot;@rspan_round_#{round}&amp;quot;) %&amp;gt;&lt;br /&gt;
&amp;lt;% @totalreviews = @roundCount  #ISSUE1980%&amp;gt;&lt;br /&gt;
&amp;lt;% @totalIteration=0 ## ISSSUE-1980%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was a more complex implementation as we also had to consider the round in which the review was given. Also we were facing troubles for edge cases where in the data was absent for multiple columns in which sorting was implemented but due to the absence of the data the sort function would throw error. To handle such issues we included reviewer name and teammate reviews done for each and every response by that reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%if @totalIteration &amp;lt; @totalreviews-1  %&amp;gt;&lt;br /&gt;
                &amp;lt;/tr&amp;gt;&lt;br /&gt;
                &amp;lt;tr&amp;gt;&lt;br /&gt;
                  &amp;lt;td class = changeVisibility&amp;gt;&lt;br /&gt;
                        &amp;lt;%= link_to @reviewer_name, :controller =&amp;gt; 'popup', :action =&amp;gt; 'reviewer_details_popup', :id =&amp;gt; r.id, :assignment_id =&amp;gt; @id %&amp;gt;&lt;br /&gt;
                  &amp;lt;/td&amp;gt;&lt;br /&gt;
                    &amp;lt;!--# teammate reviews done--&amp;gt;&lt;br /&gt;
                &amp;lt;td bgcolor=&amp;lt;%= @bgcolor %&amp;gt;  align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;%= @count_certain_round %&amp;gt;/&amp;lt;%= @rspan_certain_round %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                 &amp;lt;% @totalIteration=@totalIteration+1  %&amp;gt;&lt;br /&gt;
                &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
	      &amp;lt;%end%&amp;gt;&lt;br /&gt;
	     &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We have modified the app/views/reports/_teammate_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.This was much harder to implement because of some issues and the code was highly unstructured. Also, the JavaScript was not proper in terms of usability and there were some elements which were not working properly as the code was static. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.&lt;br /&gt;
Added the following script to the file.The script contained style elements as well to render the table after sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $.tablesorter.addParser({&lt;br /&gt;
        id: &amp;quot;eudate&amp;quot;,&lt;br /&gt;
        is: function (s) {&lt;br /&gt;
            return false;&lt;br /&gt;
        },&lt;br /&gt;
        format: function (s, table) {&lt;br /&gt;
            s = s.replace(/\-/g, &amp;quot;/&amp;quot;);&lt;br /&gt;
            s = s.replace(/(\d{1,2})[\/\.](\d{1,2})[\/\.](\d{4})/, &amp;quot;$3/$1/$2&amp;quot;);&lt;br /&gt;
            s = s.split(&amp;quot; &amp;quot;)[0];&lt;br /&gt;
            $('#test').html(s);&lt;br /&gt;
            return $.tablesorter.formatFloat(new Date(s).getTime());&lt;br /&gt;
        },&lt;br /&gt;
        type: &amp;quot;numeric&amp;quot;&lt;br /&gt;
    });&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#teammateReviewTable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat: &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            dateFormat: &amp;quot;mm/dd/yyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            headers: {&lt;br /&gt;
                3: {sorter: 'eudate'}&lt;br /&gt;
            },&lt;br /&gt;
            sortList: [[0, 0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After this the table structure was also changed based on requirements of tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1877: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;# teammate reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Teammate reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last reviewed at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we faced multiple issue with rendering because of responses received so we implemented a responsecount to keep a track of the number of responses and render the sorted table keeping that in mind. we also removed unnecessary &amp;lt;tr&amp;gt; tags and rowspan and colspan elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def get_certain_round_review_and_feedback_response_map_for_feedback_report(author)&lt;br /&gt;
    @feedback_response_maps = FeedbackResponseMap.where([&amp;quot;reviewed_object_id IN (?) and reviewer_id = ?&amp;quot;, @all_review_response_ids, author.id])&lt;br /&gt;
    @team_id = TeamsUser.team_id(@id.to_i, author.user_id)&lt;br /&gt;
    @review_response_map_ids = ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and reviewee_id = ?&amp;quot;, @id, @team_id]).pluck(&amp;quot;id&amp;quot;)&lt;br /&gt;
    @review_responses = Response.where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
    @rspan = @review_responses.length&lt;br /&gt;
    if @rspan == 0&lt;br /&gt;
      @rspan = 1&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130560</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130560"/>
		<updated>2019-12-07T00:43:36Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Solution: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using tablesorter function of jQuery to sort the table. For columns that have constraints, custom scripts will be created to sort them. Tablesorter supports custom scripts. According to the problem type, we are supposed to perform three kinds of sorting. We need to make changes in the table head tag. By default the sorting is disabled on the columns, we must set sorting to true on those columns in order to make it sortable. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - Sorting by date includes creating a generic format for all dates(mmddyyyy). This generic format will be used to parse dates and sorting will be done based on this format. &lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. Similar approach to first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. Similar approach to first and second issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$(function () {&lt;br /&gt;
        /*Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#reviewReport&amp;quot;).tablesorter({&lt;br /&gt;
            sortList: [[0, 0]], //sort First Column by default when page loads&lt;br /&gt;
            widgets: ['zebra'], // Make sure to update the css when column is sorted&lt;br /&gt;
            headers: {&lt;br /&gt;
                4: {&lt;br /&gt;
                    sorter: 'customParser' //custom Parser to parse Metrics data for the custom parser&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we changed the style of the table to the given requirement.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;style&amp;gt;&lt;br /&gt;
        table,tr {&lt;br /&gt;
                border: 1px solid black;&lt;br /&gt;
                }&lt;br /&gt;
        th,td{&lt;br /&gt;
                padding: 0px 2px 0px 2px;&lt;br /&gt;
                border: 1px black solid;&lt;br /&gt;
       }&lt;br /&gt;
  &amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we also changed the structure of the table to fit the tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;16%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;10%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;24%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Team reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Score awarded / Avg. score&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Metrics&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th class=&amp;quot;sorter-false&amp;quot;&amp;gt;Assign grade and write comments &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We have modified the app/views/reports/_feedback_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.  &lt;br /&gt;
Added the following script to the file. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#feedbacktable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat : &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            sortList: [[0,0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we had to change the structure of the table .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id= &amp;quot;feedbacktable&amp;quot; cellspacing='0' cellpadding='2' border=0 class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1980: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Rejoinder&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;# author feedbacks done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Review responded to&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last responded at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we needed to include the round count, total reviews and total iterations to completely sort the given columns. We also removed extra &amp;lt;tr&amp;gt; and &amp;lt;td&amp;gt; tags.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% @roundCount = instance_variable_get(&amp;quot;@rspan_round_#{round}&amp;quot;) %&amp;gt;&lt;br /&gt;
&amp;lt;% @totalreviews = @roundCount  #ISSUE1980%&amp;gt;&lt;br /&gt;
&amp;lt;% @totalIteration=0 ## ISSSUE-1980%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was a more complex implementation as we also had to consider the round in which the review was given. Also we were facing troubles for edge cases where in the data was absent for multiple columns in which sorting was implemented but due to the absence of the data the sort function would throw error. To handle such issues we included reviewer name and teammate reviews done for each and every response by that reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%if @totalIteration &amp;lt; @totalreviews-1  %&amp;gt;&lt;br /&gt;
                &amp;lt;/tr&amp;gt;&lt;br /&gt;
                &amp;lt;tr&amp;gt;&lt;br /&gt;
                  &amp;lt;td class = changeVisibility&amp;gt;&lt;br /&gt;
                        &amp;lt;%= link_to @reviewer_name, :controller =&amp;gt; 'popup', :action =&amp;gt; 'reviewer_details_popup', :id =&amp;gt; r.id, :assignment_id =&amp;gt; @id %&amp;gt;&lt;br /&gt;
                  &amp;lt;/td&amp;gt;&lt;br /&gt;
                    &amp;lt;!--# teammate reviews done--&amp;gt;&lt;br /&gt;
                &amp;lt;td bgcolor=&amp;lt;%= @bgcolor %&amp;gt;  align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;%= @count_certain_round %&amp;gt;/&amp;lt;%= @rspan_certain_round %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                 &amp;lt;% @totalIteration=@totalIteration+1  %&amp;gt;&lt;br /&gt;
                &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
	      &amp;lt;%end%&amp;gt;&lt;br /&gt;
	     &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We have modified the app/views/reports/_teammate_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.This was much harder to implement because of some issues and the code was highly unstructured. Also, the JavaScript was not proper in terms of usability and there were some elements which were not working properly as the code was static. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.&lt;br /&gt;
Added the following script to the file.The script contained style elements as well to render the table after sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $.tablesorter.addParser({&lt;br /&gt;
        id: &amp;quot;eudate&amp;quot;,&lt;br /&gt;
        is: function (s) {&lt;br /&gt;
            return false;&lt;br /&gt;
        },&lt;br /&gt;
        format: function (s, table) {&lt;br /&gt;
            s = s.replace(/\-/g, &amp;quot;/&amp;quot;);&lt;br /&gt;
            s = s.replace(/(\d{1,2})[\/\.](\d{1,2})[\/\.](\d{4})/, &amp;quot;$3/$1/$2&amp;quot;);&lt;br /&gt;
            s = s.split(&amp;quot; &amp;quot;)[0];&lt;br /&gt;
            $('#test').html(s);&lt;br /&gt;
            return $.tablesorter.formatFloat(new Date(s).getTime());&lt;br /&gt;
        },&lt;br /&gt;
        type: &amp;quot;numeric&amp;quot;&lt;br /&gt;
    });&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#teammateReviewTable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat: &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            dateFormat: &amp;quot;mm/dd/yyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            headers: {&lt;br /&gt;
                3: {sorter: 'eudate'}&lt;br /&gt;
            },&lt;br /&gt;
            sortList: [[0, 0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After this the table structure was also changed based on requirements of tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1877: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;# teammate reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Teammate reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last reviewed at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we faced multiple issue with rendering because of responses received so we implemented a responsecount to keep a track of the number of responses and render the sorted table keeping that in mind. we also removed unnecessary &amp;lt;tr&amp;gt; tags and rowspan and colspan elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def get_certain_round_review_and_feedback_response_map_for_feedback_report(author)&lt;br /&gt;
    @feedback_response_maps = FeedbackResponseMap.where([&amp;quot;reviewed_object_id IN (?) and reviewer_id = ?&amp;quot;, @all_review_response_ids, author.id])&lt;br /&gt;
    @team_id = TeamsUser.team_id(@id.to_i, author.user_id)&lt;br /&gt;
    @review_response_map_ids = ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and reviewee_id = ?&amp;quot;, @id, @team_id]).pluck(&amp;quot;id&amp;quot;)&lt;br /&gt;
    @review_responses = Response.where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
    @rspan = @review_responses.length&lt;br /&gt;
    if @rspan == 0&lt;br /&gt;
      @rspan = 1&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130539</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=130539"/>
		<updated>2019-12-07T00:25:13Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Problem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Author feedback report” table, we have to change the header name “Review response rejoined” to “Review responded to” and “Last rejoined at” to “Last responded at”. Then, sort “Rejoinder” and “Review “Review responded to” as string (alphabetically), sort “# author feedbacks done” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last responded at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. Similar approach to first issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldAuthorfeedbackformat.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
For “Teammate review report” table,we have to sort &amp;quot;Reviewer&amp;quot;  and &amp;quot;Teammate reviewed&amp;quot; as string(alphabetically) , sort “&amp;quot;# teammate review done&amp;quot;” by the first number then the second number (same as “Review done” in the “View review report” table) and sort “Last reviewed at” as date.&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. Similar approach to first and second issue.&lt;br /&gt;
&lt;br /&gt;
[[File:OldTeammatereviewsort.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 4 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 5 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modification of Files ==&lt;br /&gt;
* app/assets/stylesheets/table_sorter.scss (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/controllers/tree_display_controller.rb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/helpers/review_mapping_helper.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_feedback_report.html.erb (issue 2) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_review_report.html.erb (issue 1) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_searchbox.html.erb (issue 4) &amp;lt;br&amp;gt;&lt;br /&gt;
* app/views/reports/_teammate_review_report.html.erb (issue 3) &amp;lt;br&amp;gt;&lt;br /&gt;
* spec/features/review_mapping_helper_spec.rb (issue 5) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
We have modified the app/views/reports/_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.&lt;br /&gt;
Added the following script to the file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$(function () {&lt;br /&gt;
        /*Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#reviewReport&amp;quot;).tablesorter({&lt;br /&gt;
            sortList: [[0, 0]], //sort First Column by default when page loads&lt;br /&gt;
            widgets: ['zebra'], // Make sure to update the css when column is sorted&lt;br /&gt;
            headers: {&lt;br /&gt;
                4: {&lt;br /&gt;
                    sorter: 'customParser' //custom Parser to parse Metrics data for the custom parser&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we changed the style of the table to the given requirement.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;style&amp;gt;&lt;br /&gt;
        table,tr {&lt;br /&gt;
                border: 1px solid black;&lt;br /&gt;
                }&lt;br /&gt;
        th,td{&lt;br /&gt;
                padding: 0px 2px 0px 2px;&lt;br /&gt;
                border: 1px black solid;&lt;br /&gt;
       }&lt;br /&gt;
  &amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then we also changed the structure of the table to fit the tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;16%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;10%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;24%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Team reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Score awarded / Avg. score&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th width=&amp;quot;13%&amp;quot; class=&amp;quot;sorter-true&amp;quot;&amp;gt;Metrics&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th class=&amp;quot;sorter-false&amp;quot;&amp;gt;Assign grade and write comments &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
[[File:Issue1980_1_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
We have modified the app/views/reports/_feedback_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.  &lt;br /&gt;
Added the following script to the file. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#feedbacktable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat : &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            sortList: [[0,0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we had to change the structure of the table .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table id= &amp;quot;feedbacktable&amp;quot; cellspacing='0' cellpadding='2' border=0 class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1980: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Rejoinder&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;# author feedbacks done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Review responded to&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last responded at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we needed to include the round count, total reviews and total iterations to completely sort the given columns. We also removed extra &amp;lt;tr&amp;gt; and &amp;lt;td&amp;gt; tags.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% @roundCount = instance_variable_get(&amp;quot;@rspan_round_#{round}&amp;quot;) %&amp;gt;&lt;br /&gt;
&amp;lt;% @totalreviews = @roundCount  #ISSUE1980%&amp;gt;&lt;br /&gt;
&amp;lt;% @totalIteration=0 ## ISSSUE-1980%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was a more complex implementation as we also had to consider the round in which the review was given. Also we were facing troubles for edge cases where in the data was absent for multiple columns in which sorting was implemented but due to the absence of the data the sort function would throw error. To handle such issues we included reviewer name and teammate reviews done for each and every response by that reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%if @totalIteration &amp;lt; @totalreviews-1  %&amp;gt;&lt;br /&gt;
                &amp;lt;/tr&amp;gt;&lt;br /&gt;
                &amp;lt;tr&amp;gt;&lt;br /&gt;
                  &amp;lt;td class = changeVisibility&amp;gt;&lt;br /&gt;
                        &amp;lt;%= link_to @reviewer_name, :controller =&amp;gt; 'popup', :action =&amp;gt; 'reviewer_details_popup', :id =&amp;gt; r.id, :assignment_id =&amp;gt; @id %&amp;gt;&lt;br /&gt;
                  &amp;lt;/td&amp;gt;&lt;br /&gt;
                    &amp;lt;!--# teammate reviews done--&amp;gt;&lt;br /&gt;
                &amp;lt;td bgcolor=&amp;lt;%= @bgcolor %&amp;gt;  align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;%= @count_certain_round %&amp;gt;/&amp;lt;%= @rspan_certain_round %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                 &amp;lt;% @totalIteration=@totalIteration+1  %&amp;gt;&lt;br /&gt;
                &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
	      &amp;lt;%end%&amp;gt;&lt;br /&gt;
	     &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_2_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 3 ===&lt;br /&gt;
We have modified the app/views/reports/_teammate_review_report.html.erb by adding the tablesorter class in the table tag. Then with the table head, we added suitable classes and added scripts at the top of the file to sort the table contents within the file.This was much harder to implement because of some issues and the code was highly unstructured. Also, the JavaScript was not proper in terms of usability and there were some elements which were not working properly as the code was static. We had to add custom parsers for date based sorting and we had to implement visibility functionality for proper rendition of table after the complete sorting.&lt;br /&gt;
Added the following script to the file.The script contained style elements as well to render the table after sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    $.tablesorter.addParser({&lt;br /&gt;
        id: &amp;quot;eudate&amp;quot;,&lt;br /&gt;
        is: function (s) {&lt;br /&gt;
            return false;&lt;br /&gt;
        },&lt;br /&gt;
        format: function (s, table) {&lt;br /&gt;
            s = s.replace(/\-/g, &amp;quot;/&amp;quot;);&lt;br /&gt;
            s = s.replace(/(\d{1,2})[\/\.](\d{1,2})[\/\.](\d{4})/, &amp;quot;$3/$1/$2&amp;quot;);&lt;br /&gt;
            s = s.split(&amp;quot; &amp;quot;)[0];&lt;br /&gt;
            $('#test').html(s);&lt;br /&gt;
            return $.tablesorter.formatFloat(new Date(s).getTime());&lt;br /&gt;
        },&lt;br /&gt;
        type: &amp;quot;numeric&amp;quot;&lt;br /&gt;
    });&lt;br /&gt;
    $(function () {&lt;br /&gt;
        /*E: 1980Function for sorting the table */&lt;br /&gt;
        $(&amp;quot;#teammateReviewTable&amp;quot;).tablesorter({&lt;br /&gt;
            dateFormat: &amp;quot;mmddyyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            dateFormat: &amp;quot;mm/dd/yyyy&amp;quot;, //E1980: set the default date format&lt;br /&gt;
            headers: {&lt;br /&gt;
                3: {sorter: 'eudate'}&lt;br /&gt;
            },&lt;br /&gt;
            sortList: [[0, 0]] // E1980: sort First Column by default when page loads&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
    function changeVisibilityToVisible() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;visible&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
    function changeVisibilityToCollapse() {&lt;br /&gt;
        $('.changeVisibility').css({&amp;quot;visibility&amp;quot;: &amp;quot;collapse&amp;quot;});&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
  .changeVisibility{&lt;br /&gt;
    visibility: collapse;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After this the table structure was also changed based on requirements of tablesorter class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;lt;!--E1877: &amp;quot;sorter-true&amp;quot; included to sort the table using each attribute--&amp;gt;&lt;br /&gt;
 &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;Reviewer&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToCollapse()&amp;quot;&amp;gt;# teammate reviews done&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Teammate reviewed&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;th class=&amp;quot;sorter-true&amp;quot; onclick=&amp;quot;changeVisibilityToVisible()&amp;quot;&amp;gt;Last reviewed at&amp;lt;span class=&amp;quot;glyphicon glyphicon-sort&amp;quot; data-reactid=&amp;quot;.0.1.0.$table2.3.0.0.2.1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we faced multiple issue with rendering because of responses received so we implemented a responsecount to keep a track of the number of responses and render the sorted table keeping that in mind. we also removed unnecessary &amp;lt;tr&amp;gt; tags and rowspan and colspan elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_3_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Issue 4 ===&lt;br /&gt;
We added a header on top of Dropdown menu. For this we already had assignment name in the _searchbox.html.erb partial. We used that above the search box to display the name of assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Report for &amp;lt;%=@assignment.name %&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_4_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 5 ===&lt;br /&gt;
We changed in app/helpers/review_mapping_helper.rb for this issue firstly we found out the cases for which rspan was coming to be 0 and then changed the rspan value to 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def get_certain_round_review_and_feedback_response_map_for_feedback_report(author)&lt;br /&gt;
    @feedback_response_maps = FeedbackResponseMap.where([&amp;quot;reviewed_object_id IN (?) and reviewer_id = ?&amp;quot;, @all_review_response_ids, author.id])&lt;br /&gt;
    @team_id = TeamsUser.team_id(@id.to_i, author.user_id)&lt;br /&gt;
    @review_response_map_ids = ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and reviewee_id = ?&amp;quot;, @id, @team_id]).pluck(&amp;quot;id&amp;quot;)&lt;br /&gt;
    @review_responses = Response.where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
    @rspan = @review_responses.length&lt;br /&gt;
    if @rspan == 0&lt;br /&gt;
      @rspan = 1&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980_5_solution.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Author Feedback report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select teammate review report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 4'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 5'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129656</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129656"/>
		<updated>2019-11-25T01:35:25Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Solution: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column. We will take the reference from the tree_display module of the app/views of expertiza.    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we will change @rspan variable value in review_mapping_helper.rb. We will add a condition to check the value of @rspan. If @rspan is 0, we will change it to 1. This will make one entry of student per row in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129655</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129655"/>
		<updated>2019-11-25T01:29:47Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Solution: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column. We will take the reference from the tree_display module of the app/views of expertiza.    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use that above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129654</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129654"/>
		<updated>2019-11-25T01:28:56Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Solution: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column. We will take the reference from the tree_display module of the app/views of expertiza.    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we already have assignment name in the _searchbox.html.erb partial. We will use &amp;lt;h1&amp;gt; tag above the search box to display the name of assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129653</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129653"/>
		<updated>2019-11-25T01:26:38Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Solution: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column. We will take the reference from the tree_display module of the app/views of expertiza.    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we will pass the assignment name and id as parameter to function that calls view report.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129404</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129404"/>
		<updated>2019-11-15T23:00:48Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Solution: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''Workflow'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we will pass the assignment name and id as parameter to function that calls view report.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129403</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129403"/>
		<updated>2019-11-15T22:57:19Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Test from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''UML Diagram'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we will pass the assignment name and id as parameter to function that calls view report.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
'''For issue 1'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Drop-down menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 2'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. Name of assignment should be displayed above the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For issue 3'''&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Under Manage Notifications tab click on Assignments.&lt;br /&gt;
&lt;br /&gt;
3. Under Assignments click view report.&lt;br /&gt;
&lt;br /&gt;
4. From drop-down menu select Author Feedback Report.&lt;br /&gt;
&lt;br /&gt;
5. Students will be displayed in proper format.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129402</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129402"/>
		<updated>2019-11-15T22:49:36Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Test from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''UML Diagram'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we will pass the assignment name and id as parameter to function that calls view report.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
=== Test from UI ===&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on view reports under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Dropdown menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129401</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129401"/>
		<updated>2019-11-15T22:49:18Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* TEST PLAN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''UML Diagram'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we will pass the assignment name and id as parameter to function that calls view report.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
== Test from UI ==&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on view reports under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Dropdown menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129400</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129400"/>
		<updated>2019-11-15T22:49:01Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* ISSUE 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''UML Diagram'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we will pass the assignment name and id as parameter to function that calls view report.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Issue 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TEST PLAN ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
== Test from UI ==&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on view reports under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Dropdown menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129399</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129399"/>
		<updated>2019-11-15T22:48:52Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* ISSUE 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''UML Diagram'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we will pass the assignment name and id as parameter to function that calls view report.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== ISSUE 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TEST PLAN ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
== Test from UI ==&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on view reports under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Dropdown menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129398</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129398"/>
		<updated>2019-11-15T22:48:41Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* ISSUE 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== Issue 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''UML Diagram'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== ISSUE 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we will pass the assignment name and id as parameter to function that calls view report.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ISSUE 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TEST PLAN ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
== Test from UI ==&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on view reports under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Dropdown menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129397</id>
		<title>CSC/ECE 517 Fall 2019 - E1980. Sort instructor reports by name, ID, score, etc.</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1980._Sort_instructor_reports_by_name,_ID,_score,_etc.&amp;diff=129397"/>
		<updated>2019-11-15T22:48:04Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Test from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
This wiki page describes the changes made according to the specification of E1980 OSS final project for Fall 2019.&lt;br /&gt;
----&lt;br /&gt;
== ''' Introduction ''' ==&lt;br /&gt;
* In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide feedback for this review, called “author feedback.” While grading peer reviews, it would be nice for the instructors to include the author feedback, since it shows how helpful the peer review actually was to the author of the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''' Problem Statement ''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza allows instructors to view kinds of reports of assignments in their courses such as submissions, scores, and review reports. To improve the report views, some table columns such as team name, score, the average should be made sortable by using the same existing sort library.&lt;br /&gt;
&lt;br /&gt;
== ISSUE 1 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
We have to sort “Review done”, “Team reviewed”, “Score awarded/Avg score”, “Assign Grade” and write comments.  in the “view review report” table. The sort button should work on all browsers, not only chrome. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1980.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We thought of 2 approaches to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Approach 1:''' We will be using already implemented function tablesorter of jQuery to sort the table. For table columns which have constraints on them for sorting, we will be creating custom scripts which tablesorter function supports to sort those columns. According to the problem type, we are supposed to perform three kinds of sorting. All  have one thing in common, adding up the tablesorter script in the body before using them. After including the script, we are supposed to do some modifications in the table tag by including the class. Three types of scenarios may arise:&lt;br /&gt;
&lt;br /&gt;
1.    Sorting by columns alphabetically - To sort the columns alphabetically, the table-head attribute must include sorter-true class with it to enable the sorting alphabetically.&lt;br /&gt;
&lt;br /&gt;
2.    Sorting by date - It includes adding of a date default format in the script to denote the sorter type that must be used to sort the column of the date.&lt;br /&gt;
&lt;br /&gt;
3.    Sorting by the first number followed by the second number - It will require splitting up of the data into two parts separated by '/' and then sorting the first part, followed by the second part.&lt;br /&gt;
&lt;br /&gt;
'''Approach 2:''' If above approach is not functioning, we will try to use ReactJS to implement sorting on each column.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;'''UML Diagram'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:UML1.png]]&lt;br /&gt;
&lt;br /&gt;
== ISSUE 2 ==&lt;br /&gt;
=== Problem === &lt;br /&gt;
When the user clicks on the “View reports” icon, a page appears with a dropdown.  However, that page does not say what assignment’s reports are being viewed.  Add a header, “Reports for [name of assignment]” at the top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
We will add header on top of Dropdown menu. For this we will pass the assignment name and id as parameter to function that calls view report.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue3ass.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ISSUE 3 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For Author feedback reports, when no feedback has been submitted by any student, the names of the participants appear in a strange horizontal format.  Fix this so that the formatting is correct, regardless of how many participants have done author feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issuehorizontal.png]]&lt;br /&gt;
&lt;br /&gt;
===Solution:===&lt;br /&gt;
In file _feedback_report.html.erb&lt;br /&gt;
The main issue behind the unusual horizontal format of all rows (student ID) is due to the value of rowspan=0 when there are no reviews.&lt;br /&gt;
This causes all new potential rows being viewed on same single row.&lt;br /&gt;
So to solve this issue, we can put condition that if number of feedbacks = 0, then use &amp;lt;tr&amp;gt; tag with no rowspan attribute.&lt;br /&gt;
otherwise use rowspan attribute with value which is being passed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto;font-size:135%; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:ISSUE3FLOW.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TEST PLAN ==&lt;br /&gt;
'''To make sure the functionality work correctly, we need to run the original Rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.'''&lt;br /&gt;
&lt;br /&gt;
* Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
* Develop New RSpec Tests for the new features&lt;br /&gt;
* UI testing on the deployed project&lt;br /&gt;
&lt;br /&gt;
== Test from UI ==&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on view reports under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Select Review Report from Dropdown menu.&lt;br /&gt;
&lt;br /&gt;
5. Sort the columns by Clicking on it.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=129254</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=129254"/>
		<updated>2019-11-12T15:18:11Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Code Coverage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
E1956. There is no shortcut to get free review points: Review Assignment Bug&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
====Issue 1====&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
====Issue 2====&lt;br /&gt;
*There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
====Issue 3====&lt;br /&gt;
*There is no check on the number of outstanding reviews a user can have.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project, in particular intends that the students collaborate and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open-source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
Currently, there is no check in the backend that limits the number of reviews a student can be assigned. Students can get more peer reviews than assignment policy. Also, there is no check to see if the user has submitted enough reviews for that assignment before getting a new review.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 1: No limitation on the maximum number of peer reviews.&amp;lt;/b&amp;gt;&lt;br /&gt;
*There is no check in the backend that limits the number of reviews assigned to a student. There is a check in the UI, but one could evade the limit by typing in a URL to make the same post request. One can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 2: No check on duplicate submissions&amp;lt;/b&amp;gt;&lt;br /&gt;
* There is no check to see if the submission is already assigned to a student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 3: There is no check on the number of outstanding reviews&amp;lt;/b&amp;gt;&lt;br /&gt;
*A user can request for submissions even if the current outstanding ones are pending.&lt;br /&gt;
&lt;br /&gt;
[[File:Pro.png]]&lt;br /&gt;
[[File:Issue.png]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Implementation==&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
'''review_mapping_controller.rb'''&lt;br /&gt;
* The is_reviews_allowed method checks the number of reviews assigned to a student and then compares it with the maximum number of reviews allowed as per assignment policy. If the student is asking for more reviews than the assignment policy then it returns False.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def is_review_allowed?(assignment, reviewer)&lt;br /&gt;
  @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id:  assignment.id)&lt;br /&gt;
  assignment.num_reviews_allowed &amp;gt; @review_mappings.size&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* The check_outstanding_reviews checks the number of outstanding assignment reviews a user can have at a time. The check_outstanding_reviews keeps a count of the number of reviews in progress as well as the number of reviews currently completed by the user and returns a Boolean value depending upon whether the former is less than the maximum outstanding reviews allowed as per the assignment policy or not. The user can only request for a submission if the check_outstanding_reviews returns True.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def check_outstanding_reviews?(assignment, reviewer)&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id: assignment.id)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size&lt;br /&gt;
    if @num_reviews_total == 0&lt;br /&gt;
      true&lt;br /&gt;
    else&lt;br /&gt;
      @num_reviews_completed = 0&lt;br /&gt;
      @review_mappings.each do |map|&lt;br /&gt;
        @num_reviews_completed += 1 if !map.response.empty? &amp;amp;&amp;amp; map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
      @num_reviews_in_progress = @num_reviews_total - @num_reviews_completed&lt;br /&gt;
      @num_reviews_in_progress &amp;lt; assignment.max_outstanding_reviews&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_controller_spec.rb'''&lt;br /&gt;
* Change has been done in the implementation of review_mapping_controller.rb where a new check was added. This check fetches the number of reviews done by a student currently from ReviewResponseMap table. To adapt to those changes, two new mocks were added to the review_mapping_controller_spec.rb. &lt;br /&gt;
* ReviewResponseMap is mocked to return 0. This is the number of reviews that a student has done so far.&lt;br /&gt;
* Assignment is mocked to return 1 as number of reviews allowed for the assignment.&lt;br /&gt;
* To test number of reviews, we added new tests. The code works on size of object returned by querying reviewer_id and reviewed_object_id. To avoid database call, ReviewResponseMap is mocked to return empty list and a list of values. Empty list indicates that student has not done any review and therefore must be allowed. List of values is returned to check if the size of list is greater than allowed number of reviews according to assignment policy.&lt;br /&gt;
* To test outstanding number of reviews, we added new tests. The code works on number of reviews completed. If the number of reviews completed are less than assignment's max outstanding reviews, then student must not be allowed new review. To test the functionality we mocked ReviewResponseMap to return an object. &lt;br /&gt;
*For one of the test cases we mocked the assignment's max outstanding reviews to be 0, which means without doing even a single review he can request as many reviews as he wants. For the other test case we mocked assignment's max outstanding reviews to be 2 and hence without doing two reviews he can't ask for more. We mocked ReviewResposneMap to have one object.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below: Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
Use the given link: http://152.46.19.135:8080/&lt;br /&gt;
&lt;br /&gt;
Follow the instructions below to test the implemented changes:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Login as instructor.&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Go to Manage-&amp;gt;Assignments and navigate to assignment name 'test1'. &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Click on add participants. This will give a list of all participants. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Now click on any student username in order to impersonate. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Go to test1-&amp;gt;other's_work and click on request submission button continuously and wait for the response.&amp;lt;br/&amp;gt;&lt;br /&gt;
6. It would be noted that the request would never exceed the number of submissions mentioned in the assignment policy.&lt;br /&gt;
&lt;br /&gt;
To test outstanding number of reviews:&amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the steps above, you will get 2 reviews at first.&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Fill up one of the review, You will get the button to request again.&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Click on button continuously.&amp;lt;br/&amp;gt;&lt;br /&gt;
3. It should be noted that despite continuous request, user will not get any more reviews than difference of max outstanding review and completed reviews.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review Limit enforcement===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has done reviews less than assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are less than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically.&lt;br /&gt;
::::2. Redirect to Student review page.&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are greater than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review pending check===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has pending reviews less than assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews less than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically&lt;br /&gt;
::::2. Redirect to Student review page&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews greater than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more reviews when you have &amp;quot;+ assignment.max_outstanding_reviews + &amp;quot;reviews to do&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
24.317%&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
Dhruvil Shah&lt;br /&gt;
&lt;br /&gt;
Neel Parikh&lt;br /&gt;
&lt;br /&gt;
Steve Menezes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor: Suraj Siddharudh&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/dhruvil009/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.19.135:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug Project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=127964</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=127964"/>
		<updated>2019-11-07T04:07:17Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Testing from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
E1956. There is no shortcut to get free review points: Review Assignment Bug&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
====Issue 1====&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
====Issue 2====&lt;br /&gt;
*There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
====Issue 3====&lt;br /&gt;
*There is no check on the number of outstanding reviews a user can have.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project, in particular intends that the students collaborate and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open-source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
Currently, there is no check in the backend that limits the number of reviews a student can be assigned. Students can get more peer reviews than assignment policy. Also, there is no check to see if the user has submitted enough reviews for that assignment before getting a new review.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 1: No limitation on the maximum number of peer reviews.&amp;lt;/b&amp;gt;&lt;br /&gt;
*There is no check in the backend that limits the number of reviews assigned to a student. There is a check in the UI, but one could evade the limit by typing in a URL to make the same post request. One can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 2: No check on duplicate submissions&amp;lt;/b&amp;gt;&lt;br /&gt;
* There is no check to see if the submission is already assigned to a student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 3: There is no check on the number of outstanding reviews&amp;lt;/b&amp;gt;&lt;br /&gt;
*A user can request for submissions even if the current outstanding ones are pending.&lt;br /&gt;
&lt;br /&gt;
[[File:Pro.png]]&lt;br /&gt;
[[File:Issue.png]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Implementation==&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
'''review_mapping_controller.rb'''&lt;br /&gt;
* The is_reviews_allowed method checks the number of reviews assigned to a student and then compares it with the maximum number of reviews allowed as per assignment policy. If the student is asking for more reviews than the assignment policy then it returns False.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def is_review_allowed?(assignment, reviewer)&lt;br /&gt;
  @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id:  assignment.id)&lt;br /&gt;
  assignment.num_reviews_allowed &amp;gt; @review_mappings.size&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* The check_outstanding_reviews checks the number of outstanding assignment reviews a user can have at a time. The check_outstanding_reviews keeps a count of the number of reviews in progress as well as the number of reviews currently completed by the user and returns a Boolean value depending upon whether the former is less than the maximum outstanding reviews allowed as per the assignment policy or not. The user can only request for a submission if the check_outstanding_reviews returns True.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def check_outstanding_reviews?(assignment, reviewer)&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id: assignment.id)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size&lt;br /&gt;
    if @num_reviews_total == 0&lt;br /&gt;
      true&lt;br /&gt;
    else&lt;br /&gt;
      @num_reviews_completed = 0&lt;br /&gt;
      @review_mappings.each do |map|&lt;br /&gt;
        @num_reviews_completed += 1 if !map.response.empty? &amp;amp;&amp;amp; map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
      @num_reviews_in_progress = @num_reviews_total - @num_reviews_completed&lt;br /&gt;
      @num_reviews_in_progress &amp;lt; assignment.max_outstanding_reviews&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_controller_spec.rb'''&lt;br /&gt;
* Change has been done in the implementation of review_mapping_controller.rb where a new check was added. This check fetches the number of reviews done by a student currently from ReviewResponseMap table. To adapt to those changes, two new mocks were added to the review_mapping_controller_spec.rb. &lt;br /&gt;
* ReviewResponseMap is mocked to return 0. This is the number of reviews that a student has done so far.&lt;br /&gt;
* Assignment is mocked to return 1 as number of reviews allowed for the assignment.&lt;br /&gt;
* To test number of reviews, we added new tests. The code works on size of object returned by querying reviewer_id and reviewed_object_id. To avoid database call, ReviewResponseMap is mocked to return empty list and a list of values. Empty list indicates that student has not done any review and therefore must be allowed. List of values is returned to check if the size of list is greater than allowed number of reviews according to assignment policy.&lt;br /&gt;
* To test outstanding number of reviews, we added new tests. The code works on number of reviews completed. If the number of reviews completed are less than assignment's max outstanding reviews, then student must not be allowed new review. To test the functionality we mocked ReviewResponseMap to return an object. &lt;br /&gt;
*For one of the test cases we mocked the assignment's max outstanding reviews to be 0, which means without doing even a single review he can request as many reviews as he wants. For the other test case we mocked assignment's max outstanding reviews to be 2 and hence without doing two reviews he can't ask for more. We mocked ReviewResposneMap to have one object.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below: Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
Use the given link: http://152.46.19.135:8080/&lt;br /&gt;
&lt;br /&gt;
Follow the instructions below to test the implemented changes:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Login as instructor.&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Go to Manage-&amp;gt;Assignments and navigate to assignment name 'test1'. &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Click on add participants. This will give a list of all participants. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Now click on any student username in order to impersonate. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Go to test1-&amp;gt;other's_work and click on request submission button continuously and wait for the response.&amp;lt;br/&amp;gt;&lt;br /&gt;
6. It would be noted that the request would never exceed the number of submissions mentioned in the assignment policy.&lt;br /&gt;
&lt;br /&gt;
To test outstanding number of reviews:&amp;lt;br/&amp;gt;&lt;br /&gt;
Follow the steps above, you will get 2 reviews at first.&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Fill up one of the review, You will get the button to request again.&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Click on button continuously.&amp;lt;br/&amp;gt;&lt;br /&gt;
3. It should be noted that despite continuous request, user will not get any more reviews than difference of max outstanding review and completed reviews.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review Limit enforcement===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has done reviews less than assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are less than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically.&lt;br /&gt;
::::2. Redirect to Student review page.&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are greater than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review pending check===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has pending reviews less than assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews less than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically&lt;br /&gt;
::::2. Redirect to Student review page&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews greater than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more reviews when you have &amp;quot;+ assignment.max_outstanding_reviews + &amp;quot;reviews to do&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
22.581%&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
Dhruvil Shah&lt;br /&gt;
&lt;br /&gt;
Neel Parikh&lt;br /&gt;
&lt;br /&gt;
Steve Menezes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor: Suraj Siddharudh&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/dhruvil009/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.19.135:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug Project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=127963</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=127963"/>
		<updated>2019-11-07T04:06:48Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Testing from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
E1956. There is no shortcut to get free review points: Review Assignment Bug&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
====Issue 1====&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
====Issue 2====&lt;br /&gt;
*There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
====Issue 3====&lt;br /&gt;
*There is no check on the number of outstanding reviews a user can have.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project, in particular intends that the students collaborate and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open-source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
Currently, there is no check in the backend that limits the number of reviews a student can be assigned. Students can get more peer reviews than assignment policy. Also, there is no check to see if the user has submitted enough reviews for that assignment before getting a new review.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 1: No limitation on the maximum number of peer reviews.&amp;lt;/b&amp;gt;&lt;br /&gt;
*There is no check in the backend that limits the number of reviews assigned to a student. There is a check in the UI, but one could evade the limit by typing in a URL to make the same post request. One can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 2: No check on duplicate submissions&amp;lt;/b&amp;gt;&lt;br /&gt;
* There is no check to see if the submission is already assigned to a student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 3: There is no check on the number of outstanding reviews&amp;lt;/b&amp;gt;&lt;br /&gt;
*A user can request for submissions even if the current outstanding ones are pending.&lt;br /&gt;
&lt;br /&gt;
[[File:Pro.png]]&lt;br /&gt;
[[File:Issue.png]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Implementation==&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
'''review_mapping_controller.rb'''&lt;br /&gt;
* The is_reviews_allowed method checks the number of reviews assigned to a student and then compares it with the maximum number of reviews allowed as per assignment policy. If the student is asking for more reviews than the assignment policy then it returns False.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def is_review_allowed?(assignment, reviewer)&lt;br /&gt;
  @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id:  assignment.id)&lt;br /&gt;
  assignment.num_reviews_allowed &amp;gt; @review_mappings.size&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* The check_outstanding_reviews checks the number of outstanding assignment reviews a user can have at a time. The check_outstanding_reviews keeps a count of the number of reviews in progress as well as the number of reviews currently completed by the user and returns a Boolean value depending upon whether the former is less than the maximum outstanding reviews allowed as per the assignment policy or not. The user can only request for a submission if the check_outstanding_reviews returns True.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def check_outstanding_reviews?(assignment, reviewer)&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id: assignment.id)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size&lt;br /&gt;
    if @num_reviews_total == 0&lt;br /&gt;
      true&lt;br /&gt;
    else&lt;br /&gt;
      @num_reviews_completed = 0&lt;br /&gt;
      @review_mappings.each do |map|&lt;br /&gt;
        @num_reviews_completed += 1 if !map.response.empty? &amp;amp;&amp;amp; map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
      @num_reviews_in_progress = @num_reviews_total - @num_reviews_completed&lt;br /&gt;
      @num_reviews_in_progress &amp;lt; assignment.max_outstanding_reviews&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_controller_spec.rb'''&lt;br /&gt;
* Change has been done in the implementation of review_mapping_controller.rb where a new check was added. This check fetches the number of reviews done by a student currently from ReviewResponseMap table. To adapt to those changes, two new mocks were added to the review_mapping_controller_spec.rb. &lt;br /&gt;
* ReviewResponseMap is mocked to return 0. This is the number of reviews that a student has done so far.&lt;br /&gt;
* Assignment is mocked to return 1 as number of reviews allowed for the assignment.&lt;br /&gt;
* To test number of reviews, we added new tests. The code works on size of object returned by querying reviewer_id and reviewed_object_id. To avoid database call, ReviewResponseMap is mocked to return empty list and a list of values. Empty list indicates that student has not done any review and therefore must be allowed. List of values is returned to check if the size of list is greater than allowed number of reviews according to assignment policy.&lt;br /&gt;
* To test outstanding number of reviews, we added new tests. The code works on number of reviews completed. If the number of reviews completed are less than assignment's max outstanding reviews, then student must not be allowed new review. To test the functionality we mocked ReviewResponseMap to return an object. &lt;br /&gt;
*For one of the test cases we mocked the assignment's max outstanding reviews to be 0, which means without doing even a single review he can request as many reviews as he wants. For the other test case we mocked assignment's max outstanding reviews to be 2 and hence without doing two reviews he can't ask for more. We mocked ReviewResposneMap to have one object.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below: Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
Use the given link: http://152.46.19.135:8080/&lt;br /&gt;
&lt;br /&gt;
Follow the instructions below to test the implemented changes:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Login as instructor.&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Go to Manage-&amp;gt;Assignments and navigate to assignment name 'test1'. &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Click on add participants. This will give a list of all participants. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Now click on any student username in order to impersonate. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Go to test1-&amp;gt;other's_work and click on request submission button continuously and wait for the response.&amp;lt;br/&amp;gt;&lt;br /&gt;
6. It would be noted that the request would never exceed the number of submissions mentioned in the assignment policy.&lt;br /&gt;
&lt;br /&gt;
To test outstanding number of reviews:&lt;br /&gt;
Follow the steps above, you will get 2 reviews at first.&lt;br /&gt;
1. Fill up one of the review, You will get the button to request again.&lt;br /&gt;
2. Click on button continuously.&lt;br /&gt;
3. It should be noted that despite continuous request, user will not get any more reviews than difference of max outstanding review and completed reviews.&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review Limit enforcement===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has done reviews less than assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are less than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically.&lt;br /&gt;
::::2. Redirect to Student review page.&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are greater than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review pending check===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has pending reviews less than assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews less than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically&lt;br /&gt;
::::2. Redirect to Student review page&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews greater than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more reviews when you have &amp;quot;+ assignment.max_outstanding_reviews + &amp;quot;reviews to do&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
22.581%&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
Dhruvil Shah&lt;br /&gt;
&lt;br /&gt;
Neel Parikh&lt;br /&gt;
&lt;br /&gt;
Steve Menezes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor: Suraj Siddharudh&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/dhruvil009/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.19.135:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug Project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=127961</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=127961"/>
		<updated>2019-11-07T04:01:19Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Files modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
E1956. There is no shortcut to get free review points: Review Assignment Bug&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
====Issue 1====&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
====Issue 2====&lt;br /&gt;
*There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
====Issue 3====&lt;br /&gt;
*There is no check on the number of outstanding reviews a user can have.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project, in particular intends that the students collaborate and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open-source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
Currently, there is no check in the backend that limits the number of reviews a student can be assigned. Students can get more peer reviews than assignment policy. Also, there is no check to see if the user has submitted enough reviews for that assignment before getting a new review.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 1: No limitation on the maximum number of peer reviews.&amp;lt;/b&amp;gt;&lt;br /&gt;
*There is no check in the backend that limits the number of reviews assigned to a student. There is a check in the UI, but one could evade the limit by typing in a URL to make the same post request. One can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 2: No check on duplicate submissions&amp;lt;/b&amp;gt;&lt;br /&gt;
* There is no check to see if the submission is already assigned to a student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 3: There is no check on the number of outstanding reviews&amp;lt;/b&amp;gt;&lt;br /&gt;
*A user can request for submissions even if the current outstanding ones are pending.&lt;br /&gt;
&lt;br /&gt;
[[File:Pro.png]]&lt;br /&gt;
[[File:Issue.png]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Implementation==&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
'''review_mapping_controller.rb'''&lt;br /&gt;
* The is_reviews_allowed method checks the number of reviews assigned to a student and then compares it with the maximum number of reviews allowed as per assignment policy. If the student is asking for more reviews than the assignment policy then it returns False.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def is_review_allowed?(assignment, reviewer)&lt;br /&gt;
  @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id:  assignment.id)&lt;br /&gt;
  assignment.num_reviews_allowed &amp;gt; @review_mappings.size&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* The check_outstanding_reviews checks the number of outstanding assignment reviews a user can have at a time. The check_outstanding_reviews keeps a count of the number of reviews in progress as well as the number of reviews currently completed by the user and returns a Boolean value depending upon whether the former is less than the maximum outstanding reviews allowed as per the assignment policy or not. The user can only request for a submission if the check_outstanding_reviews returns True.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def check_outstanding_reviews?(assignment, reviewer)&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id: assignment.id)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size&lt;br /&gt;
    if @num_reviews_total == 0&lt;br /&gt;
      true&lt;br /&gt;
    else&lt;br /&gt;
      @num_reviews_completed = 0&lt;br /&gt;
      @review_mappings.each do |map|&lt;br /&gt;
        @num_reviews_completed += 1 if !map.response.empty? &amp;amp;&amp;amp; map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
      @num_reviews_in_progress = @num_reviews_total - @num_reviews_completed&lt;br /&gt;
      @num_reviews_in_progress &amp;lt; assignment.max_outstanding_reviews&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_controller_spec.rb'''&lt;br /&gt;
* Change has been done in the implementation of review_mapping_controller.rb where a new check was added. This check fetches the number of reviews done by a student currently from ReviewResponseMap table. To adapt to those changes, two new mocks were added to the review_mapping_controller_spec.rb. &lt;br /&gt;
* ReviewResponseMap is mocked to return 0. This is the number of reviews that a student has done so far.&lt;br /&gt;
* Assignment is mocked to return 1 as number of reviews allowed for the assignment.&lt;br /&gt;
* To test number of reviews, we added new tests. The code works on size of object returned by querying reviewer_id and reviewed_object_id. To avoid database call, ReviewResponseMap is mocked to return empty list and a list of values. Empty list indicates that student has not done any review and therefore must be allowed. List of values is returned to check if the size of list is greater than allowed number of reviews according to assignment policy.&lt;br /&gt;
* To test outstanding number of reviews, we added new tests. The code works on number of reviews completed. If the number of reviews completed are less than assignment's max outstanding reviews, then student must not be allowed new review. To test the functionality we mocked ReviewResponseMap to return an object. &lt;br /&gt;
*For one of the test cases we mocked the assignment's max outstanding reviews to be 0, which means without doing even a single review he can request as many reviews as he wants. For the other test case we mocked assignment's max outstanding reviews to be 2 and hence without doing two reviews he can't ask for more. We mocked ReviewResposneMap to have one object.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below: Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
Use the given link: http://152.46.19.135:8080/&lt;br /&gt;
&lt;br /&gt;
Follow the instructions below to test the implemented changes:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Login as instructor.&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Go to Manage-&amp;gt;Assignments and navigate to assignment name 'test1'. &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Click on add participants. This will give a list of all participants. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Now click on any student username in order to impersonate. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Go to test1-&amp;gt;other's_work and click on request submission button continuously and wait for the response.&amp;lt;br/&amp;gt;&lt;br /&gt;
6. It would be noted that the request would never exceed the number of submissions mentioned in the assignment policy.&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review Limit enforcement===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has done reviews less than assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are less than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically.&lt;br /&gt;
::::2. Redirect to Student review page.&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are greater than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review pending check===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has pending reviews less than assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews less than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically&lt;br /&gt;
::::2. Redirect to Student review page&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews greater than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more reviews when you have &amp;quot;+ assignment.max_outstanding_reviews + &amp;quot;reviews to do&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
22.581%&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
Dhruvil Shah&lt;br /&gt;
&lt;br /&gt;
Neel Parikh&lt;br /&gt;
&lt;br /&gt;
Steve Menezes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor: Suraj Siddharudh&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/dhruvil009/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.19.135:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug Project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=127819</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=127819"/>
		<updated>2019-11-07T02:34:36Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
E1956. There is no shortcut to get free review points: Review Assignment Bug&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
=====Issue 1=====&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
=====Issue 2=====&lt;br /&gt;
*There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
=====Issue 3=====&lt;br /&gt;
*There is no check on the number of outstanding reviews a user can have.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
Currently there is no check in the backend that limits the number of reviews a student can be assigned. Students can get more peer reviews than assignment policy. Also, there is no check to see if the user has submitted enough number of reviews for that assignment before getting new review.&lt;br /&gt;
&lt;br /&gt;
==Problems in Current Implementation==&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 1: No limitation on maximum number of peer reviews.&amp;lt;/b&amp;gt;&lt;br /&gt;
*There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 2: No check on duplicate submissions&amp;lt;/b&amp;gt;&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Problem 3: There is no check on the number of outstanding reviews&amp;lt;/b&amp;gt;&lt;br /&gt;
*A user can request for submissions even if the current outstanding ones are pending&lt;br /&gt;
&lt;br /&gt;
[[File:Merged.png]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Implementation==&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
'''review_mapping_controller_spec.rb'''&lt;br /&gt;
* Change has been done in the implementation of review_mapping_controller.rb where a new check was added. This check fetches the number of reviews done by a student currently from ReviewResponseMap table. To adapt to those changes, two new mocks were added to review_mapping_controller_spec.rb. &lt;br /&gt;
* ReviewResponseMap is mocked to return 0. This is the number of reviews that a student has done so far.&lt;br /&gt;
* Assignment is mocked to return 1 as number of reviews allowed for the assignment. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
context 'when assignment has topics and a topic is selected by reviewer' do&lt;br /&gt;
      it 'assigns reviewer dynamically and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(true)&lt;br /&gt;
        topic = double('SignUpTopic')&lt;br /&gt;
        allow(SignUpTopic).to receive(:find).with('1').and_return(topic)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically).with(participant, topic).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
	allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment does not have topics' do&lt;br /&gt;
      it 'runs another algorithms and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(false)&lt;br /&gt;
        team1 = double('AssignmentTeam')&lt;br /&gt;
        team2 = double('AssignmentTeam')&lt;br /&gt;
        teams = [team1, team2]&lt;br /&gt;
        allow(assignment).to receive(:candidate_assignment_teams_to_review).with(participant).and_return(teams)&lt;br /&gt;
        allow(teams).to receive_message_chain(:to_a, :sample).and_return(team2)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically_no_topic).with(participant, team2).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
        allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''review_mapping_controller.rb'''&lt;br /&gt;
* A new check was added to find the number of reviews done by the student. Whenever a student ask for review, a new entry is done in the ReviewResponseMap table in the database. &lt;br /&gt;
* The code here checks the number of reviews assigned to the student and then compares it with the maximum number of reviews allowed as per assignment policy. If the student is asking for more reviews than the assignment policy then a flash notice is sent to the student.&lt;br /&gt;
* Also there is a check on the number of outstanding assignment reviews a user can have at a time. The check_outstanding_review keeps a count of the number of reviews in progress as well as the number of reviews currently completed by the user and returns a Boolean value depending upon whether the former is less than the maximum outstanding reviews allowed as per the assignment policy or not. The user can only request for a submission if the check_outstanding_review returns True.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first &lt;br /&gt;
&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if is_review_allowed?(assignment, reviewer)&lt;br /&gt;
        if check_outstanding_reviews?(assignment, reviewer)&lt;br /&gt;
          # begin&lt;br /&gt;
          if assignment.topics? # assignment with topics&lt;br /&gt;
            topic = if params[:topic_id]&lt;br /&gt;
                      SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                    else&lt;br /&gt;
                      assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                    end&lt;br /&gt;
            if topic.nil?&lt;br /&gt;
              flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
            end&lt;br /&gt;
&lt;br /&gt;
          else # assignment without topic -Yang&lt;br /&gt;
            assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
            assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
            if assignment_team.nil?&lt;br /&gt;
              flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
      &lt;br /&gt;
  def is_review_allowed?(assignment, reviewer)&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id:  assignment.id)&lt;br /&gt;
    assignment.num_reviews_allowed &amp;gt; @review_mappings.size&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def check_outstanding_reviews?(assignment, reviewer)&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id, reviewed_object_id: assignment.id)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size&lt;br /&gt;
    if @num_reviews_total == 0&lt;br /&gt;
      true&lt;br /&gt;
    else&lt;br /&gt;
      @num_reviews_completed = 0&lt;br /&gt;
      @review_mappings.each do |map|&lt;br /&gt;
        @num_reviews_completed += 1 if !map.response.empty? &amp;amp;&amp;amp; map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
      @num_reviews_in_progress = @num_reviews_total - @num_reviews_completed&lt;br /&gt;
      @num_reviews_in_progress &amp;lt; Assignment.max_outstanding_reviews&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below: Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
Use the given link: http://152.46.19.135:8080/&lt;br /&gt;
&lt;br /&gt;
Follow the instructions below to test the implemented changes:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Login as instructor.&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Go to Manage-&amp;gt;Assignments and navigate to assignment name 'test1'. &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Click on add participants. This will give a list of all participants. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Now click on any student username in order to impersonate. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Go to test1-&amp;gt;other's_work and click on request submission button continuously and wait for the response.&amp;lt;br/&amp;gt;&lt;br /&gt;
6. It would be noted that the request would never exceed the number of submissions mentioned in the assignment policy.&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review Limit enforcement===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has done reviews less than assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are less than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically.&lt;br /&gt;
::::2. Redirect to Student review page.&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy: &amp;lt;pre&amp;gt;context 'when number of reviews are greater than the assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
===Automated Test Cases For Review pending check===&lt;br /&gt;
&lt;br /&gt;
All the test cases have been automated in the review_mapping_controller_spec File&lt;br /&gt;
&lt;br /&gt;
::1. Student has pending reviews less than assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews less than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Assign Review Dynamically&lt;br /&gt;
::::2. Redirect to Student review page&lt;br /&gt;
&lt;br /&gt;
::2. Student has done reviews more than the assignment policy [default 2 pending reviews at most]: &amp;lt;pre&amp;gt;context 'when user has outstanding reviews greater than assignment policy'&amp;lt;/pre&amp;gt;&lt;br /&gt;
::::1. Redirect to Student review page.&lt;br /&gt;
::::2. Show Flash Error. [flash[:error] = &amp;quot;You cannot do more reviews when you have &amp;quot;+ assignment.max_outstanding_reviews + &amp;quot;reviews to do&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
22.581%&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
Dhruvil Shah&lt;br /&gt;
&lt;br /&gt;
Neel Parikh&lt;br /&gt;
&lt;br /&gt;
Steve Menezes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor: Suraj Siddharudh&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/dhruvil009/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.19.135:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug Project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126296</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126296"/>
		<updated>2019-10-29T01:32:30Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
Currently there is no check in the backend that limits the number of reviews a student can be assigned. Students can get more peer reviews than assignment policy.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
[[File:Merged.png]]&lt;br /&gt;
&lt;br /&gt;
==New Implementation==&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
'''review_mapping_controller_spec.rb'''&lt;br /&gt;
* Change has been done in the implementation of review_mapping_controller.rb where new check was added. This check fetches number of reviews done by the student currently from ReviewResponseMap table. To adapt to those changes two new mocks were added to review_mapping_controller_spec.rb. &lt;br /&gt;
* ReviewResponseMap is mocked to return 0. This is the number of reviews that a student has done so far.&lt;br /&gt;
* Assignment is mocked to return 1 as number of reviews allowed for the assignment. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
context 'when assignment has topics and a topic is selected by reviewer' do&lt;br /&gt;
      it 'assigns reviewer dynamically and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(true)&lt;br /&gt;
        topic = double('SignUpTopic')&lt;br /&gt;
        allow(SignUpTopic).to receive(:find).with('1').and_return(topic)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically).with(participant, topic).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
	allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment does not have topics' do&lt;br /&gt;
      it 'runs another algorithms and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(false)&lt;br /&gt;
        team1 = double('AssignmentTeam')&lt;br /&gt;
        team2 = double('AssignmentTeam')&lt;br /&gt;
        teams = [team1, team2]&lt;br /&gt;
        allow(assignment).to receive(:candidate_assignment_teams_to_review).with(participant).and_return(teams)&lt;br /&gt;
        allow(teams).to receive_message_chain(:to_a, :sample).and_return(team2)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically_no_topic).with(participant, team2).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
        allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''review_mapping_controller.rb'''&lt;br /&gt;
* A new check was added to find the number of reviews done by the student. Whenever a student ask for review, a new entry is done in the ReviewResponseMap table in the database. &lt;br /&gt;
* The code here checks the number of reviews assigned to the student and then compares it with the maximum number of reviews allowed as per assignment policy. If the student is asking for more reviews than the assignment policy than a flash notice is sent to the student.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. &lt;br /&gt;
The code in order to assign reviews in a dynamic fashion has been implemented in the review_mappings_controller.rb. The method assign_review_dynamically, checks initially if student has selected a topic for which he wants a review or if the &amp;quot;I don't care&amp;quot; is selected. Based on the selection the method would then select a submission which is&lt;br /&gt;
::1. Not assigned previously to given student&lt;br /&gt;
::2. Is not his own submission&lt;br /&gt;
&lt;br /&gt;
However, since the code did not have a check for how many reviews already are allocated to given student, one could easily bypass the review limit by sending the same post request again and again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ReviewResponseMap:&amp;lt;/b&amp;gt;&lt;br /&gt;
::Creates a mapping from the student to assigned submission for reviewing as soon as assign_review_dynamically assigns a submission to student for review.&lt;br /&gt;
&lt;br /&gt;
We decided to get all the reviews assigned to given student from ReviewResponseMap (where(reviewer_id: reviewer.id)) and then check if the size of the reviews assigned to the given reviewer is more than maximum allocated for the assignment and creates a flash error if the maximum review limit is exceded.&lt;br /&gt;
&lt;br /&gt;
==Testing from UI:==&lt;br /&gt;
Use the given link: http://152.46.19.135:8080/&lt;br /&gt;
&lt;br /&gt;
Follow the instructions below to test the implemented changes:&lt;br /&gt;
1. Login as instructor.&lt;br /&gt;
2. Go to Manage-&amp;gt;Assignments and navigate to assignment name 'test1'.&lt;br /&gt;
3. Click on add participants. This will give a list of all participants. &lt;br /&gt;
4. Now click on any student username in order to impersonate.&lt;br /&gt;
5. Next look for 'test1' and go to test1-&amp;gt;your_work. Enter a new link for the project (say google.com) and click upload.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Scope for Future Improvement==&lt;br /&gt;
1. Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126261</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126261"/>
		<updated>2019-10-29T01:10:29Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
'''review_mapping_controller_spec.rb'''&lt;br /&gt;
* Change has been done in the implementation of review_mapping_controller.rb where new check was added. This check fetches number of reviews done by the student currently from ReviewResponseMap table. To adapt to those changes two new mocks were added to review_mapping_controller_spec.rb. &lt;br /&gt;
* ReviewResponseMap is mocked to return 0. This is the number of reviews that a student has done so far.&lt;br /&gt;
* Assignment is mocked to return 1 as number of reviews allowed for the assignment. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
context 'when assignment has topics and a topic is selected by reviewer' do&lt;br /&gt;
      it 'assigns reviewer dynamically and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(true)&lt;br /&gt;
        topic = double('SignUpTopic')&lt;br /&gt;
        allow(SignUpTopic).to receive(:find).with('1').and_return(topic)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically).with(participant, topic).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
	allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment does not have topics' do&lt;br /&gt;
      it 'runs another algorithms and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(false)&lt;br /&gt;
        team1 = double('AssignmentTeam')&lt;br /&gt;
        team2 = double('AssignmentTeam')&lt;br /&gt;
        teams = [team1, team2]&lt;br /&gt;
        allow(assignment).to receive(:candidate_assignment_teams_to_review).with(participant).and_return(teams)&lt;br /&gt;
        allow(teams).to receive_message_chain(:to_a, :sample).and_return(team2)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically_no_topic).with(participant, team2).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
        allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''review_mapping_controller.rb'''&lt;br /&gt;
* A new check was added to find the number of reviews done by the student. Whenever a student ask for review, a new entry is done in the ReviewResponseMap table in the database. &lt;br /&gt;
* The code here checks the number of reviews assigned to the student and then compares it with the maximum number of reviews allowed as per assignment policy. If the student is asking for more reviews than the assignment policy than a flash notice is sent to the student.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. &lt;br /&gt;
The code in order to assign reviews in a dynamic fashion has been implemented in the review_mappings_controller.rb. The method assign_review_dynamically, checks initially if student has selected a topic for which he wants a review or if the &amp;quot;I don't care&amp;quot; is selected. Based on the selection the method would then select a submission which is&lt;br /&gt;
::1. Not assigned previously to given student&lt;br /&gt;
::2. Is not his own submission&lt;br /&gt;
&lt;br /&gt;
However, since the code did not have a check for how many reviews already are allocated to given student, one could easily bypass the review limit by sending the same post request again and again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ReviewResponseMap:&amp;lt;/b&amp;gt;&lt;br /&gt;
::Creates a mapping from the student to assigned submission for reviewing as soon as assign_review_dynamically assigns a submission to student for review.&lt;br /&gt;
&lt;br /&gt;
We decided to get all the reviews assigned to given student from ReviewResponseMap (where(reviewer_id: reviewer.id)) and then check if the size of the reviews assigned to the given reviewer is more than maximum allocated for the assignment and creates a flash error if the maximum review limit is exceded.&lt;br /&gt;
&lt;br /&gt;
==Scope for Future Improvement==&lt;br /&gt;
1. Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126260</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126260"/>
		<updated>2019-10-29T01:09:43Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
'''review_mapping_controller_spec.rb'''&lt;br /&gt;
* Change has been done in the implementation of review_mapping_controller.rb where new check was added. This check fetches number of reviews done by the student currently from ReviewResponseMap table. To adapt to those changes two new mocks were added to review_mapping_controller_spec.rb. &lt;br /&gt;
* ReviewResponseMap is mocked to return 0. This is the number of reviews that a student has done so far.&lt;br /&gt;
* Assignment is mocked to return 1 as number of reviews allowed for the assignment. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
context 'when assignment has topics and a topic is selected by reviewer' do&lt;br /&gt;
      it 'assigns reviewer dynamically and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(true)&lt;br /&gt;
        topic = double('SignUpTopic')&lt;br /&gt;
        allow(SignUpTopic).to receive(:find).with('1').and_return(topic)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically).with(participant, topic).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
	allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment does not have topics' do&lt;br /&gt;
      it 'runs another algorithms and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(false)&lt;br /&gt;
        team1 = double('AssignmentTeam')&lt;br /&gt;
        team2 = double('AssignmentTeam')&lt;br /&gt;
        teams = [team1, team2]&lt;br /&gt;
        allow(assignment).to receive(:candidate_assignment_teams_to_review).with(participant).and_return(teams)&lt;br /&gt;
        allow(teams).to receive_message_chain(:to_a, :sample).and_return(team2)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically_no_topic).with(participant, team2).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
        allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 '''review_mapping_controller.rb'''&lt;br /&gt;
* A new check was added to find the number of reviews done by the student. Whenever a student ask for review, a new entry is done in the ReviewResponseMap table in the database. &lt;br /&gt;
* The code here checks the number of reviews assigned to the student and then compares it with the maximum number of reviews allowed as per assignment policy. If the student is asking for more reviews than the assignment policy than a flash notice is sent to the student.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. &lt;br /&gt;
The code in order to assign reviews in a dynamic fashion has been implemented in the review_mappings_controller.rb. The method assign_review_dynamically, checks initially if student has selected a topic for which he wants a review or if the &amp;quot;I don't care&amp;quot; is selected. Based on the selection the method would then select a submission which is&lt;br /&gt;
::1. Not assigned previously to given student&lt;br /&gt;
::2. Is not his own submission&lt;br /&gt;
&lt;br /&gt;
However, since the code did not have a check for how many reviews already are allocated to given student, one could easily bypass the review limit by sending the same post request again and again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ReviewResponseMap:&amp;lt;/b&amp;gt;&lt;br /&gt;
::Creates a mapping from the student to assigned submission for reviewing as soon as assign_review_dynamically assigns a submission to student for review.&lt;br /&gt;
&lt;br /&gt;
We decided to get all the reviews assigned to given student from ReviewResponseMap (where(reviewer_id: reviewer.id)) and then check if the size of the reviews assigned to the given reviewer is more than maximum allocated for the assignment and creates a flash error if the maximum review limit is exceded.&lt;br /&gt;
&lt;br /&gt;
==Scope for Future Improvement==&lt;br /&gt;
1. Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126259</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126259"/>
		<updated>2019-10-29T01:09:12Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
* Change has been done in the implementation of review_mapping_controller.rb where new check was added. This check fetches number of reviews done by the student currently from ReviewResponseMap table. To adapt to those changes two new mocks were added to review_mapping_controller_spec.rb. &lt;br /&gt;
* ReviewResponseMap is mocked to return 0. This is the number of reviews that a student has done so far.&lt;br /&gt;
* Assignment is mocked to return 1 as number of reviews allowed for the assignment. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
context 'when assignment has topics and a topic is selected by reviewer' do&lt;br /&gt;
      it 'assigns reviewer dynamically and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(true)&lt;br /&gt;
        topic = double('SignUpTopic')&lt;br /&gt;
        allow(SignUpTopic).to receive(:find).with('1').and_return(topic)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically).with(participant, topic).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
	allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment does not have topics' do&lt;br /&gt;
      it 'runs another algorithms and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(false)&lt;br /&gt;
        team1 = double('AssignmentTeam')&lt;br /&gt;
        team2 = double('AssignmentTeam')&lt;br /&gt;
        teams = [team1, team2]&lt;br /&gt;
        allow(assignment).to receive(:candidate_assignment_teams_to_review).with(participant).and_return(teams)&lt;br /&gt;
        allow(teams).to receive_message_chain(:to_a, :sample).and_return(team2)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically_no_topic).with(participant, team2).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
        allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
* A new check was added to find the number of reviews done by the student. Whenever a student ask for review, a new entry is done in the ReviewResponseMap table in the database. &lt;br /&gt;
* The code here checks the number of reviews assigned to the student and then compares it with the maximum number of reviews allowed as per assignment policy. If the student is asking for more reviews than the assignment policy than a flash notice is sent to the student.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. &lt;br /&gt;
The code in order to assign reviews in a dynamic fashion has been implemented in the review_mappings_controller.rb. The method assign_review_dynamically, checks initially if student has selected a topic for which he wants a review or if the &amp;quot;I don't care&amp;quot; is selected. Based on the selection the method would then select a submission which is&lt;br /&gt;
::1. Not assigned previously to given student&lt;br /&gt;
::2. Is not his own submission&lt;br /&gt;
&lt;br /&gt;
However, since the code did not have a check for how many reviews already are allocated to given student, one could easily bypass the review limit by sending the same post request again and again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ReviewResponseMap:&amp;lt;/b&amp;gt;&lt;br /&gt;
::Creates a mapping from the student to assigned submission for reviewing as soon as assign_review_dynamically assigns a submission to student for review.&lt;br /&gt;
&lt;br /&gt;
We decided to get all the reviews assigned to given student from ReviewResponseMap (where(reviewer_id: reviewer.id)) and then check if the size of the reviews assigned to the given reviewer is more than maximum allocated for the assignment and creates a flash error if the maximum review limit is exceded.&lt;br /&gt;
&lt;br /&gt;
==Scope for Future Improvement==&lt;br /&gt;
1. Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126248</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126248"/>
		<updated>2019-10-29T00:52:28Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
context 'when assignment has topics and a topic is selected by reviewer' do&lt;br /&gt;
      it 'assigns reviewer dynamically and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(true)&lt;br /&gt;
        topic = double('SignUpTopic')&lt;br /&gt;
        allow(SignUpTopic).to receive(:find).with('1').and_return(topic)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically).with(participant, topic).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
	allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment does not have topics' do&lt;br /&gt;
      it 'runs another algorithms and redirects to student_review#list page' do&lt;br /&gt;
        allow(assignment).to receive(:topics?).and_return(false)&lt;br /&gt;
        team1 = double('AssignmentTeam')&lt;br /&gt;
        team2 = double('AssignmentTeam')&lt;br /&gt;
        teams = [team1, team2]&lt;br /&gt;
        allow(assignment).to receive(:candidate_assignment_teams_to_review).with(participant).and_return(teams)&lt;br /&gt;
        allow(teams).to receive_message_chain(:to_a, :sample).and_return(team2)&lt;br /&gt;
        allow(assignment).to receive(:assign_reviewer_dynamically_no_topic).with(participant, team2).and_return(true)&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:reviewer_id).with(1).and_return(0)&lt;br /&gt;
        allow(assignment).to receive(:num_reviews_allowed).and_return(1)&lt;br /&gt;
	params = {&lt;br /&gt;
          assignment_id: 1,&lt;br /&gt;
          reviewer_id: 1,&lt;br /&gt;
          topic_id: 1&lt;br /&gt;
        }&lt;br /&gt;
        post :assign_reviewer_dynamically, params&lt;br /&gt;
        expect(response).to redirect_to '/student_review/list?id=1'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. &lt;br /&gt;
The code in order to assign reviews in a dynamic fashion has been implemented in the review_mappings_controller.rb. The method assign_review_dynamically, checks initially if student has selected a topic for which he wants a review or if the &amp;quot;I don't care&amp;quot; is selected. Based on the selection the method would then select a submission which is&lt;br /&gt;
::1. Not assigned previously to given student&lt;br /&gt;
::2. Is not his own submission&lt;br /&gt;
&lt;br /&gt;
However, since the code did not have a check for how many reviews already are allocated to given student, one could easily bypass the review limit by sending the same post request again and again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ReviewResponseMap:&amp;lt;/b&amp;gt;&lt;br /&gt;
::Creates a mapping from the student to assigned submission for reviewing as soon as assign_review_dynamically assigns a submission to student for review.&lt;br /&gt;
&lt;br /&gt;
We decided to get all the reviews assigned to given student from ReviewResponseMap (where(reviewer_id: reviewer.id)) and then check if the size of the reviews assigned to the given reviewer is more than maximum allocated for the assignment and creates a flash error if the maximum review limit is exceded.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126215</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126215"/>
		<updated>2019-10-29T00:33:52Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously two requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126210</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126210"/>
		<updated>2019-10-29T00:30:30Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png|frame|10px]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png|frame|10px]]&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously two requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126208</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126208"/>
		<updated>2019-10-29T00:29:18Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously two requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126203</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126203"/>
		<updated>2019-10-29T00:28:22Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png|100px]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png|100px]]&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously two requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126191</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126191"/>
		<updated>2019-10-29T00:24:05Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126186</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126186"/>
		<updated>2019-10-29T00:22:06Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==&amp;lt;b&amp;gt;E1956. There is no shortcut to get free review points: Review Assignment Bug&amp;lt;/b&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::'''Click this button multiple times without stopping.'''&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
::'''Result after multiple clicks'''&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
 &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126181</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126181"/>
		<updated>2019-10-29T00:21:01Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1956. There is no shortcut to get free review points: Review Assignment Bug==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
::Click this button multiple times without stopping.&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
::Result after multiple clicks&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
   &lt;br /&gt;
    '''@review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)'''&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      '''if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;'''&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126180</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126180"/>
		<updated>2019-10-29T00:20:45Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: /* Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1956. There is no shortcut to get free review points: Review Assignment Bug==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
* ::Click this button multiple times without stopping.&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
* ::Result after multiple clicks&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
   &lt;br /&gt;
    '''@review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)'''&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      '''if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;'''&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126179</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126179"/>
		<updated>2019-10-29T00:20:02Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1956. There is no shortcut to get free review points: Review Assignment Bug==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
* Click this button multiple times without stopping.&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
* Result after multiple clicks&lt;br /&gt;
[[File:result_1956.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
   &lt;br /&gt;
    '''@review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)'''&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      '''if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;'''&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126178</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126178"/>
		<updated>2019-10-29T00:19:44Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1956. There is no shortcut to get free review points: Review Assignment Bug==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
* Click this button multiple times without stopping.&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
* Result after multiple clicks&lt;br /&gt;
[[File:result_2956.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
   &lt;br /&gt;
    '''@review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)'''&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      '''if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;'''&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;br /&gt;
Currently there is no check on whether a user has completely submitted the previous two reviews before requesting for additional reviews. So one of the future tasks would be to allow a user to request for a new submission if and only if the previously requested submissions have been completed.&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Result_1956.png&amp;diff=126172</id>
		<title>File:Result 1956.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Result_1956.png&amp;diff=126172"/>
		<updated>2019-10-29T00:18:24Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126169</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126169"/>
		<updated>2019-10-29T00:17:43Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Bold text'''==E1956. There is no shortcut to get free review points: Review Assignment Bug==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
* Click this button multiple times without stopping.&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
   &lt;br /&gt;
    '''@review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)'''&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      '''if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
         flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;'''&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126154</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126154"/>
		<updated>2019-10-29T00:08:34Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1956. There is no shortcut to get free review points: Review Assignment Bug==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
[[File:Submit_review_button.png]]&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
   &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
        flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Submit_review_button.png&amp;diff=126149</id>
		<title>File:Submit review button.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Submit_review_button.png&amp;diff=126149"/>
		<updated>2019-10-29T00:05:41Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126146</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126146"/>
		<updated>2019-10-29T00:04:48Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1956. There is no shortcut to get free review points: Review Assignment Bug==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
   &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
        flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126141</id>
		<title>CSC/ECE 517 Fall 2019 - E1956. There is no shortcut to get free review points: Review Assignment Bug</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1956._There_is_no_shortcut_to_get_free_review_points:_Review_Assignment_Bug&amp;diff=126141"/>
		<updated>2019-10-28T23:58:47Z</updated>

		<summary type="html">&lt;p&gt;Nnparik2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1956. There is no shortcut to get free review points: Review Assignment Bug==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Each assignment contains an assignment policy. We can generally submit n reviews according to assignment policy. For an assignment with topics, a student has an option to choose a submission to review or can say “I don’t care” and the system chooses any available topic for review. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
&lt;br /&gt;
This project in particular intends that the students collaborate with each other and work on making enhancements to the code base by applying the concepts of Rails,RSpec, DRY code,Test driven development etc. This provides an opportunity for students to contribute to an open source project and learn further about software deployment etc.&lt;br /&gt;
&lt;br /&gt;
==List of Changes==&lt;br /&gt;
===Issues Presented===&lt;br /&gt;
*The number of reviews done by any student is not checked in the back-end with the maximum number of submissions allowed as per the assignment policy.&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* No limitation on maximum number of peer reviews.	&lt;br /&gt;
::There is no check in the backend that limits the number of reviews a student can be assigned.  There is a check in the UI, but you could evade the limit by typing in a URL to make the same post request. You can also evade it by clicking multiple times on &amp;quot;Request a review for submission&amp;quot; button in UI. 	&lt;br /&gt;
* There is no check to see if the submission is already assigned to the student (on consulting the TA, it was made known that the feature was working correctly without editing any of the code and thus no refactoring was performed for this task).&lt;br /&gt;
* If the same request is re-sent, the system adds the same submission for review a second time.&lt;br /&gt;
===Files modified===&lt;br /&gt;
* review_mapping_controller_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* review_mapping_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def assign_reviewer_dynamically&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment.id).first&lt;br /&gt;
   &lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: reviewer.id)&lt;br /&gt;
    if params[:i_dont_care].nil? &amp;amp;&amp;amp; params[:topic_id].nil? &amp;amp;&amp;amp; assignment.topics? &amp;amp;&amp;amp; assignment.can_choose_topic_to_review?&lt;br /&gt;
      flash[:error] = &amp;quot;No topic is selected.  Please go back and select a topic.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if @review_mappings.size &amp;gt;= assignment.num_reviews_allowed&lt;br /&gt;
        flash[:notice] = &amp;quot;You cannot do more than &amp;quot; + assignment.num_reviews_allowed.to_s + &amp;quot; reviews based on assignment policy&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
      else&lt;br /&gt;
&lt;br /&gt;
      # begin&lt;br /&gt;
      if assignment.topics? # assignment with topics&lt;br /&gt;
        topic = if params[:topic_id]&lt;br /&gt;
                  SignUpTopic.find(params[:topic_id])&lt;br /&gt;
                else&lt;br /&gt;
                  assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
                end&lt;br /&gt;
        if topic.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically(reviewer, topic)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      else # assignment without topic -Yang&lt;br /&gt;
        assignment_teams = assignment.candidate_assignment_teams_to_review(reviewer)&lt;br /&gt;
        assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
        if assignment_team.nil?&lt;br /&gt;
          flash[:error] = &amp;quot;No artifacts are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          assignment.assign_reviewer_dynamically_no_topic(reviewer, assignment_team)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    # rescue Exception =&amp;gt; e&lt;br /&gt;
    #   flash[:error] = (e.nil?) ? $! : e&lt;br /&gt;
    # end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'student_review', action: 'list', id: reviewer.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* The assign_review_dynamically method was previously not keeping a track of the number of assignments reviewed by a student. In order to implement this functionality, we created an instance variable 'review_mappings' that contains the reviews done by a particular 'reviewer.id'. The 'if' condition checks whether the number of tuples in 'review_mappings' is less than the number of reviews allowed for that submission. If yes, then the student is allowed to make an additonal review. Otherwise, a flash message would be generated saying that no more submissions are allowed for the current user.&lt;br /&gt;
&lt;br /&gt;
==Future Implementation==&lt;/div&gt;</summary>
		<author><name>Nnparik2</name></author>
	</entry>
</feed>