<?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=Pgarg5</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=Pgarg5"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Pgarg5"/>
	<updated>2026-05-10T07:25:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145541</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145541"/>
		<updated>2022-04-29T02:12:58Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. Meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''Approach taken to solve the issues''' ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
====* None of the issues need any change of workflow as per preliminary analysis, thus no UML diagram is added.====&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;Metareview&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
[[File: Meta review rubric.png | 400px]]&lt;br /&gt;
[[File: Request button disappear.png | 400px]]&lt;br /&gt;
[[File: Meta begin crash.png | 400px]]&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review. We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Submit button isn't available for meta-reviews''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* The issue at present is there is no submit button for meta-reviews.&lt;br /&gt;
* Users should see save and submit buttons as part of the meta-review form similar to the behavior as the review form.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We would be looking into the response.html.erb file to fix the issue.&lt;br /&gt;
&lt;br /&gt;
The bug is found and fixed and can be checked here:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/d0cd6b2c3816115360e798f8962a2b8f5e64db2a&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Hide meta-review deadline under review strategy when use meta review deadline checkbox is unchecked under due date ''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* The issue at present is that when the meta-review deadline checkbox under due-date has no impact on meta-review deadline under review strategy.&lt;br /&gt;
* Users should see the meta-review deadline under review strategy only when meta-review deadline checkbox is checked.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We would be looking into the review_stragtegy.html.erb file to fix the issue.&lt;br /&gt;
==== Changes:====&lt;br /&gt;
* We have added inline style to the section in meta-review under review strategy to hide/show the section based on a ruby variable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
There was an error tag in view, which is corrected:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/3e535992876291738334e2504bc5ef22bd8610d0&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Numbers of Meta-reviews left:” does not update after a user requests a review.''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
* Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This isn't an issue and is the expected behavior. The same logic is for reviews also. Number of left reviews should only be reduced once any review is submitted.&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Request a new meta-review&amp;quot; button bugs''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Currently after the &amp;quot;Request a new meta-review&amp;quot; button is clicked the button disappears and no new meta-review can be requested. The &amp;quot;Request new a meta-review&amp;quot; button should be hidden only when:&lt;br /&gt;
&lt;br /&gt;
* The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
* The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
&lt;br /&gt;
[[File: Request meta.png | 600px]]&lt;br /&gt;
[[File: Request button disappear.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
The code changes are done to fix this issue are availabel here: https://github.com/amundra02/expertiza/commit/d319dbf02100501c657c1257917c325607192a1f&lt;br /&gt;
&lt;br /&gt;
[[File:Request meta review code.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
Code changes: https://github.com/amundra02/expertiza/commit/de9366941a7932af1cd9c0bf0c946f2ac05638c0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
1. We will target to get all existing test passed, to make sure no existing functionality for other features break.&lt;br /&gt;
&lt;br /&gt;
2. Also, we will be adding few test cases for the issues fixed in this project and hoping to increase coverage.&lt;br /&gt;
&lt;br /&gt;
=====New test case added:===== &lt;br /&gt;
Objective: To find the behavior of questionnaire function in metareview_response_map.rb when there is no questionnaire in assignment.&lt;br /&gt;
Expected behavior: It should return nil object, rather than some garbage object. &lt;br /&gt;
&lt;br /&gt;
The test case added increased test coverage by small margin.&lt;br /&gt;
&lt;br /&gt;
Code changes: https://github.com/amundra02/expertiza/commit/bca6534e78f1edb46dc22e907c23af6bcbef952b&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145540</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145540"/>
		<updated>2022-04-29T02:12:34Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. Meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''Approach taken to solve the issues''' ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
====* None of the issues need any change of workflow as per preliminary analysis, thus no UML diagram is added.====&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;Metareview&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
[[File: Meta review rubric.png | 400px]]&lt;br /&gt;
[[File: Request button disappear.png | 400px]]&lt;br /&gt;
[[File: Meta begin crash.png | 400px]]&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review. We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Submit button isn't available for meta-reviews''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* The issue at present is there is no submit button for meta-reviews.&lt;br /&gt;
* Users should see save and submit buttons as part of the meta-review form similar to the behavior as the review form.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We would be looking into the response.html.erb file to fix the issue.&lt;br /&gt;
&lt;br /&gt;
The bug is found and fixed and can be checked here:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/d0cd6b2c3816115360e798f8962a2b8f5e64db2a&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Hide meta-review deadline under review strategy when use meta review deadline checkbox is unchecked under due date ''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* The issue at present is that when the meta-review deadline checkbox under due-date has no impact on meta-review deadline under review strategy.&lt;br /&gt;
* Users should see the meta-review deadline under review strategy only when meta-review deadline checkbox is checked.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We would be looking into the review_stragtegy.html.erb file to fix the issue.&lt;br /&gt;
==== Changes:====&lt;br /&gt;
* We have added inline style to the section in meta-review under review strategy to hide/show the section based on a ruby variable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
There was an error tag in view, which is corrected:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/3e535992876291738334e2504bc5ef22bd8610d0&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Numbers of Meta-reviews left:” does not update after a user requests a review.''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
* Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This isn't an issue and is the expected behavior. The same logic is for reviews also. Number of left reviews should only be reduced once any review is submitted.&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Request a new meta-review&amp;quot; button bugs''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Currently after the &amp;quot;Request a new meta-review&amp;quot; button is clicked the button disappears and no new meta-review can be requested. The &amp;quot;Request new a meta-review&amp;quot; button should be hidden only when:&lt;br /&gt;
&lt;br /&gt;
* The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
* The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
&lt;br /&gt;
[[File: Request meta.png | 600px]]&lt;br /&gt;
[[File: Request button disappear.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
The code changes are done to fix this issue are availabel here: https://github.com/amundra02/expertiza/commit/d319dbf02100501c657c1257917c325607192a1f&lt;br /&gt;
&lt;br /&gt;
[[File:Request meta review code.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
Code changes: https://github.com/amundra02/expertiza/commit/de9366941a7932af1cd9c0bf0c946f2ac05638c0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
1. We will target to get all existing test passed, to make sure no existing functionality for other features break.&lt;br /&gt;
&lt;br /&gt;
2. Also, we will be adding few test cases for the issues fixed in this project and hoping to increase coverage.&lt;br /&gt;
&lt;br /&gt;
=====New test case added:===== &lt;br /&gt;
Objective: To find the behavior of questionnaire function in metareview_response_map.rb when there is no questionnaire in assignment.&lt;br /&gt;
Expected behavior: It should return nil object, rather than some garbage object. &lt;br /&gt;
&lt;br /&gt;
The test case added test coverage by small margin.&lt;br /&gt;
Code changes: https://github.com/amundra02/expertiza/commit/bca6534e78f1edb46dc22e907c23af6bcbef952b&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145539</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145539"/>
		<updated>2022-04-29T02:10:37Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. Meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''Approach taken to solve the issues''' ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
====* None of the issues need any change of workflow as per preliminary analysis, thus no UML diagram is added.====&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;Metareview&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
[[File: Meta review rubric.png | 400px]]&lt;br /&gt;
[[File: Request button disappear.png | 400px]]&lt;br /&gt;
[[File: Meta begin crash.png | 400px]]&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review. We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Submit button isn't available for meta-reviews''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* The issue at present is there is no submit button for meta-reviews.&lt;br /&gt;
* Users should see save and submit buttons as part of the meta-review form similar to the behavior as the review form.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We would be looking into the response.html.erb file to fix the issue.&lt;br /&gt;
&lt;br /&gt;
The bug is found and fixed and can be checked here:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/d0cd6b2c3816115360e798f8962a2b8f5e64db2a&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Hide meta-review deadline under review strategy when use meta review deadline checkbox is unchecked under due date ''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* The issue at present is that when the meta-review deadline checkbox under due-date has no impact on meta-review deadline under review strategy.&lt;br /&gt;
* Users should see the meta-review deadline under review strategy only when meta-review deadline checkbox is checked.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We would be looking into the review_stragtegy.html.erb file to fix the issue.&lt;br /&gt;
==== Changes:====&lt;br /&gt;
* We have added inline style to the section in meta-review under review strategy to hide/show the section based on a ruby variable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
There was an error tag in view, which is corrected:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/3e535992876291738334e2504bc5ef22bd8610d0&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Numbers of Meta-reviews left:” does not update after a user requests a review.''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
* Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This isn't an issue and is the expected behavior. The same logic is for reviews also. Number of left reviews should only be reduced once any review is submitted.&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Request a new meta-review&amp;quot; button bugs''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Currently after the &amp;quot;Request a new meta-review&amp;quot; button is clicked the button disappears and no new meta-review can be requested. The &amp;quot;Request new a meta-review&amp;quot; button should be hidden only when:&lt;br /&gt;
&lt;br /&gt;
* The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
* The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
&lt;br /&gt;
[[File: Request meta.png | 600px]]&lt;br /&gt;
[[File: Request button disappear.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
The code changes are done to fix this issue are availabel here: https://github.com/amundra02/expertiza/commit/d319dbf02100501c657c1257917c325607192a1f&lt;br /&gt;
&lt;br /&gt;
[[File:Request meta review code.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
Code changes: https://github.com/amundra02/expertiza/commit/de9366941a7932af1cd9c0bf0c946f2ac05638c0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
1. We will target to get all existing test passed, to make sure no existing functionality for other features break.&lt;br /&gt;
&lt;br /&gt;
2. Also, we will be adding few test cases for the issues fixed in this project and hoping to increase coverage.&lt;br /&gt;
&lt;br /&gt;
=====New test case added:===== &lt;br /&gt;
Objective: To find the behavior of questionnaire function in metareview_response_map.rb when there is no questionnaire in assignment.&lt;br /&gt;
Expected behavior: It should return nil object, rather than some garbage object. &lt;br /&gt;
&lt;br /&gt;
The test case added test coverage by small margin.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145258</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145258"/>
		<updated>2022-04-25T22:29:03Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. Meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''Approach taken to solve the issues''' ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
====* None of the issues need any change of workflow as per preliminary analysis, thus no UML diagram is added.====&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;Metareview&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
[[File: Meta review rubric.png | 400px]]&lt;br /&gt;
[[File: Request button disappear.png | 400px]]&lt;br /&gt;
[[File: Meta begin crash.png | 400px]]&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review. We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Submit button isn't available for meta-reviews''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* The issue at present is there is no submit button for meta-reviews.&lt;br /&gt;
* Users should see save and submit buttons as part of the meta-review form similar to the behavior as the review form.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We would be looking into the response.html.erb file to fix the issue.&lt;br /&gt;
&lt;br /&gt;
The bug is found and fixed and can be checked here:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/d0cd6b2c3816115360e798f8962a2b8f5e64db2a&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
There was an error tag in view, which is corrected:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/3e535992876291738334e2504bc5ef22bd8610d0&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Numbers of Meta-reviews left:” does not update after a user requests a review.''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
* Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This isn't an issue and is the expected behavior. The same logic is for reviews also. Number of left reviews should only be reduced once any review is submitted.&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Request a new meta-review&amp;quot; button bugs''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Currently after the &amp;quot;Request a new meta-review&amp;quot; button is clicked the button disappears and no new meta-review can be requested. The &amp;quot;Request new a meta-review&amp;quot; button should be hidden only when:&lt;br /&gt;
&lt;br /&gt;
* The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
* The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
&lt;br /&gt;
[[File: Request meta.png | 600px]]&lt;br /&gt;
[[File: Request button disappear.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
The code changes are done to fix this issue are availabel here: https://github.com/amundra02/expertiza/commit/d319dbf02100501c657c1257917c325607192a1f&lt;br /&gt;
&lt;br /&gt;
[[File:Request meta review code.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
Code changes: https://github.com/amundra02/expertiza/commit/de9366941a7932af1cd9c0bf0c946f2ac05638c0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
1. We will target to get all existing test passed, to make sure no existing functionality for other features break.&lt;br /&gt;
&lt;br /&gt;
2. Also, we will be adding few test cases for the issues fixed in this project and hoping to increase coverage.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145257</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=145257"/>
		<updated>2022-04-25T22:27:48Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. Meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''Approach taken to solve the issues''' ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
====* None of the issues need any change of workflow as per preliminary analysis, thus no UML diagram is added.====&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;Metareview&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
[[File: Meta review rubric.png | 400px]]&lt;br /&gt;
[[File: Request button disappear.png | 400px]]&lt;br /&gt;
[[File: Meta begin crash.png | 400px]]&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review. We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Submit button isn't available for meta-reviews''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* The issue at present is there is no submit button for meta-reviews.&lt;br /&gt;
* Users should see save and submit buttons as part of the meta-review form similar to the behavior as the review form.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We would be looking into the response.html.erb file to fix the issue.&lt;br /&gt;
&lt;br /&gt;
The bug is found and fixed and can be checked here:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/d0cd6b2c3816115360e798f8962a2b8f5e64db2a&lt;br /&gt;
&lt;br /&gt;
= '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
There was an error tag in view, which is corrected:&lt;br /&gt;
https://github.com/amundra02/expertiza/commit/3e535992876291738334e2504bc5ef22bd8610d0&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Numbers of Meta-reviews left:” does not update after a user requests a review.''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
* Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This isn't an issue and is the expected behavior. The same logic is for reviews also. Number of left reviews should only be reduced once any review is submitted.&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Request a new meta-review&amp;quot; button bugs''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Currently after the &amp;quot;Request a new meta-review&amp;quot; button is clicked the button disappears and no new meta-review can be requested. The &amp;quot;Request new a meta-review&amp;quot; button should be hidden only when:&lt;br /&gt;
&lt;br /&gt;
* The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
* The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
&lt;br /&gt;
[[File: Request meta.png | 600px]]&lt;br /&gt;
[[File: Request button disappear.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
The code changes are done to fix this issue are availabel here: https://github.com/amundra02/expertiza/commit/d319dbf02100501c657c1257917c325607192a1f&lt;br /&gt;
&lt;br /&gt;
[[File:Request meta review code.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
Code changes: https://github.com/amundra02/expertiza/commit/de9366941a7932af1cd9c0bf0c946f2ac05638c0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
1. We will target to get all existing test passed, to make sure no existing functionality for other features break.&lt;br /&gt;
&lt;br /&gt;
2. Also, we will be adding few test cases for the issues fixed in this project and hoping to increase coverage.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144607</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144607"/>
		<updated>2022-04-08T03:11:51Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. Meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''Approach taken to solve the issues''' ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
====* None of the issues need any change of workflow as per preliminary analysis, thus no UML diagram is added.====&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;Metareview&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
[[File: Meta review rubric.png | 400px]]&lt;br /&gt;
[[File: Request button disappear.png | 400px]]&lt;br /&gt;
[[File: Meta begin crash.png | 400px]]&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review. We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Submit button isn't available for meta-reviews''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* The issue at present is there is no submit button for meta-reviews.&lt;br /&gt;
* Users should see save and submit buttons as part of the meta-review form similar to the behavior as the review form.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We would be looking into the response.html.erb file to fix the issue.&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Numbers of Meta-reviews left:” does not update after a user requests a review.''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
* Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This isn't an issue and is the expected behavior. The same logic is for reviews also. Number of left reviews should only be reduced once any review is submitted.&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Request a new meta-review&amp;quot; button bugs''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Currently after the &amp;quot;Request a new meta-review&amp;quot; button is clicked the button disappears and no new meta-review can be requested. The &amp;quot;Request new a meta-review&amp;quot; button should be hidden only when:&lt;br /&gt;
&lt;br /&gt;
* The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
* The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
&lt;br /&gt;
[[File: Request meta.png | 600px]]&lt;br /&gt;
[[File: Request button disappear.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
[[File:Request meta review code.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is  shown even before the review deadline is not passed''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline is not passed the request for meta review is getting displayed.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''When there are no review questions assigned to a review upon opening it the site crashes''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review questions if I click on begin button the site is crashing &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check on the number of questions.&lt;br /&gt;
&lt;br /&gt;
== '''Testing Plan''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
1. We will target to get all existing test passed, to make sure no existing functionality for other features break.&lt;br /&gt;
&lt;br /&gt;
2. Also, we will be adding few test cases for the issues fixed in this project and hoping to increase coverage.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144395</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144395"/>
		<updated>2022-04-06T20:37:44Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''Approach took to problem''' ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review.&lt;br /&gt;
==== Plan:==== &lt;br /&gt;
We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline has passed and I click on meta review then the site is crashed&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is  shown even before the review deadline is not passed''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline is not passed the request for meta review is getting displayed.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''When there are no review questions upon opening the site crashes''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review questions if I click on begin button the site is crashing &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check on the number of questions.&lt;br /&gt;
&lt;br /&gt;
== '''Site crash at multiple unhandled scenarios''' ==&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* At many places in code exceptions are raised, which are like pretty easy to hit. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will discuss with expertiza team if these are supposed to be like this or there should be some better handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''&amp;quot;Numbers of Meta-reviews left:” does not update after a user requests a review.''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
* Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This doesn't seem like an issue. It is more of like expected behavior. The same logic is for reviews also. Number of left reviews should only be reduced once any review is submitted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
1. We will target to get all existing test passed, to make sure no existing functionality for other features break.&lt;br /&gt;
&lt;br /&gt;
2. Also, we will be adding few test cases for the issues fixed in this project and hoping to increase coverage.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144387</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144387"/>
		<updated>2022-04-06T20:24:14Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== Approach took to problem ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review.&lt;br /&gt;
==== Plan:==== &lt;br /&gt;
We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline has passed and I click on meta review then the site is crashed&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is  shown even before the review deadline is not passed''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline is not passed the request for meta review is getting displayed.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''When there are no review questions upon opening the site crashes''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review questions if I click on begin button the site is crashing &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check on the number of questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* At many places in code exceptions are raised, which are like pretty easy to hit. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will discuss with expertiza team if these are supposed to be like this or there should be some better handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''[&amp;quot;Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
* Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This doesn't seem like an issue. It is more of like expected behavior. The same logic is for reviews also. Number of left reviews should only be reduced once any review is submitted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
1. We will target to get all existing test passed, to make sure no existing functionality for other features break.&lt;br /&gt;
&lt;br /&gt;
2. Also, we will be adding few test cases for the issues fixed in this project and hoping to increase coverage.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144382</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144382"/>
		<updated>2022-04-06T20:21:30Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== Approach took to problem ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review.&lt;br /&gt;
==== Plan:==== &lt;br /&gt;
We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline has passed and I click on meta review then the site is crashed&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is  shown even before the review deadline is not passed''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline is not passed the request for meta review is getting displayed.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''When there are no review questions upon opening the site crashes''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review questions if I click on begin button the site is crashing &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check on the number of questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* At many places in code exceptions are raised, which are like pretty easy to hit. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will discuss with expertiza team if these are supposed to be like this or there should be some better handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''[&amp;quot;Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
* Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* This doesn't seem like an issue. It is more of like expected behavior. The same logic is for reviews also. Number of left reviews should only be reduced once any review is submitted.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144381</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144381"/>
		<updated>2022-04-06T20:18:00Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== Approach took to problem ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review.&lt;br /&gt;
==== Plan:==== &lt;br /&gt;
We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline has passed and I click on meta review then the site is crashed&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is  shown even before the review deadline is not passed''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline is not passed the request for meta review is getting displayed.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''When there are no review questions upon opening the site crashes''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review questions if I click on begin button the site is crashing &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check on the number of questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* At many places in code exceptions are raised, which are like pretty easy to hit. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* We will discuss with expertiza team if these are supposed to be like this or there should be some better handling.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144377</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144377"/>
		<updated>2022-04-06T20:16:18Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== Approach took to problem ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review.&lt;br /&gt;
==== Plan:==== &lt;br /&gt;
We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline has passed and I click on meta review then the site is crashed&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is  shown even before the review deadline is not passed''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline is not passed the request for meta review is getting displayed.&lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''When there are no review questions upon opening the site crashes''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review questions if I click on begin button the site is crashing &lt;br /&gt;
==== Plan:====&lt;br /&gt;
* For fixing this we are planning to add a simple if check on the number of questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
At many places in code exceptions are raised, which are like pretty easy to hit. &lt;br /&gt;
==== Plan:====&lt;br /&gt;
We will discuss with expertiza team if these are supposed to be like this or there should be some better handling.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144375</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144375"/>
		<updated>2022-04-06T20:13:37Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== Approach took to problem ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
Plan:&lt;br /&gt;
We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review.&lt;br /&gt;
Plan: &lt;br /&gt;
We will be checking the history of this change and try to find at what time partial view file was removed from code.&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline has passed and I click on meta review then the site is crashed&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is  shown even before the review deadline is not passed''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline is not passed the request for meta review is getting displayed.&lt;br /&gt;
* For fixing this we are planning to add a simple if check &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''When there are no review questions upon opening the site crashes''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review questions if I click on begin button the site is crashing &lt;br /&gt;
* For fixing this we are planning to add a simple if check on the number of questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
At many places in code exceptions are raised, which are like pretty easy to hit. We will discuss with expertiza team if these are supposed to be like this or there should be some better handling.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144373</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144373"/>
		<updated>2022-04-06T20:12:26Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== Approach took to problem ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
Plan:&lt;br /&gt;
We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it shows just plain old review.&lt;br /&gt;
Plan: &lt;br /&gt;
We will be checking the history of this change and try to find at what partial view file was removed.&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline has passed and I click on meta review then the site is crashed&lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is breaking the website when there are no review''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review available the request for meta-review deadline is crashing the site. &lt;br /&gt;
* Fixing it, we were able to show a small error message instead of allowing the site to crash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Request for meta review is  shown even before the review deadline is not passed''' ==&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When the review deadline is not passed the request for meta review is getting displayed.&lt;br /&gt;
* For fixing this we are planning to add a simple if check &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''When there are no review questions upon opening the site crashes''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
* When there are no review questions if I click on begin button the site is crashing &lt;br /&gt;
* For fixing this we are planning to add a simple if check on the number of questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue Description===&lt;br /&gt;
At many places in code exceptions are raised, which are like pretty easy to hit. We will discuss with expertiza team if these are supposed to be like this or there should be some better handling.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144329</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144329"/>
		<updated>2022-04-06T17:31:50Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== Approach took to problem ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin link not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime:&lt;br /&gt;
Observations:&lt;br /&gt;
* While selecting &amp;quot;&amp;quot; rubric in local db, the begin link crashed.&lt;br /&gt;
* Following the code we observed it was returning questionnaire list, where only object was expected.&lt;br /&gt;
* Fixing it, we were able to see page redirecting successfully.&lt;br /&gt;
We will be looking into this issue further, if the questionnaire was supposed to be the way it is?&lt;br /&gt;
&lt;br /&gt;
* Further the loaded page doesn't have any portion of view for meta-review, instead it showsjust plain old review.&lt;br /&gt;
&lt;br /&gt;
== '''[ A lot of exceptions in meta-review codeflow]''' ==&lt;br /&gt;
At many places in code exceptions are raised, which are like pretty easy to hit. We will discuss with expertiza team if these are suppose to be like this or there should be some better handling.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144325</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144325"/>
		<updated>2022-04-06T17:23:34Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== Approach took to problem ==&lt;br /&gt;
* We started by looking at issues happening for meta reviews in beta branch&lt;br /&gt;
* Next we tried to understand difference between meta-review and review.&lt;br /&gt;
* Further we tried to explore the possibility of combining meta-reviews and review to follow DRY principle in code.&lt;br /&gt;
* But we observed that since meta review is advanced stage in review cycle and each meta-review is associated with some previous review and reviewee, there is no way to have single model and controller.&lt;br /&gt;
* So we scrapped the idea of changing the design at root level.&lt;br /&gt;
* The best approach here to handle current meta-review issues is to fix them individually.&lt;br /&gt;
* The details on how each issue will be approached and fixed is given below.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
There was a mistake in &amp;lt;code&amp;gt;app/views/response/_review.html.erb&amp;lt;/code&amp;gt; where &amp;quot;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;hr/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;quot; was being displayed under the review being meta-reviewed. This was due to being included as a string constant rather than html code. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_comments_response_review.PNG]]&lt;br /&gt;
&lt;br /&gt;
There was an instance in &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; where ruby code responsible for getting a review to be displayed was being interpreted and displayed, even though the response was being displayed as html in the line before. This resulted in the response details being listed in the UI erroneously.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_response_view.PNG]]&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/49 #49 - &amp;quot;Request a new meta-review&amp;quot; button crashes when there are no available reviews]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
When there are no valid metareviews to perform (either there are no reivews performed on the assignment, the only valid reviews concern your own work or own reviews, you have completed all allowed metareviews, or you have reviewed all valid reviews already) then the &amp;quot;Request a New Review&amp;quot; button still is visible and displays the following error (correctly) when pressed.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. Log in as instructor6, click on mange...-&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
2. Click on edit assignment, navigate to Due Dates and check &amp;quot;Use meta-review deadline&amp;quot; checkbox&lt;br /&gt;
&lt;br /&gt;
3. Select &amp;quot;Yes&amp;quot; for all submission allowed, Review allowed and Meta-review allowed in all of the deadline types&lt;br /&gt;
&lt;br /&gt;
4. Navigate back to Assignment Tree View and click on &amp;quot;Add participant&amp;quot;&lt;br /&gt;
&lt;br /&gt;
5. Add couple of students(say student1 and student2) to the assignment&lt;br /&gt;
&lt;br /&gt;
6. Impersonate/login as student1 and make a submission&lt;br /&gt;
&lt;br /&gt;
7. Log in as instructor6 as previously described and change the submission due date to be passed so we are currently in the review stage&lt;br /&gt;
&lt;br /&gt;
8. Impersonate/login as student2 and Request for a new review under others work, submit the review&lt;br /&gt;
&lt;br /&gt;
9. Log in as instructor6 as previously described and change the review due date to be passed so we are currently in the meta-review stage&lt;br /&gt;
&lt;br /&gt;
10. Impersonate/login back as student1 (the one with the submission) and Request for a new meta review&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_outofreviews.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we conditionally hide the button based on whether or not the participant has reviews available to perform. These checks are located in assignment.rb which is the model for an Assignment. The following method was added to assignment.rb and returns true when the participant has a valid meta-review available.&lt;br /&gt;
&lt;br /&gt;
  # Returns true if there is a meta-review task available for the user&lt;br /&gt;
  def metareview_available?(user_id)&lt;br /&gt;
    metareviewer = AssignmentParticipant.where(user_id: user_id, parent_id: self.id).first&lt;br /&gt;
    begin&lt;br /&gt;
      self.response_map_to_metareview(metareviewer)&lt;br /&gt;
      true&lt;br /&gt;
    rescue &lt;br /&gt;
      false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/27 #27 - Defaulting Required and Allowed Meta-reviews to NULL in Assignment Database]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
Currently, the number of required and allowed meta-reviews is always being set to 3 in the database. Per the specs of the feature, it should default the database values to NULL. When checkbox &amp;quot;Use meta-review deadline&amp;quot;, in the &amp;quot;Due Dates&amp;quot; tab, is selected then the view should populate required and allowed meta-reviews to 3.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
We created a migration that defaulted the metareviews_allowed and metareviews_required in the Assignment table to nil instead of what the previous team had as 3.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_13.png]]&lt;br /&gt;
&lt;br /&gt;
Since the number of meta-reviews allowed and required are recorded using the values in the text fields, changes were made to &amp;lt;code&amp;gt;app/views/assignment/edit/_review_strategy.html.erb&amp;lt;/code&amp;gt; to set the values and display them as expected.&lt;br /&gt;
&lt;br /&gt;
When the checkbox for setting meta-review limits is unchecked, the values of number of meta-reviews allowed and required should be null. When the checkbox is checked, the values should be set to 3 and 3 by default, or to the values already defined before (in case the assignment was saved with the values set already). On page load, if the checkbox is enabled, then the inputs should be shown with the default or pre-set values, but if the checkbox is disabled then they should be hidden and set to null.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_2.PNG]]&lt;br /&gt;
&lt;br /&gt;
Changes had to be made to &amp;lt;code&amp;gt;app/views/student_review/list.html.erb&amp;lt;/code&amp;gt; to account for the values being &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_3.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
Tests have been created that test if a metareview can have nil limits. In this case, no limit will be shown to the user. Before this change that was impossible&lt;br /&gt;
&lt;br /&gt;
== '''Issue 5 - Meta Review Limit is Not Functioning Correctly in Assignment Creation''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;has meta review limit&amp;quot; should determine whether a limit or requirement is placed on the student to complete meta reviews. If disabled, then they should be able to complete as many as they want. This is independent of the Meta Review STAGE that is enabled/disabled in the due dates tab. They should not impact each other and currently do within the assignment creation.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. If the &amp;quot;Use meta-review deadline&amp;quot; is disabled, then the Meta Review Limit panel disappears&lt;br /&gt;
&lt;br /&gt;
2. &amp;quot;Has meta-review limit?&amp;quot; is hidden on edit&lt;br /&gt;
&lt;br /&gt;
3. Possibility the &amp;quot;Has meta-review limit?&amp;quot; not being saved on assignment creation?&lt;br /&gt;
&lt;br /&gt;
4. If the &amp;quot;Use meta-review deadline&amp;quot; is toggled (disabled, enabled), then the &amp;quot;Has meta-review limit?&amp;quot; resets to disabled&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
&lt;br /&gt;
The code in _due_dates.html.erb and the _review_strategy.html.erb within the /app/app/views/assignments/edit folder is lazily written and does not really adhere to the project specifications of how metareviews should work on assignment creation. These views need to be edited to work correctly and also respond to the changes in issue 5.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
The changes were too long to screenshot, so here is the specific diff section:&lt;br /&gt;
&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-540fd2bd6c34b48213716b1dd713733a&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-80f39fa5f62c73ff8741b02d3b11656c&lt;br /&gt;
&lt;br /&gt;
== '''Discovered Bugs:''' ==&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/45 #45 - &amp;quot;Request a new meta-review&amp;quot; button bugs]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Request new a meta-review&amp;quot; button should be hidden when:&lt;br /&gt;
# The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
# The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
# There are no valid reviews available for the participant.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 0 reviewers. The user should NOT be able to see the 'Request a new meta-review to perform' button when there are no reviews available.&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** A student should NOT be able to request a meta-review on their own review.&lt;br /&gt;
*** When the meta-review limit on the assignment is set to 1 then a student should NOT be able to request a second meta-review.&lt;br /&gt;
*** The user should not be able to see the 'Request a new meta-review to perform' button when they have performed all valid reviews.&lt;br /&gt;
** with 4 reviewers.&lt;br /&gt;
*** The user should be able to click the 'Begin' button and still see the 'Request a new meta-review to perform' button.&lt;br /&gt;
*** The user should NOT be able to see the 'Request a new meta-review to perform' button when they have reached the meta-review limit.&lt;br /&gt;
*** If the user requests two meta-reviews but has not submitted, then they should not be able to request a new meta-review.&lt;br /&gt;
*** The user should be able to request a meta-review if they are above their required but below the allowed number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/30 #30 - “Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of Meta-Reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_completed %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixed behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of meta-reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_total %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is requested.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is completed.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/43 #43 - &amp;quot;Review Allowed&amp;quot; flag is required to be set on a due_date for a user to perform a meta-review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
When an assignment with a meta-review is created the round that meta-reviews will be performed in should have the &amp;quot;Meta-review allowed&amp;quot; option set to yes. This should be the only requirement for making meta-reviews available in that round. The problem with the current implementation is that meta-reviews can only be performed in rounds where the &amp;quot;Review allowed&amp;quot; option is set.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025 Issue43.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were applied to app/views/student_review/_responses.html.erb. Since this partial is shared by both reviews and meta-reviews in list.html.erb the title variable was used to determine if the begin option should be active or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; @assignment.can_review(topic_id) %&amp;gt;&lt;br /&gt;
Current behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; &lt;br /&gt;
        ((@assignment.can_review(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Review&amp;quot;) ||&lt;br /&gt;
         (@assignment.metareview_allowed(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Meta-review&amp;quot;)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. All meta-review tests make meta-reviews allowed only during the meta-review round. This means that if the simple meta-review test is passing then this feature is working as intended.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/50 #50 - The submit button is not available for meta-reviews.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Users should see save and submit buttons as part of the meta-review form. These buttons should have the same behavior as the review form. The problem right now is there is not submit button for meta-reviews.&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were made adding 'Metareview' to the conditional that determines if the submit button should be shown or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review')) %&amp;gt;&lt;br /&gt;
New behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review') || (@title.eql? 'Metareview'))%&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Submit &amp;quot;+@title, :name =&amp;gt; &amp;quot;Submit&amp;quot;, :id =&amp;gt; &amp;quot;Submit&amp;quot; %&amp;gt;&lt;br /&gt;
   &amp;lt;img src=&amp;quot;/assets/info.png&amp;quot; title='- SAVE will only store the peer-review as draft and the peer-review will not be displayed to the reviewee. After clicking SUBMIT, the peer-review will be displayed to reviewee, and you will not be able to update it any more.'&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user is able to SUBMIT a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
==== Context 1: Meta-review tests that have a meta-review deadline with 0 reviewers. ====&lt;br /&gt;
1. User should NOT be able to see 'Request a new meta-review to perform' button when there are no reviews available. When there are reviews that don't belong to the meta-reviewer submitted, meta-reviews can be performed.&lt;br /&gt;
&lt;br /&gt;
==== Context 2: Meta-review tests that have a meta-review deadline with 1 reviewers. ====&lt;br /&gt;
1. User is able to SAVE a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
2. User is able to go BACK during a simple meta-review since this functionality is available for reviews.&lt;br /&gt;
&lt;br /&gt;
3. When the limit and required number of meta-reviews on the assignment are equal, then a student will see they need to submit exactly that number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
4. When there are more meta-reviews allowed than required, then a student will see they need to submit between the two numbers of meta-reviews&lt;br /&gt;
&lt;br /&gt;
5. When the meta-review limits for an assignment are unset then a student will see that the number of meta-reviews aren't limited&lt;br /&gt;
&lt;br /&gt;
6. A student should not see a number of required or allowed meta-reviews when there are no limits on meta-reviews&lt;br /&gt;
&lt;br /&gt;
7. A student should see the number of meta-reviews decrement after a review is requested&lt;br /&gt;
&lt;br /&gt;
8. A student should see the number of meta-reviews decrement after they complete a review&lt;br /&gt;
&lt;br /&gt;
9. A student should not be able to request a meta-review on their own reviews &lt;br /&gt;
&lt;br /&gt;
10. If the meta-review limit on the assignment is set to 1 then a student should not be able to request a second meta review&lt;br /&gt;
&lt;br /&gt;
11. User should not be able to see 'Request a new meta-review to perform' button when they have reviewed all valid reviews already&lt;br /&gt;
&lt;br /&gt;
==== Context 3: Meta-review tests that have a meta-review deadline with 4 reviewers. ====&lt;br /&gt;
1. User should be able to request more than one meta-review before completing any&lt;br /&gt;
&lt;br /&gt;
2. User should not be able to see 'Request a new meta-review to perform' button when they have reached the meta-review limit&lt;br /&gt;
&lt;br /&gt;
3. User should not be able to request more than two meta-reviews without completing at least 1&lt;br /&gt;
&lt;br /&gt;
4. A student should be able to request a meta-review if they are above their required but below their allowed meta-reviews&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_tests_passing.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Coverage===&lt;br /&gt;
Current test coverage is 41.348%. Code coverage will increase based on the test plan above and then if the failing test case described below would be fixed.&lt;br /&gt;
&lt;br /&gt;
Travis CI is currently failing because of:&lt;br /&gt;
  Failures:&lt;br /&gt;
  1) assignment function general tab should edit quiz number available to students&lt;br /&gt;
     Failure/Error:&lt;br /&gt;
       child_nodes.each do |node|&lt;br /&gt;
         initialize_fnode_update_children(params, node, tmp_res)&lt;br /&gt;
       end&lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `each' for &amp;quot;&amp;quot;:String&lt;br /&gt;
     # ./app/controllers/tree_display_controller.rb:209:in `children_node_ng'&lt;br /&gt;
     # ./config/diagnostic.rb:11:in `call'&lt;br /&gt;
     # ------------------&lt;br /&gt;
     # --- Caused by: ---&lt;br /&gt;
     # Capybara::CapybaraError:&lt;br /&gt;
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true&lt;br /&gt;
     #   /home/travis/build/expertiza/expertiza/vendor/bundle/ruby/2.2.0/gems/capybara-2.17.0/lib/capybara/session.rb:145:in `raise_server_error!'&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144321</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144321"/>
		<updated>2022-04-06T17:16:26Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/expertiza/expertiza/issues/198 #198 - Begin not working correctly]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
In beta branch begin is not working correctly. The page crashes sometime. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
There was a mistake in &amp;lt;code&amp;gt;app/views/response/_review.html.erb&amp;lt;/code&amp;gt; where &amp;quot;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;hr/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;quot; was being displayed under the review being meta-reviewed. This was due to being included as a string constant rather than html code. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_comments_response_review.PNG]]&lt;br /&gt;
&lt;br /&gt;
There was an instance in &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; where ruby code responsible for getting a review to be displayed was being interpreted and displayed, even though the response was being displayed as html in the line before. This resulted in the response details being listed in the UI erroneously.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_response_view.PNG]]&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/49 #49 - &amp;quot;Request a new meta-review&amp;quot; button crashes when there are no available reviews]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
When there are no valid metareviews to perform (either there are no reivews performed on the assignment, the only valid reviews concern your own work or own reviews, you have completed all allowed metareviews, or you have reviewed all valid reviews already) then the &amp;quot;Request a New Review&amp;quot; button still is visible and displays the following error (correctly) when pressed.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. Log in as instructor6, click on mange...-&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
2. Click on edit assignment, navigate to Due Dates and check &amp;quot;Use meta-review deadline&amp;quot; checkbox&lt;br /&gt;
&lt;br /&gt;
3. Select &amp;quot;Yes&amp;quot; for all submission allowed, Review allowed and Meta-review allowed in all of the deadline types&lt;br /&gt;
&lt;br /&gt;
4. Navigate back to Assignment Tree View and click on &amp;quot;Add participant&amp;quot;&lt;br /&gt;
&lt;br /&gt;
5. Add couple of students(say student1 and student2) to the assignment&lt;br /&gt;
&lt;br /&gt;
6. Impersonate/login as student1 and make a submission&lt;br /&gt;
&lt;br /&gt;
7. Log in as instructor6 as previously described and change the submission due date to be passed so we are currently in the review stage&lt;br /&gt;
&lt;br /&gt;
8. Impersonate/login as student2 and Request for a new review under others work, submit the review&lt;br /&gt;
&lt;br /&gt;
9. Log in as instructor6 as previously described and change the review due date to be passed so we are currently in the meta-review stage&lt;br /&gt;
&lt;br /&gt;
10. Impersonate/login back as student1 (the one with the submission) and Request for a new meta review&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_outofreviews.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we conditionally hide the button based on whether or not the participant has reviews available to perform. These checks are located in assignment.rb which is the model for an Assignment. The following method was added to assignment.rb and returns true when the participant has a valid meta-review available.&lt;br /&gt;
&lt;br /&gt;
  # Returns true if there is a meta-review task available for the user&lt;br /&gt;
  def metareview_available?(user_id)&lt;br /&gt;
    metareviewer = AssignmentParticipant.where(user_id: user_id, parent_id: self.id).first&lt;br /&gt;
    begin&lt;br /&gt;
      self.response_map_to_metareview(metareviewer)&lt;br /&gt;
      true&lt;br /&gt;
    rescue &lt;br /&gt;
      false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/27 #27 - Defaulting Required and Allowed Meta-reviews to NULL in Assignment Database]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
Currently, the number of required and allowed meta-reviews is always being set to 3 in the database. Per the specs of the feature, it should default the database values to NULL. When checkbox &amp;quot;Use meta-review deadline&amp;quot;, in the &amp;quot;Due Dates&amp;quot; tab, is selected then the view should populate required and allowed meta-reviews to 3.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
We created a migration that defaulted the metareviews_allowed and metareviews_required in the Assignment table to nil instead of what the previous team had as 3.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_13.png]]&lt;br /&gt;
&lt;br /&gt;
Since the number of meta-reviews allowed and required are recorded using the values in the text fields, changes were made to &amp;lt;code&amp;gt;app/views/assignment/edit/_review_strategy.html.erb&amp;lt;/code&amp;gt; to set the values and display them as expected.&lt;br /&gt;
&lt;br /&gt;
When the checkbox for setting meta-review limits is unchecked, the values of number of meta-reviews allowed and required should be null. When the checkbox is checked, the values should be set to 3 and 3 by default, or to the values already defined before (in case the assignment was saved with the values set already). On page load, if the checkbox is enabled, then the inputs should be shown with the default or pre-set values, but if the checkbox is disabled then they should be hidden and set to null.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_2.PNG]]&lt;br /&gt;
&lt;br /&gt;
Changes had to be made to &amp;lt;code&amp;gt;app/views/student_review/list.html.erb&amp;lt;/code&amp;gt; to account for the values being &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_3.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
Tests have been created that test if a metareview can have nil limits. In this case, no limit will be shown to the user. Before this change that was impossible&lt;br /&gt;
&lt;br /&gt;
== '''Issue 5 - Meta Review Limit is Not Functioning Correctly in Assignment Creation''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;has meta review limit&amp;quot; should determine whether a limit or requirement is placed on the student to complete meta reviews. If disabled, then they should be able to complete as many as they want. This is independent of the Meta Review STAGE that is enabled/disabled in the due dates tab. They should not impact each other and currently do within the assignment creation.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. If the &amp;quot;Use meta-review deadline&amp;quot; is disabled, then the Meta Review Limit panel disappears&lt;br /&gt;
&lt;br /&gt;
2. &amp;quot;Has meta-review limit?&amp;quot; is hidden on edit&lt;br /&gt;
&lt;br /&gt;
3. Possibility the &amp;quot;Has meta-review limit?&amp;quot; not being saved on assignment creation?&lt;br /&gt;
&lt;br /&gt;
4. If the &amp;quot;Use meta-review deadline&amp;quot; is toggled (disabled, enabled), then the &amp;quot;Has meta-review limit?&amp;quot; resets to disabled&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
&lt;br /&gt;
The code in _due_dates.html.erb and the _review_strategy.html.erb within the /app/app/views/assignments/edit folder is lazily written and does not really adhere to the project specifications of how metareviews should work on assignment creation. These views need to be edited to work correctly and also respond to the changes in issue 5.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
The changes were too long to screenshot, so here is the specific diff section:&lt;br /&gt;
&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-540fd2bd6c34b48213716b1dd713733a&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-80f39fa5f62c73ff8741b02d3b11656c&lt;br /&gt;
&lt;br /&gt;
== '''Discovered Bugs:''' ==&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/45 #45 - &amp;quot;Request a new meta-review&amp;quot; button bugs]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Request new a meta-review&amp;quot; button should be hidden when:&lt;br /&gt;
# The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
# The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
# There are no valid reviews available for the participant.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 0 reviewers. The user should NOT be able to see the 'Request a new meta-review to perform' button when there are no reviews available.&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** A student should NOT be able to request a meta-review on their own review.&lt;br /&gt;
*** When the meta-review limit on the assignment is set to 1 then a student should NOT be able to request a second meta-review.&lt;br /&gt;
*** The user should not be able to see the 'Request a new meta-review to perform' button when they have performed all valid reviews.&lt;br /&gt;
** with 4 reviewers.&lt;br /&gt;
*** The user should be able to click the 'Begin' button and still see the 'Request a new meta-review to perform' button.&lt;br /&gt;
*** The user should NOT be able to see the 'Request a new meta-review to perform' button when they have reached the meta-review limit.&lt;br /&gt;
*** If the user requests two meta-reviews but has not submitted, then they should not be able to request a new meta-review.&lt;br /&gt;
*** The user should be able to request a meta-review if they are above their required but below the allowed number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/30 #30 - “Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of Meta-Reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_completed %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixed behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of meta-reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_total %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is requested.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is completed.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/43 #43 - &amp;quot;Review Allowed&amp;quot; flag is required to be set on a due_date for a user to perform a meta-review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
When an assignment with a meta-review is created the round that meta-reviews will be performed in should have the &amp;quot;Meta-review allowed&amp;quot; option set to yes. This should be the only requirement for making meta-reviews available in that round. The problem with the current implementation is that meta-reviews can only be performed in rounds where the &amp;quot;Review allowed&amp;quot; option is set.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025 Issue43.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were applied to app/views/student_review/_responses.html.erb. Since this partial is shared by both reviews and meta-reviews in list.html.erb the title variable was used to determine if the begin option should be active or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; @assignment.can_review(topic_id) %&amp;gt;&lt;br /&gt;
Current behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; &lt;br /&gt;
        ((@assignment.can_review(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Review&amp;quot;) ||&lt;br /&gt;
         (@assignment.metareview_allowed(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Meta-review&amp;quot;)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. All meta-review tests make meta-reviews allowed only during the meta-review round. This means that if the simple meta-review test is passing then this feature is working as intended.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/50 #50 - The submit button is not available for meta-reviews.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Users should see save and submit buttons as part of the meta-review form. These buttons should have the same behavior as the review form. The problem right now is there is not submit button for meta-reviews.&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were made adding 'Metareview' to the conditional that determines if the submit button should be shown or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review')) %&amp;gt;&lt;br /&gt;
New behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review') || (@title.eql? 'Metareview'))%&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Submit &amp;quot;+@title, :name =&amp;gt; &amp;quot;Submit&amp;quot;, :id =&amp;gt; &amp;quot;Submit&amp;quot; %&amp;gt;&lt;br /&gt;
   &amp;lt;img src=&amp;quot;/assets/info.png&amp;quot; title='- SAVE will only store the peer-review as draft and the peer-review will not be displayed to the reviewee. After clicking SUBMIT, the peer-review will be displayed to reviewee, and you will not be able to update it any more.'&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user is able to SUBMIT a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
==== Context 1: Meta-review tests that have a meta-review deadline with 0 reviewers. ====&lt;br /&gt;
1. User should NOT be able to see 'Request a new meta-review to perform' button when there are no reviews available. When there are reviews that don't belong to the meta-reviewer submitted, meta-reviews can be performed.&lt;br /&gt;
&lt;br /&gt;
==== Context 2: Meta-review tests that have a meta-review deadline with 1 reviewers. ====&lt;br /&gt;
1. User is able to SAVE a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
2. User is able to go BACK during a simple meta-review since this functionality is available for reviews.&lt;br /&gt;
&lt;br /&gt;
3. When the limit and required number of meta-reviews on the assignment are equal, then a student will see they need to submit exactly that number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
4. When there are more meta-reviews allowed than required, then a student will see they need to submit between the two numbers of meta-reviews&lt;br /&gt;
&lt;br /&gt;
5. When the meta-review limits for an assignment are unset then a student will see that the number of meta-reviews aren't limited&lt;br /&gt;
&lt;br /&gt;
6. A student should not see a number of required or allowed meta-reviews when there are no limits on meta-reviews&lt;br /&gt;
&lt;br /&gt;
7. A student should see the number of meta-reviews decrement after a review is requested&lt;br /&gt;
&lt;br /&gt;
8. A student should see the number of meta-reviews decrement after they complete a review&lt;br /&gt;
&lt;br /&gt;
9. A student should not be able to request a meta-review on their own reviews &lt;br /&gt;
&lt;br /&gt;
10. If the meta-review limit on the assignment is set to 1 then a student should not be able to request a second meta review&lt;br /&gt;
&lt;br /&gt;
11. User should not be able to see 'Request a new meta-review to perform' button when they have reviewed all valid reviews already&lt;br /&gt;
&lt;br /&gt;
==== Context 3: Meta-review tests that have a meta-review deadline with 4 reviewers. ====&lt;br /&gt;
1. User should be able to request more than one meta-review before completing any&lt;br /&gt;
&lt;br /&gt;
2. User should not be able to see 'Request a new meta-review to perform' button when they have reached the meta-review limit&lt;br /&gt;
&lt;br /&gt;
3. User should not be able to request more than two meta-reviews without completing at least 1&lt;br /&gt;
&lt;br /&gt;
4. A student should be able to request a meta-review if they are above their required but below their allowed meta-reviews&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_tests_passing.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Coverage===&lt;br /&gt;
Current test coverage is 41.348%. Code coverage will increase based on the test plan above and then if the failing test case described below would be fixed.&lt;br /&gt;
&lt;br /&gt;
Travis CI is currently failing because of:&lt;br /&gt;
  Failures:&lt;br /&gt;
  1) assignment function general tab should edit quiz number available to students&lt;br /&gt;
     Failure/Error:&lt;br /&gt;
       child_nodes.each do |node|&lt;br /&gt;
         initialize_fnode_update_children(params, node, tmp_res)&lt;br /&gt;
       end&lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `each' for &amp;quot;&amp;quot;:String&lt;br /&gt;
     # ./app/controllers/tree_display_controller.rb:209:in `children_node_ng'&lt;br /&gt;
     # ./config/diagnostic.rb:11:in `call'&lt;br /&gt;
     # ------------------&lt;br /&gt;
     # --- Caused by: ---&lt;br /&gt;
     # Capybara::CapybaraError:&lt;br /&gt;
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true&lt;br /&gt;
     #   /home/travis/build/expertiza/expertiza/vendor/bundle/ruby/2.2.0/gems/capybara-2.17.0/lib/capybara/session.rb:145:in `raise_server_error!'&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144320</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144320"/>
		<updated>2022-04-06T17:13:05Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E2025 which was assigned to students last semester, Spring 2020.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[CSC/ECE 517 Spring 2020 - E2025: Issues Related to Meta - Reviewing]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
There was a mistake in &amp;lt;code&amp;gt;app/views/response/_review.html.erb&amp;lt;/code&amp;gt; where &amp;quot;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;hr/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;quot; was being displayed under the review being meta-reviewed. This was due to being included as a string constant rather than html code. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_comments_response_review.PNG]]&lt;br /&gt;
&lt;br /&gt;
There was an instance in &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; where ruby code responsible for getting a review to be displayed was being interpreted and displayed, even though the response was being displayed as html in the line before. This resulted in the response details being listed in the UI erroneously.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_response_view.PNG]]&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/49 #49 - &amp;quot;Request a new meta-review&amp;quot; button crashes when there are no available reviews]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
When there are no valid metareviews to perform (either there are no reivews performed on the assignment, the only valid reviews concern your own work or own reviews, you have completed all allowed metareviews, or you have reviewed all valid reviews already) then the &amp;quot;Request a New Review&amp;quot; button still is visible and displays the following error (correctly) when pressed.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. Log in as instructor6, click on mange...-&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
2. Click on edit assignment, navigate to Due Dates and check &amp;quot;Use meta-review deadline&amp;quot; checkbox&lt;br /&gt;
&lt;br /&gt;
3. Select &amp;quot;Yes&amp;quot; for all submission allowed, Review allowed and Meta-review allowed in all of the deadline types&lt;br /&gt;
&lt;br /&gt;
4. Navigate back to Assignment Tree View and click on &amp;quot;Add participant&amp;quot;&lt;br /&gt;
&lt;br /&gt;
5. Add couple of students(say student1 and student2) to the assignment&lt;br /&gt;
&lt;br /&gt;
6. Impersonate/login as student1 and make a submission&lt;br /&gt;
&lt;br /&gt;
7. Log in as instructor6 as previously described and change the submission due date to be passed so we are currently in the review stage&lt;br /&gt;
&lt;br /&gt;
8. Impersonate/login as student2 and Request for a new review under others work, submit the review&lt;br /&gt;
&lt;br /&gt;
9. Log in as instructor6 as previously described and change the review due date to be passed so we are currently in the meta-review stage&lt;br /&gt;
&lt;br /&gt;
10. Impersonate/login back as student1 (the one with the submission) and Request for a new meta review&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_outofreviews.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we conditionally hide the button based on whether or not the participant has reviews available to perform. These checks are located in assignment.rb which is the model for an Assignment. The following method was added to assignment.rb and returns true when the participant has a valid meta-review available.&lt;br /&gt;
&lt;br /&gt;
  # Returns true if there is a meta-review task available for the user&lt;br /&gt;
  def metareview_available?(user_id)&lt;br /&gt;
    metareviewer = AssignmentParticipant.where(user_id: user_id, parent_id: self.id).first&lt;br /&gt;
    begin&lt;br /&gt;
      self.response_map_to_metareview(metareviewer)&lt;br /&gt;
      true&lt;br /&gt;
    rescue &lt;br /&gt;
      false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/27 #27 - Defaulting Required and Allowed Meta-reviews to NULL in Assignment Database]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
Currently, the number of required and allowed meta-reviews is always being set to 3 in the database. Per the specs of the feature, it should default the database values to NULL. When checkbox &amp;quot;Use meta-review deadline&amp;quot;, in the &amp;quot;Due Dates&amp;quot; tab, is selected then the view should populate required and allowed meta-reviews to 3.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
We created a migration that defaulted the metareviews_allowed and metareviews_required in the Assignment table to nil instead of what the previous team had as 3.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_13.png]]&lt;br /&gt;
&lt;br /&gt;
Since the number of meta-reviews allowed and required are recorded using the values in the text fields, changes were made to &amp;lt;code&amp;gt;app/views/assignment/edit/_review_strategy.html.erb&amp;lt;/code&amp;gt; to set the values and display them as expected.&lt;br /&gt;
&lt;br /&gt;
When the checkbox for setting meta-review limits is unchecked, the values of number of meta-reviews allowed and required should be null. When the checkbox is checked, the values should be set to 3 and 3 by default, or to the values already defined before (in case the assignment was saved with the values set already). On page load, if the checkbox is enabled, then the inputs should be shown with the default or pre-set values, but if the checkbox is disabled then they should be hidden and set to null.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_2.PNG]]&lt;br /&gt;
&lt;br /&gt;
Changes had to be made to &amp;lt;code&amp;gt;app/views/student_review/list.html.erb&amp;lt;/code&amp;gt; to account for the values being &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_3.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
Tests have been created that test if a metareview can have nil limits. In this case, no limit will be shown to the user. Before this change that was impossible&lt;br /&gt;
&lt;br /&gt;
== '''Issue 5 - Meta Review Limit is Not Functioning Correctly in Assignment Creation''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;has meta review limit&amp;quot; should determine whether a limit or requirement is placed on the student to complete meta reviews. If disabled, then they should be able to complete as many as they want. This is independent of the Meta Review STAGE that is enabled/disabled in the due dates tab. They should not impact each other and currently do within the assignment creation.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. If the &amp;quot;Use meta-review deadline&amp;quot; is disabled, then the Meta Review Limit panel disappears&lt;br /&gt;
&lt;br /&gt;
2. &amp;quot;Has meta-review limit?&amp;quot; is hidden on edit&lt;br /&gt;
&lt;br /&gt;
3. Possibility the &amp;quot;Has meta-review limit?&amp;quot; not being saved on assignment creation?&lt;br /&gt;
&lt;br /&gt;
4. If the &amp;quot;Use meta-review deadline&amp;quot; is toggled (disabled, enabled), then the &amp;quot;Has meta-review limit?&amp;quot; resets to disabled&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
&lt;br /&gt;
The code in _due_dates.html.erb and the _review_strategy.html.erb within the /app/app/views/assignments/edit folder is lazily written and does not really adhere to the project specifications of how metareviews should work on assignment creation. These views need to be edited to work correctly and also respond to the changes in issue 5.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
The changes were too long to screenshot, so here is the specific diff section:&lt;br /&gt;
&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-540fd2bd6c34b48213716b1dd713733a&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-80f39fa5f62c73ff8741b02d3b11656c&lt;br /&gt;
&lt;br /&gt;
== '''Discovered Bugs:''' ==&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/45 #45 - &amp;quot;Request a new meta-review&amp;quot; button bugs]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Request new a meta-review&amp;quot; button should be hidden when:&lt;br /&gt;
# The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
# The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
# There are no valid reviews available for the participant.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 0 reviewers. The user should NOT be able to see the 'Request a new meta-review to perform' button when there are no reviews available.&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** A student should NOT be able to request a meta-review on their own review.&lt;br /&gt;
*** When the meta-review limit on the assignment is set to 1 then a student should NOT be able to request a second meta-review.&lt;br /&gt;
*** The user should not be able to see the 'Request a new meta-review to perform' button when they have performed all valid reviews.&lt;br /&gt;
** with 4 reviewers.&lt;br /&gt;
*** The user should be able to click the 'Begin' button and still see the 'Request a new meta-review to perform' button.&lt;br /&gt;
*** The user should NOT be able to see the 'Request a new meta-review to perform' button when they have reached the meta-review limit.&lt;br /&gt;
*** If the user requests two meta-reviews but has not submitted, then they should not be able to request a new meta-review.&lt;br /&gt;
*** The user should be able to request a meta-review if they are above their required but below the allowed number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/30 #30 - “Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of Meta-Reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_completed %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixed behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of meta-reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_total %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is requested.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is completed.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/43 #43 - &amp;quot;Review Allowed&amp;quot; flag is required to be set on a due_date for a user to perform a meta-review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
When an assignment with a meta-review is created the round that meta-reviews will be performed in should have the &amp;quot;Meta-review allowed&amp;quot; option set to yes. This should be the only requirement for making meta-reviews available in that round. The problem with the current implementation is that meta-reviews can only be performed in rounds where the &amp;quot;Review allowed&amp;quot; option is set.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025 Issue43.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were applied to app/views/student_review/_responses.html.erb. Since this partial is shared by both reviews and meta-reviews in list.html.erb the title variable was used to determine if the begin option should be active or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; @assignment.can_review(topic_id) %&amp;gt;&lt;br /&gt;
Current behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; &lt;br /&gt;
        ((@assignment.can_review(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Review&amp;quot;) ||&lt;br /&gt;
         (@assignment.metareview_allowed(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Meta-review&amp;quot;)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. All meta-review tests make meta-reviews allowed only during the meta-review round. This means that if the simple meta-review test is passing then this feature is working as intended.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/50 #50 - The submit button is not available for meta-reviews.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Users should see save and submit buttons as part of the meta-review form. These buttons should have the same behavior as the review form. The problem right now is there is not submit button for meta-reviews.&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were made adding 'Metareview' to the conditional that determines if the submit button should be shown or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review')) %&amp;gt;&lt;br /&gt;
New behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review') || (@title.eql? 'Metareview'))%&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Submit &amp;quot;+@title, :name =&amp;gt; &amp;quot;Submit&amp;quot;, :id =&amp;gt; &amp;quot;Submit&amp;quot; %&amp;gt;&lt;br /&gt;
   &amp;lt;img src=&amp;quot;/assets/info.png&amp;quot; title='- SAVE will only store the peer-review as draft and the peer-review will not be displayed to the reviewee. After clicking SUBMIT, the peer-review will be displayed to reviewee, and you will not be able to update it any more.'&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user is able to SUBMIT a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
==== Context 1: Meta-review tests that have a meta-review deadline with 0 reviewers. ====&lt;br /&gt;
1. User should NOT be able to see 'Request a new meta-review to perform' button when there are no reviews available. When there are reviews that don't belong to the meta-reviewer submitted, meta-reviews can be performed.&lt;br /&gt;
&lt;br /&gt;
==== Context 2: Meta-review tests that have a meta-review deadline with 1 reviewers. ====&lt;br /&gt;
1. User is able to SAVE a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
2. User is able to go BACK during a simple meta-review since this functionality is available for reviews.&lt;br /&gt;
&lt;br /&gt;
3. When the limit and required number of meta-reviews on the assignment are equal, then a student will see they need to submit exactly that number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
4. When there are more meta-reviews allowed than required, then a student will see they need to submit between the two numbers of meta-reviews&lt;br /&gt;
&lt;br /&gt;
5. When the meta-review limits for an assignment are unset then a student will see that the number of meta-reviews aren't limited&lt;br /&gt;
&lt;br /&gt;
6. A student should not see a number of required or allowed meta-reviews when there are no limits on meta-reviews&lt;br /&gt;
&lt;br /&gt;
7. A student should see the number of meta-reviews decrement after a review is requested&lt;br /&gt;
&lt;br /&gt;
8. A student should see the number of meta-reviews decrement after they complete a review&lt;br /&gt;
&lt;br /&gt;
9. A student should not be able to request a meta-review on their own reviews &lt;br /&gt;
&lt;br /&gt;
10. If the meta-review limit on the assignment is set to 1 then a student should not be able to request a second meta review&lt;br /&gt;
&lt;br /&gt;
11. User should not be able to see 'Request a new meta-review to perform' button when they have reviewed all valid reviews already&lt;br /&gt;
&lt;br /&gt;
==== Context 3: Meta-review tests that have a meta-review deadline with 4 reviewers. ====&lt;br /&gt;
1. User should be able to request more than one meta-review before completing any&lt;br /&gt;
&lt;br /&gt;
2. User should not be able to see 'Request a new meta-review to perform' button when they have reached the meta-review limit&lt;br /&gt;
&lt;br /&gt;
3. User should not be able to request more than two meta-reviews without completing at least 1&lt;br /&gt;
&lt;br /&gt;
4. A student should be able to request a meta-review if they are above their required but below their allowed meta-reviews&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_tests_passing.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Coverage===&lt;br /&gt;
Current test coverage is 41.348%. Code coverage will increase based on the test plan above and then if the failing test case described below would be fixed.&lt;br /&gt;
&lt;br /&gt;
Travis CI is currently failing because of:&lt;br /&gt;
  Failures:&lt;br /&gt;
  1) assignment function general tab should edit quiz number available to students&lt;br /&gt;
     Failure/Error:&lt;br /&gt;
       child_nodes.each do |node|&lt;br /&gt;
         initialize_fnode_update_children(params, node, tmp_res)&lt;br /&gt;
       end&lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `each' for &amp;quot;&amp;quot;:String&lt;br /&gt;
     # ./app/controllers/tree_display_controller.rb:209:in `children_node_ng'&lt;br /&gt;
     # ./config/diagnostic.rb:11:in `call'&lt;br /&gt;
     # ------------------&lt;br /&gt;
     # --- Caused by: ---&lt;br /&gt;
     # Capybara::CapybaraError:&lt;br /&gt;
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true&lt;br /&gt;
     #   /home/travis/build/expertiza/expertiza/vendor/bundle/ruby/2.2.0/gems/capybara-2.17.0/lib/capybara/session.rb:145:in `raise_server_error!'&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144319</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144319"/>
		<updated>2022-04-06T17:12:11Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* When a user requests a new meta-review, (s)he is unable to get Begin (refer to above image) link to start a new meta-review. (Issue #198) &lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E1997 which was assigned to students last semester, Fall 2019.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[http://https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1997._Issues_related_to_meta-reviewing E1997]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
There was a mistake in &amp;lt;code&amp;gt;app/views/response/_review.html.erb&amp;lt;/code&amp;gt; where &amp;quot;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;hr/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;quot; was being displayed under the review being meta-reviewed. This was due to being included as a string constant rather than html code. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_comments_response_review.PNG]]&lt;br /&gt;
&lt;br /&gt;
There was an instance in &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; where ruby code responsible for getting a review to be displayed was being interpreted and displayed, even though the response was being displayed as html in the line before. This resulted in the response details being listed in the UI erroneously.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_response_view.PNG]]&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/49 #49 - &amp;quot;Request a new meta-review&amp;quot; button crashes when there are no available reviews]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
When there are no valid metareviews to perform (either there are no reivews performed on the assignment, the only valid reviews concern your own work or own reviews, you have completed all allowed metareviews, or you have reviewed all valid reviews already) then the &amp;quot;Request a New Review&amp;quot; button still is visible and displays the following error (correctly) when pressed.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. Log in as instructor6, click on mange...-&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
2. Click on edit assignment, navigate to Due Dates and check &amp;quot;Use meta-review deadline&amp;quot; checkbox&lt;br /&gt;
&lt;br /&gt;
3. Select &amp;quot;Yes&amp;quot; for all submission allowed, Review allowed and Meta-review allowed in all of the deadline types&lt;br /&gt;
&lt;br /&gt;
4. Navigate back to Assignment Tree View and click on &amp;quot;Add participant&amp;quot;&lt;br /&gt;
&lt;br /&gt;
5. Add couple of students(say student1 and student2) to the assignment&lt;br /&gt;
&lt;br /&gt;
6. Impersonate/login as student1 and make a submission&lt;br /&gt;
&lt;br /&gt;
7. Log in as instructor6 as previously described and change the submission due date to be passed so we are currently in the review stage&lt;br /&gt;
&lt;br /&gt;
8. Impersonate/login as student2 and Request for a new review under others work, submit the review&lt;br /&gt;
&lt;br /&gt;
9. Log in as instructor6 as previously described and change the review due date to be passed so we are currently in the meta-review stage&lt;br /&gt;
&lt;br /&gt;
10. Impersonate/login back as student1 (the one with the submission) and Request for a new meta review&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_outofreviews.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we conditionally hide the button based on whether or not the participant has reviews available to perform. These checks are located in assignment.rb which is the model for an Assignment. The following method was added to assignment.rb and returns true when the participant has a valid meta-review available.&lt;br /&gt;
&lt;br /&gt;
  # Returns true if there is a meta-review task available for the user&lt;br /&gt;
  def metareview_available?(user_id)&lt;br /&gt;
    metareviewer = AssignmentParticipant.where(user_id: user_id, parent_id: self.id).first&lt;br /&gt;
    begin&lt;br /&gt;
      self.response_map_to_metareview(metareviewer)&lt;br /&gt;
      true&lt;br /&gt;
    rescue &lt;br /&gt;
      false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/27 #27 - Defaulting Required and Allowed Meta-reviews to NULL in Assignment Database]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
Currently, the number of required and allowed meta-reviews is always being set to 3 in the database. Per the specs of the feature, it should default the database values to NULL. When checkbox &amp;quot;Use meta-review deadline&amp;quot;, in the &amp;quot;Due Dates&amp;quot; tab, is selected then the view should populate required and allowed meta-reviews to 3.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
We created a migration that defaulted the metareviews_allowed and metareviews_required in the Assignment table to nil instead of what the previous team had as 3.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_13.png]]&lt;br /&gt;
&lt;br /&gt;
Since the number of meta-reviews allowed and required are recorded using the values in the text fields, changes were made to &amp;lt;code&amp;gt;app/views/assignment/edit/_review_strategy.html.erb&amp;lt;/code&amp;gt; to set the values and display them as expected.&lt;br /&gt;
&lt;br /&gt;
When the checkbox for setting meta-review limits is unchecked, the values of number of meta-reviews allowed and required should be null. When the checkbox is checked, the values should be set to 3 and 3 by default, or to the values already defined before (in case the assignment was saved with the values set already). On page load, if the checkbox is enabled, then the inputs should be shown with the default or pre-set values, but if the checkbox is disabled then they should be hidden and set to null.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_2.PNG]]&lt;br /&gt;
&lt;br /&gt;
Changes had to be made to &amp;lt;code&amp;gt;app/views/student_review/list.html.erb&amp;lt;/code&amp;gt; to account for the values being &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_3.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
Tests have been created that test if a metareview can have nil limits. In this case, no limit will be shown to the user. Before this change that was impossible&lt;br /&gt;
&lt;br /&gt;
== '''Issue 5 - Meta Review Limit is Not Functioning Correctly in Assignment Creation''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;has meta review limit&amp;quot; should determine whether a limit or requirement is placed on the student to complete meta reviews. If disabled, then they should be able to complete as many as they want. This is independent of the Meta Review STAGE that is enabled/disabled in the due dates tab. They should not impact each other and currently do within the assignment creation.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. If the &amp;quot;Use meta-review deadline&amp;quot; is disabled, then the Meta Review Limit panel disappears&lt;br /&gt;
&lt;br /&gt;
2. &amp;quot;Has meta-review limit?&amp;quot; is hidden on edit&lt;br /&gt;
&lt;br /&gt;
3. Possibility the &amp;quot;Has meta-review limit?&amp;quot; not being saved on assignment creation?&lt;br /&gt;
&lt;br /&gt;
4. If the &amp;quot;Use meta-review deadline&amp;quot; is toggled (disabled, enabled), then the &amp;quot;Has meta-review limit?&amp;quot; resets to disabled&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
&lt;br /&gt;
The code in _due_dates.html.erb and the _review_strategy.html.erb within the /app/app/views/assignments/edit folder is lazily written and does not really adhere to the project specifications of how metareviews should work on assignment creation. These views need to be edited to work correctly and also respond to the changes in issue 5.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
The changes were too long to screenshot, so here is the specific diff section:&lt;br /&gt;
&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-540fd2bd6c34b48213716b1dd713733a&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-80f39fa5f62c73ff8741b02d3b11656c&lt;br /&gt;
&lt;br /&gt;
== '''Discovered Bugs:''' ==&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/45 #45 - &amp;quot;Request a new meta-review&amp;quot; button bugs]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Request new a meta-review&amp;quot; button should be hidden when:&lt;br /&gt;
# The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
# The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
# There are no valid reviews available for the participant.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 0 reviewers. The user should NOT be able to see the 'Request a new meta-review to perform' button when there are no reviews available.&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** A student should NOT be able to request a meta-review on their own review.&lt;br /&gt;
*** When the meta-review limit on the assignment is set to 1 then a student should NOT be able to request a second meta-review.&lt;br /&gt;
*** The user should not be able to see the 'Request a new meta-review to perform' button when they have performed all valid reviews.&lt;br /&gt;
** with 4 reviewers.&lt;br /&gt;
*** The user should be able to click the 'Begin' button and still see the 'Request a new meta-review to perform' button.&lt;br /&gt;
*** The user should NOT be able to see the 'Request a new meta-review to perform' button when they have reached the meta-review limit.&lt;br /&gt;
*** If the user requests two meta-reviews but has not submitted, then they should not be able to request a new meta-review.&lt;br /&gt;
*** The user should be able to request a meta-review if they are above their required but below the allowed number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/30 #30 - “Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of Meta-Reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_completed %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixed behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of meta-reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_total %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is requested.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is completed.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/43 #43 - &amp;quot;Review Allowed&amp;quot; flag is required to be set on a due_date for a user to perform a meta-review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
When an assignment with a meta-review is created the round that meta-reviews will be performed in should have the &amp;quot;Meta-review allowed&amp;quot; option set to yes. This should be the only requirement for making meta-reviews available in that round. The problem with the current implementation is that meta-reviews can only be performed in rounds where the &amp;quot;Review allowed&amp;quot; option is set.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025 Issue43.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were applied to app/views/student_review/_responses.html.erb. Since this partial is shared by both reviews and meta-reviews in list.html.erb the title variable was used to determine if the begin option should be active or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; @assignment.can_review(topic_id) %&amp;gt;&lt;br /&gt;
Current behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; &lt;br /&gt;
        ((@assignment.can_review(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Review&amp;quot;) ||&lt;br /&gt;
         (@assignment.metareview_allowed(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Meta-review&amp;quot;)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. All meta-review tests make meta-reviews allowed only during the meta-review round. This means that if the simple meta-review test is passing then this feature is working as intended.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/50 #50 - The submit button is not available for meta-reviews.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Users should see save and submit buttons as part of the meta-review form. These buttons should have the same behavior as the review form. The problem right now is there is not submit button for meta-reviews.&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were made adding 'Metareview' to the conditional that determines if the submit button should be shown or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review')) %&amp;gt;&lt;br /&gt;
New behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review') || (@title.eql? 'Metareview'))%&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Submit &amp;quot;+@title, :name =&amp;gt; &amp;quot;Submit&amp;quot;, :id =&amp;gt; &amp;quot;Submit&amp;quot; %&amp;gt;&lt;br /&gt;
   &amp;lt;img src=&amp;quot;/assets/info.png&amp;quot; title='- SAVE will only store the peer-review as draft and the peer-review will not be displayed to the reviewee. After clicking SUBMIT, the peer-review will be displayed to reviewee, and you will not be able to update it any more.'&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user is able to SUBMIT a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
==== Context 1: Meta-review tests that have a meta-review deadline with 0 reviewers. ====&lt;br /&gt;
1. User should NOT be able to see 'Request a new meta-review to perform' button when there are no reviews available. When there are reviews that don't belong to the meta-reviewer submitted, meta-reviews can be performed.&lt;br /&gt;
&lt;br /&gt;
==== Context 2: Meta-review tests that have a meta-review deadline with 1 reviewers. ====&lt;br /&gt;
1. User is able to SAVE a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
2. User is able to go BACK during a simple meta-review since this functionality is available for reviews.&lt;br /&gt;
&lt;br /&gt;
3. When the limit and required number of meta-reviews on the assignment are equal, then a student will see they need to submit exactly that number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
4. When there are more meta-reviews allowed than required, then a student will see they need to submit between the two numbers of meta-reviews&lt;br /&gt;
&lt;br /&gt;
5. When the meta-review limits for an assignment are unset then a student will see that the number of meta-reviews aren't limited&lt;br /&gt;
&lt;br /&gt;
6. A student should not see a number of required or allowed meta-reviews when there are no limits on meta-reviews&lt;br /&gt;
&lt;br /&gt;
7. A student should see the number of meta-reviews decrement after a review is requested&lt;br /&gt;
&lt;br /&gt;
8. A student should see the number of meta-reviews decrement after they complete a review&lt;br /&gt;
&lt;br /&gt;
9. A student should not be able to request a meta-review on their own reviews &lt;br /&gt;
&lt;br /&gt;
10. If the meta-review limit on the assignment is set to 1 then a student should not be able to request a second meta review&lt;br /&gt;
&lt;br /&gt;
11. User should not be able to see 'Request a new meta-review to perform' button when they have reviewed all valid reviews already&lt;br /&gt;
&lt;br /&gt;
==== Context 3: Meta-review tests that have a meta-review deadline with 4 reviewers. ====&lt;br /&gt;
1. User should be able to request more than one meta-review before completing any&lt;br /&gt;
&lt;br /&gt;
2. User should not be able to see 'Request a new meta-review to perform' button when they have reached the meta-review limit&lt;br /&gt;
&lt;br /&gt;
3. User should not be able to request more than two meta-reviews without completing at least 1&lt;br /&gt;
&lt;br /&gt;
4. A student should be able to request a meta-review if they are above their required but below their allowed meta-reviews&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_tests_passing.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Coverage===&lt;br /&gt;
Current test coverage is 41.348%. Code coverage will increase based on the test plan above and then if the failing test case described below would be fixed.&lt;br /&gt;
&lt;br /&gt;
Travis CI is currently failing because of:&lt;br /&gt;
  Failures:&lt;br /&gt;
  1) assignment function general tab should edit quiz number available to students&lt;br /&gt;
     Failure/Error:&lt;br /&gt;
       child_nodes.each do |node|&lt;br /&gt;
         initialize_fnode_update_children(params, node, tmp_res)&lt;br /&gt;
       end&lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `each' for &amp;quot;&amp;quot;:String&lt;br /&gt;
     # ./app/controllers/tree_display_controller.rb:209:in `children_node_ng'&lt;br /&gt;
     # ./config/diagnostic.rb:11:in `call'&lt;br /&gt;
     # ------------------&lt;br /&gt;
     # --- Caused by: ---&lt;br /&gt;
     # Capybara::CapybaraError:&lt;br /&gt;
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true&lt;br /&gt;
     #   /home/travis/build/expertiza/expertiza/vendor/bundle/ruby/2.2.0/gems/capybara-2.17.0/lib/capybara/session.rb:145:in `raise_server_error!'&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2235._Issues_related_to_meta-reviewing&amp;diff=144317</id>
		<title>E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2235._Issues_related_to_meta-reviewing&amp;diff=144317"/>
		<updated>2022-04-06T17:10:33Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page E2235. Issues related to meta-reviewing to CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing]]&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144316</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144316"/>
		<updated>2022-04-06T17:10:33Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page E2235. Issues related to meta-reviewing to CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* An assignment is deemed to have meta-reviews if and only if there is a meta-review deadline for this assignment in the `assignments_questionnaires` table.&lt;br /&gt;
* If there is no meta-review deadline, then don’t show the question about whether there is a max meta-review limit.&lt;br /&gt;
* In the DB the default number of meta-reviews allowed and required should be null.&lt;br /&gt;
* As soon as someone checks the Has meta-review Limit box on the Review Strategy tab, the UI should fill in 3 and 3 as the required and allowed number.&lt;br /&gt;
* Student pages should show the list of reviews that have been performed.&lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E1997 which was assigned to students last semester, Fall 2019.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[http://https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1997._Issues_related_to_meta-reviewing E1997]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
There was a mistake in &amp;lt;code&amp;gt;app/views/response/_review.html.erb&amp;lt;/code&amp;gt; where &amp;quot;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;hr/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;quot; was being displayed under the review being meta-reviewed. This was due to being included as a string constant rather than html code. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_comments_response_review.PNG]]&lt;br /&gt;
&lt;br /&gt;
There was an instance in &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; where ruby code responsible for getting a review to be displayed was being interpreted and displayed, even though the response was being displayed as html in the line before. This resulted in the response details being listed in the UI erroneously.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_response_view.PNG]]&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/49 #49 - &amp;quot;Request a new meta-review&amp;quot; button crashes when there are no available reviews]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
When there are no valid metareviews to perform (either there are no reivews performed on the assignment, the only valid reviews concern your own work or own reviews, you have completed all allowed metareviews, or you have reviewed all valid reviews already) then the &amp;quot;Request a New Review&amp;quot; button still is visible and displays the following error (correctly) when pressed.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. Log in as instructor6, click on mange...-&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
2. Click on edit assignment, navigate to Due Dates and check &amp;quot;Use meta-review deadline&amp;quot; checkbox&lt;br /&gt;
&lt;br /&gt;
3. Select &amp;quot;Yes&amp;quot; for all submission allowed, Review allowed and Meta-review allowed in all of the deadline types&lt;br /&gt;
&lt;br /&gt;
4. Navigate back to Assignment Tree View and click on &amp;quot;Add participant&amp;quot;&lt;br /&gt;
&lt;br /&gt;
5. Add couple of students(say student1 and student2) to the assignment&lt;br /&gt;
&lt;br /&gt;
6. Impersonate/login as student1 and make a submission&lt;br /&gt;
&lt;br /&gt;
7. Log in as instructor6 as previously described and change the submission due date to be passed so we are currently in the review stage&lt;br /&gt;
&lt;br /&gt;
8. Impersonate/login as student2 and Request for a new review under others work, submit the review&lt;br /&gt;
&lt;br /&gt;
9. Log in as instructor6 as previously described and change the review due date to be passed so we are currently in the meta-review stage&lt;br /&gt;
&lt;br /&gt;
10. Impersonate/login back as student1 (the one with the submission) and Request for a new meta review&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_outofreviews.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we conditionally hide the button based on whether or not the participant has reviews available to perform. These checks are located in assignment.rb which is the model for an Assignment. The following method was added to assignment.rb and returns true when the participant has a valid meta-review available.&lt;br /&gt;
&lt;br /&gt;
  # Returns true if there is a meta-review task available for the user&lt;br /&gt;
  def metareview_available?(user_id)&lt;br /&gt;
    metareviewer = AssignmentParticipant.where(user_id: user_id, parent_id: self.id).first&lt;br /&gt;
    begin&lt;br /&gt;
      self.response_map_to_metareview(metareviewer)&lt;br /&gt;
      true&lt;br /&gt;
    rescue &lt;br /&gt;
      false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/27 #27 - Defaulting Required and Allowed Meta-reviews to NULL in Assignment Database]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
Currently, the number of required and allowed meta-reviews is always being set to 3 in the database. Per the specs of the feature, it should default the database values to NULL. When checkbox &amp;quot;Use meta-review deadline&amp;quot;, in the &amp;quot;Due Dates&amp;quot; tab, is selected then the view should populate required and allowed meta-reviews to 3.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
We created a migration that defaulted the metareviews_allowed and metareviews_required in the Assignment table to nil instead of what the previous team had as 3.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_13.png]]&lt;br /&gt;
&lt;br /&gt;
Since the number of meta-reviews allowed and required are recorded using the values in the text fields, changes were made to &amp;lt;code&amp;gt;app/views/assignment/edit/_review_strategy.html.erb&amp;lt;/code&amp;gt; to set the values and display them as expected.&lt;br /&gt;
&lt;br /&gt;
When the checkbox for setting meta-review limits is unchecked, the values of number of meta-reviews allowed and required should be null. When the checkbox is checked, the values should be set to 3 and 3 by default, or to the values already defined before (in case the assignment was saved with the values set already). On page load, if the checkbox is enabled, then the inputs should be shown with the default or pre-set values, but if the checkbox is disabled then they should be hidden and set to null.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_2.PNG]]&lt;br /&gt;
&lt;br /&gt;
Changes had to be made to &amp;lt;code&amp;gt;app/views/student_review/list.html.erb&amp;lt;/code&amp;gt; to account for the values being &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_3.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
Tests have been created that test if a metareview can have nil limits. In this case, no limit will be shown to the user. Before this change that was impossible&lt;br /&gt;
&lt;br /&gt;
== '''Issue 5 - Meta Review Limit is Not Functioning Correctly in Assignment Creation''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;has meta review limit&amp;quot; should determine whether a limit or requirement is placed on the student to complete meta reviews. If disabled, then they should be able to complete as many as they want. This is independent of the Meta Review STAGE that is enabled/disabled in the due dates tab. They should not impact each other and currently do within the assignment creation.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. If the &amp;quot;Use meta-review deadline&amp;quot; is disabled, then the Meta Review Limit panel disappears&lt;br /&gt;
&lt;br /&gt;
2. &amp;quot;Has meta-review limit?&amp;quot; is hidden on edit&lt;br /&gt;
&lt;br /&gt;
3. Possibility the &amp;quot;Has meta-review limit?&amp;quot; not being saved on assignment creation?&lt;br /&gt;
&lt;br /&gt;
4. If the &amp;quot;Use meta-review deadline&amp;quot; is toggled (disabled, enabled), then the &amp;quot;Has meta-review limit?&amp;quot; resets to disabled&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
&lt;br /&gt;
The code in _due_dates.html.erb and the _review_strategy.html.erb within the /app/app/views/assignments/edit folder is lazily written and does not really adhere to the project specifications of how metareviews should work on assignment creation. These views need to be edited to work correctly and also respond to the changes in issue 5.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
The changes were too long to screenshot, so here is the specific diff section:&lt;br /&gt;
&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-540fd2bd6c34b48213716b1dd713733a&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-80f39fa5f62c73ff8741b02d3b11656c&lt;br /&gt;
&lt;br /&gt;
== '''Discovered Bugs:''' ==&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/45 #45 - &amp;quot;Request a new meta-review&amp;quot; button bugs]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Request new a meta-review&amp;quot; button should be hidden when:&lt;br /&gt;
# The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
# The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
# There are no valid reviews available for the participant.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 0 reviewers. The user should NOT be able to see the 'Request a new meta-review to perform' button when there are no reviews available.&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** A student should NOT be able to request a meta-review on their own review.&lt;br /&gt;
*** When the meta-review limit on the assignment is set to 1 then a student should NOT be able to request a second meta-review.&lt;br /&gt;
*** The user should not be able to see the 'Request a new meta-review to perform' button when they have performed all valid reviews.&lt;br /&gt;
** with 4 reviewers.&lt;br /&gt;
*** The user should be able to click the 'Begin' button and still see the 'Request a new meta-review to perform' button.&lt;br /&gt;
*** The user should NOT be able to see the 'Request a new meta-review to perform' button when they have reached the meta-review limit.&lt;br /&gt;
*** If the user requests two meta-reviews but has not submitted, then they should not be able to request a new meta-review.&lt;br /&gt;
*** The user should be able to request a meta-review if they are above their required but below the allowed number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/30 #30 - “Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of Meta-Reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_completed %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixed behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of meta-reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_total %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is requested.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is completed.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/43 #43 - &amp;quot;Review Allowed&amp;quot; flag is required to be set on a due_date for a user to perform a meta-review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
When an assignment with a meta-review is created the round that meta-reviews will be performed in should have the &amp;quot;Meta-review allowed&amp;quot; option set to yes. This should be the only requirement for making meta-reviews available in that round. The problem with the current implementation is that meta-reviews can only be performed in rounds where the &amp;quot;Review allowed&amp;quot; option is set.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025 Issue43.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were applied to app/views/student_review/_responses.html.erb. Since this partial is shared by both reviews and meta-reviews in list.html.erb the title variable was used to determine if the begin option should be active or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; @assignment.can_review(topic_id) %&amp;gt;&lt;br /&gt;
Current behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; &lt;br /&gt;
        ((@assignment.can_review(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Review&amp;quot;) ||&lt;br /&gt;
         (@assignment.metareview_allowed(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Meta-review&amp;quot;)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. All meta-review tests make meta-reviews allowed only during the meta-review round. This means that if the simple meta-review test is passing then this feature is working as intended.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/50 #50 - The submit button is not available for meta-reviews.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Users should see save and submit buttons as part of the meta-review form. These buttons should have the same behavior as the review form. The problem right now is there is not submit button for meta-reviews.&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were made adding 'Metareview' to the conditional that determines if the submit button should be shown or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review')) %&amp;gt;&lt;br /&gt;
New behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review') || (@title.eql? 'Metareview'))%&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Submit &amp;quot;+@title, :name =&amp;gt; &amp;quot;Submit&amp;quot;, :id =&amp;gt; &amp;quot;Submit&amp;quot; %&amp;gt;&lt;br /&gt;
   &amp;lt;img src=&amp;quot;/assets/info.png&amp;quot; title='- SAVE will only store the peer-review as draft and the peer-review will not be displayed to the reviewee. After clicking SUBMIT, the peer-review will be displayed to reviewee, and you will not be able to update it any more.'&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user is able to SUBMIT a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
==== Context 1: Meta-review tests that have a meta-review deadline with 0 reviewers. ====&lt;br /&gt;
1. User should NOT be able to see 'Request a new meta-review to perform' button when there are no reviews available. When there are reviews that don't belong to the meta-reviewer submitted, meta-reviews can be performed.&lt;br /&gt;
&lt;br /&gt;
==== Context 2: Meta-review tests that have a meta-review deadline with 1 reviewers. ====&lt;br /&gt;
1. User is able to SAVE a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
2. User is able to go BACK during a simple meta-review since this functionality is available for reviews.&lt;br /&gt;
&lt;br /&gt;
3. When the limit and required number of meta-reviews on the assignment are equal, then a student will see they need to submit exactly that number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
4. When there are more meta-reviews allowed than required, then a student will see they need to submit between the two numbers of meta-reviews&lt;br /&gt;
&lt;br /&gt;
5. When the meta-review limits for an assignment are unset then a student will see that the number of meta-reviews aren't limited&lt;br /&gt;
&lt;br /&gt;
6. A student should not see a number of required or allowed meta-reviews when there are no limits on meta-reviews&lt;br /&gt;
&lt;br /&gt;
7. A student should see the number of meta-reviews decrement after a review is requested&lt;br /&gt;
&lt;br /&gt;
8. A student should see the number of meta-reviews decrement after they complete a review&lt;br /&gt;
&lt;br /&gt;
9. A student should not be able to request a meta-review on their own reviews &lt;br /&gt;
&lt;br /&gt;
10. If the meta-review limit on the assignment is set to 1 then a student should not be able to request a second meta review&lt;br /&gt;
&lt;br /&gt;
11. User should not be able to see 'Request a new meta-review to perform' button when they have reviewed all valid reviews already&lt;br /&gt;
&lt;br /&gt;
==== Context 3: Meta-review tests that have a meta-review deadline with 4 reviewers. ====&lt;br /&gt;
1. User should be able to request more than one meta-review before completing any&lt;br /&gt;
&lt;br /&gt;
2. User should not be able to see 'Request a new meta-review to perform' button when they have reached the meta-review limit&lt;br /&gt;
&lt;br /&gt;
3. User should not be able to request more than two meta-reviews without completing at least 1&lt;br /&gt;
&lt;br /&gt;
4. A student should be able to request a meta-review if they are above their required but below their allowed meta-reviews&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_tests_passing.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Coverage===&lt;br /&gt;
Current test coverage is 41.348%. Code coverage will increase based on the test plan above and then if the failing test case described below would be fixed.&lt;br /&gt;
&lt;br /&gt;
Travis CI is currently failing because of:&lt;br /&gt;
  Failures:&lt;br /&gt;
  1) assignment function general tab should edit quiz number available to students&lt;br /&gt;
     Failure/Error:&lt;br /&gt;
       child_nodes.each do |node|&lt;br /&gt;
         initialize_fnode_update_children(params, node, tmp_res)&lt;br /&gt;
       end&lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `each' for &amp;quot;&amp;quot;:String&lt;br /&gt;
     # ./app/controllers/tree_display_controller.rb:209:in `children_node_ng'&lt;br /&gt;
     # ./config/diagnostic.rb:11:in `call'&lt;br /&gt;
     # ------------------&lt;br /&gt;
     # --- Caused by: ---&lt;br /&gt;
     # Capybara::CapybaraError:&lt;br /&gt;
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true&lt;br /&gt;
     #   /home/travis/build/expertiza/expertiza/vendor/bundle/ruby/2.2.0/gems/capybara-2.17.0/lib/capybara/session.rb:145:in `raise_server_error!'&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=144315</id>
		<title>CSC/ECE 517 Spring 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=144315"/>
		<updated>2022-04-06T17:09:56Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2200: Testing advice_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2203: Adding tests for courses_controller, eula_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2204: Adding tests for markup_styles_controller, lock_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2208: Testing for submission_records_controller, profile_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2218: Refactor response_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2216: Refactor late_policies_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2215: Refactor student_quizzes_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2214: Refactor teams_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2219: Improve assessment360_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2211: Testing for summary_helper]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2225: Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2221: Refactor submitted content controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2206: Testing for users_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2207: Testing for submitted_content_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2205: Testing for participants_controller, versions_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2212: Testing for hamer.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2200: Refactoring evaluation of SQL queries (Java/JUnit)]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2222: Refactor impersonate_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2202- Testing for badges_controller, publishing_controller]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2022 - E2220: Refactor reputation_web_service_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2224: Refactor review_mapping_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2209: Testing for analytic helper.rb, join team requests helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2227: SQL Injection Fix]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2201: Testing for assignment_questionnaire_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2243. Refactor student_teams functionality]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2245: View for results of bidding]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2201: Improving User Experience for SQLFE]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2236: Fix issues related to deadlines and late policies]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2231: Allow reviewers to bid on what to review]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2234. Calibration submissions should be copied along with calibration assignments]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2244. Support for saying your team pair-programmed]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2246: Email your authors/reviewers, with complete tests]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2229: Track the time students look at other submissions]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb ]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality ]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2242. Fix teammate-review view ]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing]]&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_Wiki:Pgarg5&amp;diff=144314</id>
		<title>Expertiza Wiki:Pgarg5</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_Wiki:Pgarg5&amp;diff=144314"/>
		<updated>2022-04-06T17:08:41Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page PG Wiki:Pgarg5 to E2235. Issues related to meta-reviewing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[E2235. Issues related to meta-reviewing]]&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144313</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144313"/>
		<updated>2022-04-06T17:08:41Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page PG Wiki:Pgarg5 to E2235. Issues related to meta-reviewing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* An assignment is deemed to have meta-reviews if and only if there is a meta-review deadline for this assignment in the `assignments_questionnaires` table.&lt;br /&gt;
* If there is no meta-review deadline, then don’t show the question about whether there is a max meta-review limit.&lt;br /&gt;
* In the DB the default number of meta-reviews allowed and required should be null.&lt;br /&gt;
* As soon as someone checks the Has meta-review Limit box on the Review Strategy tab, the UI should fill in 3 and 3 as the required and allowed number.&lt;br /&gt;
* Student pages should show the list of reviews that have been performed.&lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E1997 which was assigned to students last semester, Fall 2019.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[http://https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1997._Issues_related_to_meta-reviewing E1997]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
There was a mistake in &amp;lt;code&amp;gt;app/views/response/_review.html.erb&amp;lt;/code&amp;gt; where &amp;quot;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;hr/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;quot; was being displayed under the review being meta-reviewed. This was due to being included as a string constant rather than html code. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_comments_response_review.PNG]]&lt;br /&gt;
&lt;br /&gt;
There was an instance in &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; where ruby code responsible for getting a review to be displayed was being interpreted and displayed, even though the response was being displayed as html in the line before. This resulted in the response details being listed in the UI erroneously.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_response_view.PNG]]&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/49 #49 - &amp;quot;Request a new meta-review&amp;quot; button crashes when there are no available reviews]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
When there are no valid metareviews to perform (either there are no reivews performed on the assignment, the only valid reviews concern your own work or own reviews, you have completed all allowed metareviews, or you have reviewed all valid reviews already) then the &amp;quot;Request a New Review&amp;quot; button still is visible and displays the following error (correctly) when pressed.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. Log in as instructor6, click on mange...-&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
2. Click on edit assignment, navigate to Due Dates and check &amp;quot;Use meta-review deadline&amp;quot; checkbox&lt;br /&gt;
&lt;br /&gt;
3. Select &amp;quot;Yes&amp;quot; for all submission allowed, Review allowed and Meta-review allowed in all of the deadline types&lt;br /&gt;
&lt;br /&gt;
4. Navigate back to Assignment Tree View and click on &amp;quot;Add participant&amp;quot;&lt;br /&gt;
&lt;br /&gt;
5. Add couple of students(say student1 and student2) to the assignment&lt;br /&gt;
&lt;br /&gt;
6. Impersonate/login as student1 and make a submission&lt;br /&gt;
&lt;br /&gt;
7. Log in as instructor6 as previously described and change the submission due date to be passed so we are currently in the review stage&lt;br /&gt;
&lt;br /&gt;
8. Impersonate/login as student2 and Request for a new review under others work, submit the review&lt;br /&gt;
&lt;br /&gt;
9. Log in as instructor6 as previously described and change the review due date to be passed so we are currently in the meta-review stage&lt;br /&gt;
&lt;br /&gt;
10. Impersonate/login back as student1 (the one with the submission) and Request for a new meta review&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_outofreviews.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we conditionally hide the button based on whether or not the participant has reviews available to perform. These checks are located in assignment.rb which is the model for an Assignment. The following method was added to assignment.rb and returns true when the participant has a valid meta-review available.&lt;br /&gt;
&lt;br /&gt;
  # Returns true if there is a meta-review task available for the user&lt;br /&gt;
  def metareview_available?(user_id)&lt;br /&gt;
    metareviewer = AssignmentParticipant.where(user_id: user_id, parent_id: self.id).first&lt;br /&gt;
    begin&lt;br /&gt;
      self.response_map_to_metareview(metareviewer)&lt;br /&gt;
      true&lt;br /&gt;
    rescue &lt;br /&gt;
      false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/27 #27 - Defaulting Required and Allowed Meta-reviews to NULL in Assignment Database]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
Currently, the number of required and allowed meta-reviews is always being set to 3 in the database. Per the specs of the feature, it should default the database values to NULL. When checkbox &amp;quot;Use meta-review deadline&amp;quot;, in the &amp;quot;Due Dates&amp;quot; tab, is selected then the view should populate required and allowed meta-reviews to 3.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
We created a migration that defaulted the metareviews_allowed and metareviews_required in the Assignment table to nil instead of what the previous team had as 3.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_13.png]]&lt;br /&gt;
&lt;br /&gt;
Since the number of meta-reviews allowed and required are recorded using the values in the text fields, changes were made to &amp;lt;code&amp;gt;app/views/assignment/edit/_review_strategy.html.erb&amp;lt;/code&amp;gt; to set the values and display them as expected.&lt;br /&gt;
&lt;br /&gt;
When the checkbox for setting meta-review limits is unchecked, the values of number of meta-reviews allowed and required should be null. When the checkbox is checked, the values should be set to 3 and 3 by default, or to the values already defined before (in case the assignment was saved with the values set already). On page load, if the checkbox is enabled, then the inputs should be shown with the default or pre-set values, but if the checkbox is disabled then they should be hidden and set to null.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_2.PNG]]&lt;br /&gt;
&lt;br /&gt;
Changes had to be made to &amp;lt;code&amp;gt;app/views/student_review/list.html.erb&amp;lt;/code&amp;gt; to account for the values being &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_3.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
Tests have been created that test if a metareview can have nil limits. In this case, no limit will be shown to the user. Before this change that was impossible&lt;br /&gt;
&lt;br /&gt;
== '''Issue 5 - Meta Review Limit is Not Functioning Correctly in Assignment Creation''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;has meta review limit&amp;quot; should determine whether a limit or requirement is placed on the student to complete meta reviews. If disabled, then they should be able to complete as many as they want. This is independent of the Meta Review STAGE that is enabled/disabled in the due dates tab. They should not impact each other and currently do within the assignment creation.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. If the &amp;quot;Use meta-review deadline&amp;quot; is disabled, then the Meta Review Limit panel disappears&lt;br /&gt;
&lt;br /&gt;
2. &amp;quot;Has meta-review limit?&amp;quot; is hidden on edit&lt;br /&gt;
&lt;br /&gt;
3. Possibility the &amp;quot;Has meta-review limit?&amp;quot; not being saved on assignment creation?&lt;br /&gt;
&lt;br /&gt;
4. If the &amp;quot;Use meta-review deadline&amp;quot; is toggled (disabled, enabled), then the &amp;quot;Has meta-review limit?&amp;quot; resets to disabled&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
&lt;br /&gt;
The code in _due_dates.html.erb and the _review_strategy.html.erb within the /app/app/views/assignments/edit folder is lazily written and does not really adhere to the project specifications of how metareviews should work on assignment creation. These views need to be edited to work correctly and also respond to the changes in issue 5.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
The changes were too long to screenshot, so here is the specific diff section:&lt;br /&gt;
&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-540fd2bd6c34b48213716b1dd713733a&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-80f39fa5f62c73ff8741b02d3b11656c&lt;br /&gt;
&lt;br /&gt;
== '''Discovered Bugs:''' ==&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/45 #45 - &amp;quot;Request a new meta-review&amp;quot; button bugs]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Request new a meta-review&amp;quot; button should be hidden when:&lt;br /&gt;
# The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
# The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
# There are no valid reviews available for the participant.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 0 reviewers. The user should NOT be able to see the 'Request a new meta-review to perform' button when there are no reviews available.&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** A student should NOT be able to request a meta-review on their own review.&lt;br /&gt;
*** When the meta-review limit on the assignment is set to 1 then a student should NOT be able to request a second meta-review.&lt;br /&gt;
*** The user should not be able to see the 'Request a new meta-review to perform' button when they have performed all valid reviews.&lt;br /&gt;
** with 4 reviewers.&lt;br /&gt;
*** The user should be able to click the 'Begin' button and still see the 'Request a new meta-review to perform' button.&lt;br /&gt;
*** The user should NOT be able to see the 'Request a new meta-review to perform' button when they have reached the meta-review limit.&lt;br /&gt;
*** If the user requests two meta-reviews but has not submitted, then they should not be able to request a new meta-review.&lt;br /&gt;
*** The user should be able to request a meta-review if they are above their required but below the allowed number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/30 #30 - “Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of Meta-Reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_completed %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixed behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of meta-reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_total %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is requested.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is completed.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/43 #43 - &amp;quot;Review Allowed&amp;quot; flag is required to be set on a due_date for a user to perform a meta-review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
When an assignment with a meta-review is created the round that meta-reviews will be performed in should have the &amp;quot;Meta-review allowed&amp;quot; option set to yes. This should be the only requirement for making meta-reviews available in that round. The problem with the current implementation is that meta-reviews can only be performed in rounds where the &amp;quot;Review allowed&amp;quot; option is set.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025 Issue43.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were applied to app/views/student_review/_responses.html.erb. Since this partial is shared by both reviews and meta-reviews in list.html.erb the title variable was used to determine if the begin option should be active or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; @assignment.can_review(topic_id) %&amp;gt;&lt;br /&gt;
Current behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; &lt;br /&gt;
        ((@assignment.can_review(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Review&amp;quot;) ||&lt;br /&gt;
         (@assignment.metareview_allowed(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Meta-review&amp;quot;)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. All meta-review tests make meta-reviews allowed only during the meta-review round. This means that if the simple meta-review test is passing then this feature is working as intended.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/50 #50 - The submit button is not available for meta-reviews.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Users should see save and submit buttons as part of the meta-review form. These buttons should have the same behavior as the review form. The problem right now is there is not submit button for meta-reviews.&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were made adding 'Metareview' to the conditional that determines if the submit button should be shown or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review')) %&amp;gt;&lt;br /&gt;
New behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review') || (@title.eql? 'Metareview'))%&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Submit &amp;quot;+@title, :name =&amp;gt; &amp;quot;Submit&amp;quot;, :id =&amp;gt; &amp;quot;Submit&amp;quot; %&amp;gt;&lt;br /&gt;
   &amp;lt;img src=&amp;quot;/assets/info.png&amp;quot; title='- SAVE will only store the peer-review as draft and the peer-review will not be displayed to the reviewee. After clicking SUBMIT, the peer-review will be displayed to reviewee, and you will not be able to update it any more.'&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user is able to SUBMIT a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
==== Context 1: Meta-review tests that have a meta-review deadline with 0 reviewers. ====&lt;br /&gt;
1. User should NOT be able to see 'Request a new meta-review to perform' button when there are no reviews available. When there are reviews that don't belong to the meta-reviewer submitted, meta-reviews can be performed.&lt;br /&gt;
&lt;br /&gt;
==== Context 2: Meta-review tests that have a meta-review deadline with 1 reviewers. ====&lt;br /&gt;
1. User is able to SAVE a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
2. User is able to go BACK during a simple meta-review since this functionality is available for reviews.&lt;br /&gt;
&lt;br /&gt;
3. When the limit and required number of meta-reviews on the assignment are equal, then a student will see they need to submit exactly that number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
4. When there are more meta-reviews allowed than required, then a student will see they need to submit between the two numbers of meta-reviews&lt;br /&gt;
&lt;br /&gt;
5. When the meta-review limits for an assignment are unset then a student will see that the number of meta-reviews aren't limited&lt;br /&gt;
&lt;br /&gt;
6. A student should not see a number of required or allowed meta-reviews when there are no limits on meta-reviews&lt;br /&gt;
&lt;br /&gt;
7. A student should see the number of meta-reviews decrement after a review is requested&lt;br /&gt;
&lt;br /&gt;
8. A student should see the number of meta-reviews decrement after they complete a review&lt;br /&gt;
&lt;br /&gt;
9. A student should not be able to request a meta-review on their own reviews &lt;br /&gt;
&lt;br /&gt;
10. If the meta-review limit on the assignment is set to 1 then a student should not be able to request a second meta review&lt;br /&gt;
&lt;br /&gt;
11. User should not be able to see 'Request a new meta-review to perform' button when they have reviewed all valid reviews already&lt;br /&gt;
&lt;br /&gt;
==== Context 3: Meta-review tests that have a meta-review deadline with 4 reviewers. ====&lt;br /&gt;
1. User should be able to request more than one meta-review before completing any&lt;br /&gt;
&lt;br /&gt;
2. User should not be able to see 'Request a new meta-review to perform' button when they have reached the meta-review limit&lt;br /&gt;
&lt;br /&gt;
3. User should not be able to request more than two meta-reviews without completing at least 1&lt;br /&gt;
&lt;br /&gt;
4. A student should be able to request a meta-review if they are above their required but below their allowed meta-reviews&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_tests_passing.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Coverage===&lt;br /&gt;
Current test coverage is 41.348%. Code coverage will increase based on the test plan above and then if the failing test case described below would be fixed.&lt;br /&gt;
&lt;br /&gt;
Travis CI is currently failing because of:&lt;br /&gt;
  Failures:&lt;br /&gt;
  1) assignment function general tab should edit quiz number available to students&lt;br /&gt;
     Failure/Error:&lt;br /&gt;
       child_nodes.each do |node|&lt;br /&gt;
         initialize_fnode_update_children(params, node, tmp_res)&lt;br /&gt;
       end&lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `each' for &amp;quot;&amp;quot;:String&lt;br /&gt;
     # ./app/controllers/tree_display_controller.rb:209:in `children_node_ng'&lt;br /&gt;
     # ./config/diagnostic.rb:11:in `call'&lt;br /&gt;
     # ------------------&lt;br /&gt;
     # --- Caused by: ---&lt;br /&gt;
     # Capybara::CapybaraError:&lt;br /&gt;
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true&lt;br /&gt;
     #   /home/travis/build/expertiza/expertiza/vendor/bundle/ruby/2.2.0/gems/capybara-2.17.0/lib/capybara/session.rb:145:in `raise_server_error!'&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Pgarg5&amp;diff=144312</id>
		<title>User talk:Pgarg5</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Pgarg5&amp;diff=144312"/>
		<updated>2022-04-06T17:03:58Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page User talk:Pgarg5 to PG Wiki:E2235. Issues related to meta-reviewing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[PG Wiki:E2235. Issues related to meta-reviewing]]&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_Wiki:E2235._Issues_related_to_meta-reviewing&amp;diff=144311</id>
		<title>Expertiza Wiki:E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_Wiki:E2235._Issues_related_to_meta-reviewing&amp;diff=144311"/>
		<updated>2022-04-06T17:03:58Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page User talk:Pgarg5 to PG Wiki:E2235. Issues related to meta-reviewing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[PG Wiki:Pgarg5]]&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_Wiki:E2235._Issues_related_to_meta-reviewing&amp;diff=144310</id>
		<title>Expertiza Wiki:E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_Wiki:E2235._Issues_related_to_meta-reviewing&amp;diff=144310"/>
		<updated>2022-04-06T17:03:48Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page User talk:Pgarg5 to PG Wiki:Pgarg5&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[PG Wiki:Pgarg5]]&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144309</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144309"/>
		<updated>2022-04-06T17:03:47Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page User talk:Pgarg5 to PG Wiki:Pgarg5&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* An assignment is deemed to have meta-reviews if and only if there is a meta-review deadline for this assignment in the `assignments_questionnaires` table.&lt;br /&gt;
* If there is no meta-review deadline, then don’t show the question about whether there is a max meta-review limit.&lt;br /&gt;
* In the DB the default number of meta-reviews allowed and required should be null.&lt;br /&gt;
* As soon as someone checks the Has meta-review Limit box on the Review Strategy tab, the UI should fill in 3 and 3 as the required and allowed number.&lt;br /&gt;
* Student pages should show the list of reviews that have been performed.&lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E1997 which was assigned to students last semester, Fall 2019.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[http://https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1997._Issues_related_to_meta-reviewing E1997]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
There was a mistake in &amp;lt;code&amp;gt;app/views/response/_review.html.erb&amp;lt;/code&amp;gt; where &amp;quot;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;hr/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;quot; was being displayed under the review being meta-reviewed. This was due to being included as a string constant rather than html code. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_comments_response_review.PNG]]&lt;br /&gt;
&lt;br /&gt;
There was an instance in &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; where ruby code responsible for getting a review to be displayed was being interpreted and displayed, even though the response was being displayed as html in the line before. This resulted in the response details being listed in the UI erroneously.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_response_view.PNG]]&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/49 #49 - &amp;quot;Request a new meta-review&amp;quot; button crashes when there are no available reviews]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
When there are no valid metareviews to perform (either there are no reivews performed on the assignment, the only valid reviews concern your own work or own reviews, you have completed all allowed metareviews, or you have reviewed all valid reviews already) then the &amp;quot;Request a New Review&amp;quot; button still is visible and displays the following error (correctly) when pressed.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. Log in as instructor6, click on mange...-&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
2. Click on edit assignment, navigate to Due Dates and check &amp;quot;Use meta-review deadline&amp;quot; checkbox&lt;br /&gt;
&lt;br /&gt;
3. Select &amp;quot;Yes&amp;quot; for all submission allowed, Review allowed and Meta-review allowed in all of the deadline types&lt;br /&gt;
&lt;br /&gt;
4. Navigate back to Assignment Tree View and click on &amp;quot;Add participant&amp;quot;&lt;br /&gt;
&lt;br /&gt;
5. Add couple of students(say student1 and student2) to the assignment&lt;br /&gt;
&lt;br /&gt;
6. Impersonate/login as student1 and make a submission&lt;br /&gt;
&lt;br /&gt;
7. Log in as instructor6 as previously described and change the submission due date to be passed so we are currently in the review stage&lt;br /&gt;
&lt;br /&gt;
8. Impersonate/login as student2 and Request for a new review under others work, submit the review&lt;br /&gt;
&lt;br /&gt;
9. Log in as instructor6 as previously described and change the review due date to be passed so we are currently in the meta-review stage&lt;br /&gt;
&lt;br /&gt;
10. Impersonate/login back as student1 (the one with the submission) and Request for a new meta review&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_outofreviews.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we conditionally hide the button based on whether or not the participant has reviews available to perform. These checks are located in assignment.rb which is the model for an Assignment. The following method was added to assignment.rb and returns true when the participant has a valid meta-review available.&lt;br /&gt;
&lt;br /&gt;
  # Returns true if there is a meta-review task available for the user&lt;br /&gt;
  def metareview_available?(user_id)&lt;br /&gt;
    metareviewer = AssignmentParticipant.where(user_id: user_id, parent_id: self.id).first&lt;br /&gt;
    begin&lt;br /&gt;
      self.response_map_to_metareview(metareviewer)&lt;br /&gt;
      true&lt;br /&gt;
    rescue &lt;br /&gt;
      false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/27 #27 - Defaulting Required and Allowed Meta-reviews to NULL in Assignment Database]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
Currently, the number of required and allowed meta-reviews is always being set to 3 in the database. Per the specs of the feature, it should default the database values to NULL. When checkbox &amp;quot;Use meta-review deadline&amp;quot;, in the &amp;quot;Due Dates&amp;quot; tab, is selected then the view should populate required and allowed meta-reviews to 3.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
We created a migration that defaulted the metareviews_allowed and metareviews_required in the Assignment table to nil instead of what the previous team had as 3.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_13.png]]&lt;br /&gt;
&lt;br /&gt;
Since the number of meta-reviews allowed and required are recorded using the values in the text fields, changes were made to &amp;lt;code&amp;gt;app/views/assignment/edit/_review_strategy.html.erb&amp;lt;/code&amp;gt; to set the values and display them as expected.&lt;br /&gt;
&lt;br /&gt;
When the checkbox for setting meta-review limits is unchecked, the values of number of meta-reviews allowed and required should be null. When the checkbox is checked, the values should be set to 3 and 3 by default, or to the values already defined before (in case the assignment was saved with the values set already). On page load, if the checkbox is enabled, then the inputs should be shown with the default or pre-set values, but if the checkbox is disabled then they should be hidden and set to null.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_2.PNG]]&lt;br /&gt;
&lt;br /&gt;
Changes had to be made to &amp;lt;code&amp;gt;app/views/student_review/list.html.erb&amp;lt;/code&amp;gt; to account for the values being &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_3.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
Tests have been created that test if a metareview can have nil limits. In this case, no limit will be shown to the user. Before this change that was impossible&lt;br /&gt;
&lt;br /&gt;
== '''Issue 5 - Meta Review Limit is Not Functioning Correctly in Assignment Creation''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;has meta review limit&amp;quot; should determine whether a limit or requirement is placed on the student to complete meta reviews. If disabled, then they should be able to complete as many as they want. This is independent of the Meta Review STAGE that is enabled/disabled in the due dates tab. They should not impact each other and currently do within the assignment creation.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. If the &amp;quot;Use meta-review deadline&amp;quot; is disabled, then the Meta Review Limit panel disappears&lt;br /&gt;
&lt;br /&gt;
2. &amp;quot;Has meta-review limit?&amp;quot; is hidden on edit&lt;br /&gt;
&lt;br /&gt;
3. Possibility the &amp;quot;Has meta-review limit?&amp;quot; not being saved on assignment creation?&lt;br /&gt;
&lt;br /&gt;
4. If the &amp;quot;Use meta-review deadline&amp;quot; is toggled (disabled, enabled), then the &amp;quot;Has meta-review limit?&amp;quot; resets to disabled&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
&lt;br /&gt;
The code in _due_dates.html.erb and the _review_strategy.html.erb within the /app/app/views/assignments/edit folder is lazily written and does not really adhere to the project specifications of how metareviews should work on assignment creation. These views need to be edited to work correctly and also respond to the changes in issue 5.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
The changes were too long to screenshot, so here is the specific diff section:&lt;br /&gt;
&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-540fd2bd6c34b48213716b1dd713733a&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-80f39fa5f62c73ff8741b02d3b11656c&lt;br /&gt;
&lt;br /&gt;
== '''Discovered Bugs:''' ==&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/45 #45 - &amp;quot;Request a new meta-review&amp;quot; button bugs]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Request new a meta-review&amp;quot; button should be hidden when:&lt;br /&gt;
# The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
# The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
# There are no valid reviews available for the participant.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 0 reviewers. The user should NOT be able to see the 'Request a new meta-review to perform' button when there are no reviews available.&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** A student should NOT be able to request a meta-review on their own review.&lt;br /&gt;
*** When the meta-review limit on the assignment is set to 1 then a student should NOT be able to request a second meta-review.&lt;br /&gt;
*** The user should not be able to see the 'Request a new meta-review to perform' button when they have performed all valid reviews.&lt;br /&gt;
** with 4 reviewers.&lt;br /&gt;
*** The user should be able to click the 'Begin' button and still see the 'Request a new meta-review to perform' button.&lt;br /&gt;
*** The user should NOT be able to see the 'Request a new meta-review to perform' button when they have reached the meta-review limit.&lt;br /&gt;
*** If the user requests two meta-reviews but has not submitted, then they should not be able to request a new meta-review.&lt;br /&gt;
*** The user should be able to request a meta-review if they are above their required but below the allowed number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/30 #30 - “Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of Meta-Reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_completed %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixed behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of meta-reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_total %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is requested.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is completed.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/43 #43 - &amp;quot;Review Allowed&amp;quot; flag is required to be set on a due_date for a user to perform a meta-review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
When an assignment with a meta-review is created the round that meta-reviews will be performed in should have the &amp;quot;Meta-review allowed&amp;quot; option set to yes. This should be the only requirement for making meta-reviews available in that round. The problem with the current implementation is that meta-reviews can only be performed in rounds where the &amp;quot;Review allowed&amp;quot; option is set.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025 Issue43.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were applied to app/views/student_review/_responses.html.erb. Since this partial is shared by both reviews and meta-reviews in list.html.erb the title variable was used to determine if the begin option should be active or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; @assignment.can_review(topic_id) %&amp;gt;&lt;br /&gt;
Current behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; &lt;br /&gt;
        ((@assignment.can_review(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Review&amp;quot;) ||&lt;br /&gt;
         (@assignment.metareview_allowed(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Meta-review&amp;quot;)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. All meta-review tests make meta-reviews allowed only during the meta-review round. This means that if the simple meta-review test is passing then this feature is working as intended.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/50 #50 - The submit button is not available for meta-reviews.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Users should see save and submit buttons as part of the meta-review form. These buttons should have the same behavior as the review form. The problem right now is there is not submit button for meta-reviews.&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were made adding 'Metareview' to the conditional that determines if the submit button should be shown or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review')) %&amp;gt;&lt;br /&gt;
New behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review') || (@title.eql? 'Metareview'))%&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Submit &amp;quot;+@title, :name =&amp;gt; &amp;quot;Submit&amp;quot;, :id =&amp;gt; &amp;quot;Submit&amp;quot; %&amp;gt;&lt;br /&gt;
   &amp;lt;img src=&amp;quot;/assets/info.png&amp;quot; title='- SAVE will only store the peer-review as draft and the peer-review will not be displayed to the reviewee. After clicking SUBMIT, the peer-review will be displayed to reviewee, and you will not be able to update it any more.'&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user is able to SUBMIT a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
==== Context 1: Meta-review tests that have a meta-review deadline with 0 reviewers. ====&lt;br /&gt;
1. User should NOT be able to see 'Request a new meta-review to perform' button when there are no reviews available. When there are reviews that don't belong to the meta-reviewer submitted, meta-reviews can be performed.&lt;br /&gt;
&lt;br /&gt;
==== Context 2: Meta-review tests that have a meta-review deadline with 1 reviewers. ====&lt;br /&gt;
1. User is able to SAVE a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
2. User is able to go BACK during a simple meta-review since this functionality is available for reviews.&lt;br /&gt;
&lt;br /&gt;
3. When the limit and required number of meta-reviews on the assignment are equal, then a student will see they need to submit exactly that number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
4. When there are more meta-reviews allowed than required, then a student will see they need to submit between the two numbers of meta-reviews&lt;br /&gt;
&lt;br /&gt;
5. When the meta-review limits for an assignment are unset then a student will see that the number of meta-reviews aren't limited&lt;br /&gt;
&lt;br /&gt;
6. A student should not see a number of required or allowed meta-reviews when there are no limits on meta-reviews&lt;br /&gt;
&lt;br /&gt;
7. A student should see the number of meta-reviews decrement after a review is requested&lt;br /&gt;
&lt;br /&gt;
8. A student should see the number of meta-reviews decrement after they complete a review&lt;br /&gt;
&lt;br /&gt;
9. A student should not be able to request a meta-review on their own reviews &lt;br /&gt;
&lt;br /&gt;
10. If the meta-review limit on the assignment is set to 1 then a student should not be able to request a second meta review&lt;br /&gt;
&lt;br /&gt;
11. User should not be able to see 'Request a new meta-review to perform' button when they have reviewed all valid reviews already&lt;br /&gt;
&lt;br /&gt;
==== Context 3: Meta-review tests that have a meta-review deadline with 4 reviewers. ====&lt;br /&gt;
1. User should be able to request more than one meta-review before completing any&lt;br /&gt;
&lt;br /&gt;
2. User should not be able to see 'Request a new meta-review to perform' button when they have reached the meta-review limit&lt;br /&gt;
&lt;br /&gt;
3. User should not be able to request more than two meta-reviews without completing at least 1&lt;br /&gt;
&lt;br /&gt;
4. A student should be able to request a meta-review if they are above their required but below their allowed meta-reviews&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_tests_passing.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Coverage===&lt;br /&gt;
Current test coverage is 41.348%. Code coverage will increase based on the test plan above and then if the failing test case described below would be fixed.&lt;br /&gt;
&lt;br /&gt;
Travis CI is currently failing because of:&lt;br /&gt;
  Failures:&lt;br /&gt;
  1) assignment function general tab should edit quiz number available to students&lt;br /&gt;
     Failure/Error:&lt;br /&gt;
       child_nodes.each do |node|&lt;br /&gt;
         initialize_fnode_update_children(params, node, tmp_res)&lt;br /&gt;
       end&lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `each' for &amp;quot;&amp;quot;:String&lt;br /&gt;
     # ./app/controllers/tree_display_controller.rb:209:in `children_node_ng'&lt;br /&gt;
     # ./config/diagnostic.rb:11:in `call'&lt;br /&gt;
     # ------------------&lt;br /&gt;
     # --- Caused by: ---&lt;br /&gt;
     # Capybara::CapybaraError:&lt;br /&gt;
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true&lt;br /&gt;
     #   /home/travis/build/expertiza/expertiza/vendor/bundle/ruby/2.2.0/gems/capybara-2.17.0/lib/capybara/session.rb:145:in `raise_server_error!'&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144308</id>
		<title>CSC/ECE 517 Spring 2022 - E2235. Issues related to meta-reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2235._Issues_related_to_meta-reviewing&amp;diff=144308"/>
		<updated>2022-04-06T17:02:04Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: E2235. Issues related to meta-reviewing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Overview of Project''' ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, meta-review is a feature that enables a third party to evaluate the quality of feedback that a reviewer gives a reviewee. meta-review is an important feature that can help students become better reviewers for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. The task is to fix these issues so that this feature can be used again.&lt;br /&gt;
&lt;br /&gt;
* An assignment is deemed to have meta-reviews if and only if there is a meta-review deadline for this assignment in the `assignments_questionnaires` table.&lt;br /&gt;
* If there is no meta-review deadline, then don’t show the question about whether there is a max meta-review limit.&lt;br /&gt;
* In the DB the default number of meta-reviews allowed and required should be null.&lt;br /&gt;
* As soon as someone checks the Has meta-review Limit box on the Review Strategy tab, the UI should fill in 3 and 3 as the required and allowed number.&lt;br /&gt;
* Student pages should show the list of reviews that have been performed.&lt;br /&gt;
* When a user requests a new meta-review, the field which says the number of meta-reviews left ( refer to above image “Numbers of Meta-reviews left:”) does not change and the button to request a new meta-review disappears.&lt;br /&gt;
&lt;br /&gt;
===Previous Work===&lt;br /&gt;
&lt;br /&gt;
This assignment is a repeat of E1997 which was assigned to students last semester, Fall 2019.&lt;br /&gt;
&lt;br /&gt;
Details of the previous implementation can be found here:&lt;br /&gt;
[http://https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1997._Issues_related_to_meta-reviewing E1997]&lt;br /&gt;
&lt;br /&gt;
Our goals are to update the logic, refactor non-DRY code, and fix bugs.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/32 #32 - Remove all debug comments in the UI]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
It was noted in the previous team's implementation that multiple debugging comments were showing up during their video testing.&lt;br /&gt;
&lt;br /&gt;
Debug messages shown when viewing a completed meta review:&lt;br /&gt;
[[File:Debug_comments.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
There was a mistake in &amp;lt;code&amp;gt;app/views/response/_review.html.erb&amp;lt;/code&amp;gt; where &amp;quot;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;hr/&amp;gt;&amp;lt;&amp;lt;nowiki/&amp;gt;br/&amp;gt;&amp;quot; was being displayed under the review being meta-reviewed. This was due to being included as a string constant rather than html code. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_comments_response_review.PNG]]&lt;br /&gt;
&lt;br /&gt;
There was an instance in &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; where ruby code responsible for getting a review to be displayed was being interpreted and displayed, even though the response was being displayed as html in the line before. This resulted in the response details being listed in the UI erroneously.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_debug_response_view.PNG]]&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/49 #49 - &amp;quot;Request a new meta-review&amp;quot; button crashes when there are no available reviews]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
When there are no valid metareviews to perform (either there are no reivews performed on the assignment, the only valid reviews concern your own work or own reviews, you have completed all allowed metareviews, or you have reviewed all valid reviews already) then the &amp;quot;Request a New Review&amp;quot; button still is visible and displays the following error (correctly) when pressed.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. Log in as instructor6, click on mange...-&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
2. Click on edit assignment, navigate to Due Dates and check &amp;quot;Use meta-review deadline&amp;quot; checkbox&lt;br /&gt;
&lt;br /&gt;
3. Select &amp;quot;Yes&amp;quot; for all submission allowed, Review allowed and Meta-review allowed in all of the deadline types&lt;br /&gt;
&lt;br /&gt;
4. Navigate back to Assignment Tree View and click on &amp;quot;Add participant&amp;quot;&lt;br /&gt;
&lt;br /&gt;
5. Add couple of students(say student1 and student2) to the assignment&lt;br /&gt;
&lt;br /&gt;
6. Impersonate/login as student1 and make a submission&lt;br /&gt;
&lt;br /&gt;
7. Log in as instructor6 as previously described and change the submission due date to be passed so we are currently in the review stage&lt;br /&gt;
&lt;br /&gt;
8. Impersonate/login as student2 and Request for a new review under others work, submit the review&lt;br /&gt;
&lt;br /&gt;
9. Log in as instructor6 as previously described and change the review due date to be passed so we are currently in the meta-review stage&lt;br /&gt;
&lt;br /&gt;
10. Impersonate/login back as student1 (the one with the submission) and Request for a new meta review&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_outofreviews.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we conditionally hide the button based on whether or not the participant has reviews available to perform. These checks are located in assignment.rb which is the model for an Assignment. The following method was added to assignment.rb and returns true when the participant has a valid meta-review available.&lt;br /&gt;
&lt;br /&gt;
  # Returns true if there is a meta-review task available for the user&lt;br /&gt;
  def metareview_available?(user_id)&lt;br /&gt;
    metareviewer = AssignmentParticipant.where(user_id: user_id, parent_id: self.id).first&lt;br /&gt;
    begin&lt;br /&gt;
      self.response_map_to_metareview(metareviewer)&lt;br /&gt;
      true&lt;br /&gt;
    rescue &lt;br /&gt;
      false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/27 #27 - Defaulting Required and Allowed Meta-reviews to NULL in Assignment Database]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
Currently, the number of required and allowed meta-reviews is always being set to 3 in the database. Per the specs of the feature, it should default the database values to NULL. When checkbox &amp;quot;Use meta-review deadline&amp;quot;, in the &amp;quot;Due Dates&amp;quot; tab, is selected then the view should populate required and allowed meta-reviews to 3.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
We created a migration that defaulted the metareviews_allowed and metareviews_required in the Assignment table to nil instead of what the previous team had as 3.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_13.png]]&lt;br /&gt;
&lt;br /&gt;
Since the number of meta-reviews allowed and required are recorded using the values in the text fields, changes were made to &amp;lt;code&amp;gt;app/views/assignment/edit/_review_strategy.html.erb&amp;lt;/code&amp;gt; to set the values and display them as expected.&lt;br /&gt;
&lt;br /&gt;
When the checkbox for setting meta-review limits is unchecked, the values of number of meta-reviews allowed and required should be null. When the checkbox is checked, the values should be set to 3 and 3 by default, or to the values already defined before (in case the assignment was saved with the values set already). On page load, if the checkbox is enabled, then the inputs should be shown with the default or pre-set values, but if the checkbox is disabled then they should be hidden and set to null.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_2.PNG]]&lt;br /&gt;
&lt;br /&gt;
Changes had to be made to &amp;lt;code&amp;gt;app/views/student_review/list.html.erb&amp;lt;/code&amp;gt; to account for the values being &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
[[File:E2025_metareview_limit_3.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
Tests have been created that test if a metareview can have nil limits. In this case, no limit will be shown to the user. Before this change that was impossible&lt;br /&gt;
&lt;br /&gt;
== '''Issue 5 - Meta Review Limit is Not Functioning Correctly in Assignment Creation''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;has meta review limit&amp;quot; should determine whether a limit or requirement is placed on the student to complete meta reviews. If disabled, then they should be able to complete as many as they want. This is independent of the Meta Review STAGE that is enabled/disabled in the due dates tab. They should not impact each other and currently do within the assignment creation.&lt;br /&gt;
&lt;br /&gt;
===Reproducing Existing Issue===&lt;br /&gt;
&lt;br /&gt;
1. If the &amp;quot;Use meta-review deadline&amp;quot; is disabled, then the Meta Review Limit panel disappears&lt;br /&gt;
&lt;br /&gt;
2. &amp;quot;Has meta-review limit?&amp;quot; is hidden on edit&lt;br /&gt;
&lt;br /&gt;
3. Possibility the &amp;quot;Has meta-review limit?&amp;quot; not being saved on assignment creation?&lt;br /&gt;
&lt;br /&gt;
4. If the &amp;quot;Use meta-review deadline&amp;quot; is toggled (disabled, enabled), then the &amp;quot;Has meta-review limit?&amp;quot; resets to disabled&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
&lt;br /&gt;
The code in _due_dates.html.erb and the _review_strategy.html.erb within the /app/app/views/assignments/edit folder is lazily written and does not really adhere to the project specifications of how metareviews should work on assignment creation. These views need to be edited to work correctly and also respond to the changes in issue 5.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
The changes were too long to screenshot, so here is the specific diff section:&lt;br /&gt;
&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-540fd2bd6c34b48213716b1dd713733a&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1715/files#diff-80f39fa5f62c73ff8741b02d3b11656c&lt;br /&gt;
&lt;br /&gt;
== '''Discovered Bugs:''' ==&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/45 #45 - &amp;quot;Request a new meta-review&amp;quot; button bugs]''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue Description===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Request new a meta-review&amp;quot; button should be hidden when:&lt;br /&gt;
# The number of meta-reviews in-progress is greater than the maximum allowed outstanding reviews.&lt;br /&gt;
# The number of reviews allowed is limited AND the total number of meta-reviews completed or in-progress is greater than the number allowed.&lt;br /&gt;
# There are no valid reviews available for the participant.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
This issue deals with the view &amp;quot;list.html.erb&amp;quot; under /app/views/student_review. The code below shows the conditional used to display the &amp;quot;Request new meta-review&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @num_metareviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding meta-reviews. You must complete one of your&lt;br /&gt;
    outstanding meta-reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif @assignment.num_metareviews_allowed &amp;amp;&amp;amp; @num_metareviews_total == @assignment.num_metareviews_allowed %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Note: You can not do more than &amp;lt;%=@assignment.num_metareviews_allowed%&amp;gt; meta-reviews according&lt;br /&gt;
    to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% elsif (!@assignment.metareview_available?(session[:user].id)) %&amp;gt;&lt;br /&gt;
    &amp;lt;span&amp;gt;Meta-reviews cannot be performed at this time.&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_metareview', :locals =&amp;gt; {:assignment =&amp;gt; @assignment} %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 0 reviewers. The user should NOT be able to see the 'Request a new meta-review to perform' button when there are no reviews available.&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** A student should NOT be able to request a meta-review on their own review.&lt;br /&gt;
*** When the meta-review limit on the assignment is set to 1 then a student should NOT be able to request a second meta-review.&lt;br /&gt;
*** The user should not be able to see the 'Request a new meta-review to perform' button when they have performed all valid reviews.&lt;br /&gt;
** with 4 reviewers.&lt;br /&gt;
*** The user should be able to click the 'Begin' button and still see the 'Request a new meta-review to perform' button.&lt;br /&gt;
*** The user should NOT be able to see the 'Request a new meta-review to perform' button when they have reached the meta-review limit.&lt;br /&gt;
*** If the user requests two meta-reviews but has not submitted, then they should not be able to request a new meta-review.&lt;br /&gt;
*** The user should be able to request a meta-review if they are above their required but below the allowed number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/30 #30 - “Numbers of Meta-reviews left:” does not update after a user requests a review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Number of meta-reviews left should decrement when a user requests a meta-review. Current behavior only decremented when a review was submitted.&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of Meta-Reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_completed %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixed behavior:&lt;br /&gt;
&lt;br /&gt;
 Number of meta-reviews left: &amp;lt;%= @assignment.num_metareviews_allowed - @num_metareviews_total %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is requested.&lt;br /&gt;
*** The user should see the number of meta-reviews left decrement after a new meta-review is completed.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/43 #43 - &amp;quot;Review Allowed&amp;quot; flag is required to be set on a due_date for a user to perform a meta-review.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
When an assignment with a meta-review is created the round that meta-reviews will be performed in should have the &amp;quot;Meta-review allowed&amp;quot; option set to yes. This should be the only requirement for making meta-reviews available in that round. The problem with the current implementation is that meta-reviews can only be performed in rounds where the &amp;quot;Review allowed&amp;quot; option is set.&lt;br /&gt;
&lt;br /&gt;
[[File:E2025 Issue43.png]]&lt;br /&gt;
&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were applied to app/views/student_review/_responses.html.erb. Since this partial is shared by both reviews and meta-reviews in list.html.erb the title variable was used to determine if the begin option should be active or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; @assignment.can_review(topic_id) %&amp;gt;&lt;br /&gt;
Current behavior:&lt;br /&gt;
 &amp;lt;% elsif @assignment.get_current_stage(topic_id) != &amp;quot;Complete&amp;quot; &amp;amp;&amp;amp; &lt;br /&gt;
        ((@assignment.can_review(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Review&amp;quot;) ||&lt;br /&gt;
         (@assignment.metareview_allowed(topic_id) &amp;amp;&amp;amp; title == &amp;quot;Meta-review&amp;quot;)) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. All meta-review tests make meta-reviews allowed only during the meta-review round. This means that if the simple meta-review test is passing then this feature is working as intended.&lt;br /&gt;
&lt;br /&gt;
== '''[https://github.com/RPHolloway/expertiza/issues/50 #50 - The submit button is not available for meta-reviews.]''' ==&lt;br /&gt;
===Issue Description===&lt;br /&gt;
Users should see save and submit buttons as part of the meta-review form. These buttons should have the same behavior as the review form. The problem right now is there is not submit button for meta-reviews.&lt;br /&gt;
===Changes===&lt;br /&gt;
Code changes were made adding 'Metareview' to the conditional that determines if the submit button should be shown or not.&lt;br /&gt;
&lt;br /&gt;
Previous behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review')) %&amp;gt;&lt;br /&gt;
New behavior:&lt;br /&gt;
 &amp;lt;% if @title &amp;amp;&amp;amp; ((@title.eql? 'Review') || (@title.eql? 'Self Review') || (@title.eql? 'Metareview'))%&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Submit &amp;quot;+@title, :name =&amp;gt; &amp;quot;Submit&amp;quot;, :id =&amp;gt; &amp;quot;Submit&amp;quot; %&amp;gt;&lt;br /&gt;
   &amp;lt;img src=&amp;quot;/assets/info.png&amp;quot; title='- SAVE will only store the peer-review as draft and the peer-review will not be displayed to the reviewee. After clicking SUBMIT, the peer-review will be displayed to reviewee, and you will not be able to update it any more.'&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Functional tests from a student perspective are in /spec/features/meta_review_spec.rb. The tests assume the allowed number of meta-reviews is 5 and the required number of meta-reviews is 3. Tests for this feature are explained in summary below:&lt;br /&gt;
* For assignments that have a meta-review deadline...&lt;br /&gt;
** with 1 reviewer.&lt;br /&gt;
*** The user is able to SUBMIT a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
== '''Testing''' ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
1. Log in as super_administrator2.  Password is &amp;quot;password&amp;quot;. Click on mange...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
2. Create a new Assignment by clicking the &amp;quot;+&amp;quot; button. Give the assignment these fields: Name, Course and Submission Directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_general.png]]&lt;br /&gt;
&lt;br /&gt;
3. Go to &amp;quot;Due Dates&amp;quot; tab and check &amp;quot;Use meta-review deadline&amp;quot; and then set the due dates 1 into the FUTURE for each review round and meta-review. Leave everything else as default as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_duedates.png]]&lt;br /&gt;
&lt;br /&gt;
4. Go to the &amp;quot;Rubrics&amp;quot; tab and populate as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:New_assignment_rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
5. OPTIONAL: Go to &amp;quot;Review strategy page and select &amp;quot;Has meta-review limit?&amp;quot; and set the number of allowed and required meta-reviews.&lt;br /&gt;
&lt;br /&gt;
6. Once done, &amp;quot;Create&amp;quot; the assignment.&lt;br /&gt;
&lt;br /&gt;
7. Go back to Assignments. manage...-&amp;gt; Assignments.&lt;br /&gt;
&lt;br /&gt;
8. Find the newly created assignment and click on &amp;quot;Add participant&amp;quot;. Add the students below:&lt;br /&gt;
&lt;br /&gt;
[[File:add_participants.png]]&lt;br /&gt;
&lt;br /&gt;
9. Go to manage...Impersonate User and impersonate &amp;quot;Student485&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Go to the newly created assignment and submit a link for the assignment.&lt;br /&gt;
&lt;br /&gt;
11. Revert back to super_administrator2 and change the submission due date to a date in the PAST so we are currently in the review stage.&lt;br /&gt;
&lt;br /&gt;
12. Impersonate student486 and request for a new review under others work, submit the review.&lt;br /&gt;
&lt;br /&gt;
13. Revert back to super_administrator2 as previously described and change the review due date to be passed so we are currently in the meta-review stage.&lt;br /&gt;
&lt;br /&gt;
14. Impersonate as student485 and Request for a new meta review.&lt;br /&gt;
&lt;br /&gt;
15. Press &amp;quot;Begin&amp;quot; and complete the meta-review&lt;br /&gt;
&lt;br /&gt;
16. When the review is complete, the &amp;quot;Begin&amp;quot; should disappear and be replaced with &amp;quot;View&amp;quot; and &amp;quot;Edit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Automated Test Plan===&lt;br /&gt;
==== Context 1: Meta-review tests that have a meta-review deadline with 0 reviewers. ====&lt;br /&gt;
1. User should NOT be able to see 'Request a new meta-review to perform' button when there are no reviews available. When there are reviews that don't belong to the meta-reviewer submitted, meta-reviews can be performed.&lt;br /&gt;
&lt;br /&gt;
==== Context 2: Meta-review tests that have a meta-review deadline with 1 reviewers. ====&lt;br /&gt;
1. User is able to SAVE a simple meta-review.&lt;br /&gt;
&lt;br /&gt;
2. User is able to go BACK during a simple meta-review since this functionality is available for reviews.&lt;br /&gt;
&lt;br /&gt;
3. When the limit and required number of meta-reviews on the assignment are equal, then a student will see they need to submit exactly that number of meta-reviews.&lt;br /&gt;
&lt;br /&gt;
4. When there are more meta-reviews allowed than required, then a student will see they need to submit between the two numbers of meta-reviews&lt;br /&gt;
&lt;br /&gt;
5. When the meta-review limits for an assignment are unset then a student will see that the number of meta-reviews aren't limited&lt;br /&gt;
&lt;br /&gt;
6. A student should not see a number of required or allowed meta-reviews when there are no limits on meta-reviews&lt;br /&gt;
&lt;br /&gt;
7. A student should see the number of meta-reviews decrement after a review is requested&lt;br /&gt;
&lt;br /&gt;
8. A student should see the number of meta-reviews decrement after they complete a review&lt;br /&gt;
&lt;br /&gt;
9. A student should not be able to request a meta-review on their own reviews &lt;br /&gt;
&lt;br /&gt;
10. If the meta-review limit on the assignment is set to 1 then a student should not be able to request a second meta review&lt;br /&gt;
&lt;br /&gt;
11. User should not be able to see 'Request a new meta-review to perform' button when they have reviewed all valid reviews already&lt;br /&gt;
&lt;br /&gt;
==== Context 3: Meta-review tests that have a meta-review deadline with 4 reviewers. ====&lt;br /&gt;
1. User should be able to request more than one meta-review before completing any&lt;br /&gt;
&lt;br /&gt;
2. User should not be able to see 'Request a new meta-review to perform' button when they have reached the meta-review limit&lt;br /&gt;
&lt;br /&gt;
3. User should not be able to request more than two meta-reviews without completing at least 1&lt;br /&gt;
&lt;br /&gt;
4. A student should be able to request a meta-review if they are above their required but below their allowed meta-reviews&lt;br /&gt;
&lt;br /&gt;
[[File:E2025_tests_passing.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Coverage===&lt;br /&gt;
Current test coverage is 41.348%. Code coverage will increase based on the test plan above and then if the failing test case described below would be fixed.&lt;br /&gt;
&lt;br /&gt;
Travis CI is currently failing because of:&lt;br /&gt;
  Failures:&lt;br /&gt;
  1) assignment function general tab should edit quiz number available to students&lt;br /&gt;
     Failure/Error:&lt;br /&gt;
       child_nodes.each do |node|&lt;br /&gt;
         initialize_fnode_update_children(params, node, tmp_res)&lt;br /&gt;
       end&lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `each' for &amp;quot;&amp;quot;:String&lt;br /&gt;
     # ./app/controllers/tree_display_controller.rb:209:in `children_node_ng'&lt;br /&gt;
     # ./config/diagnostic.rb:11:in `call'&lt;br /&gt;
     # ------------------&lt;br /&gt;
     # --- Caused by: ---&lt;br /&gt;
     # Capybara::CapybaraError:&lt;br /&gt;
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true&lt;br /&gt;
     #   /home/travis/build/expertiza/expertiza/vendor/bundle/ruby/2.2.0/gems/capybara-2.17.0/lib/capybara/session.rb:145:in `raise_server_error!'&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143385</id>
		<title>CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143385"/>
		<updated>2022-03-21T23:56:00Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2223 OSS assignment for Spring 2022, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is a open source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller &lt;br /&gt;
* Allows an instructor to add/remove topics&lt;br /&gt;
* Allows an instructor to assign/remove students to topics&lt;br /&gt;
* Allows an student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
1. Naming is inconsistent.  When used as a verb, “sign up” is two words.  When an adjective or a noun, it should be one word, e.g., “signup_sheet_controller.”  Cf. “sign_up_as_instructor”.  Please make the naming consistent.  Of course, this will result in changes in calling methods as well.&lt;br /&gt;
&lt;br /&gt;
2. Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]&lt;br /&gt;
&lt;br /&gt;
3. Several method names can be improved.&lt;br /&gt;
&lt;br /&gt;
4. What are differences between signup_as_instructor and signup_as_instructor_action methods? Investigate if they are needed and improve the method names if both are needed. Provide comments as to what each method does.&lt;br /&gt;
&lt;br /&gt;
5. The list method is too long and is sparsely commented. Provide comments and identify if the method can be split or made cleaner by moving code to models or helper methods.&lt;br /&gt;
&lt;br /&gt;
6. Signup_as_instructor_action has if-else ladder. It can be made more elegant.&lt;br /&gt;
&lt;br /&gt;
7.Delete_signup and delete_signup_as_instructor have much in common and violate the DRY principle. Refactor.&lt;br /&gt;
&lt;br /&gt;
8.Giving elegant and more understandable names to flash in flash_delete_signup_message function&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed the name of the controller from sign_up_sheet_controller.rb --&amp;gt; signup_sheet_controller.rb. Also changed several method names that had 'sign_up' being used as an adjective or a noun to 'signup'.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/9e99f56c9f8051fa5ee6b6a4bdf3659ec50852dc&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/66fc8bc5fc3850639306ad2be79afaa3de1fad70&lt;br /&gt;
&lt;br /&gt;
2. The requirement that deadlines be submitted is no longer implemented and therefore a separate function for &amp;quot;staggered&amp;quot; is no longer needed.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/db12bf9c05831576183363b6bfe68bbad64e9c5a&lt;br /&gt;
&lt;br /&gt;
3. Renaming function ad_info&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/6507f15f6d23f44900465536a91cc6c80f90ad75&lt;br /&gt;
&lt;br /&gt;
4. Remove signup_as_instructor, since its not being used anywhere as such.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/e92e704f5cb6c549d440784339bcce6eba408a6b&lt;br /&gt;
&lt;br /&gt;
5. The list method is broken into 2 functions. The small part of computing signup topics is created. Also comments has been added to understand the function better.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/4b7bb6113dfb8984d7aa4dca467b55f67de3c93a&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/bd86f5a4ec8aa02c27a0cd34c85bd21776feca2c&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/56be9eed8ac89632041608947108f87dfbcb28ab&lt;br /&gt;
&lt;br /&gt;
6. Signup_as_instructor_action's if-else ladder has been made more elegant. &lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/50aae43edb7fcec3804deb93df28471db1b31c15&lt;br /&gt;
&lt;br /&gt;
7. delete_signup and delete_signup_as_instructor violated the DRY principle due to both functions using identical if/else statements.  To solve this issue, flash_delete_signup_message function was created.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/ddf35e88a2486d5ca748d3d93b15d9f6f4984af9&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/df1342b5239bb4e49214149b877a5ccf9c6117ae&lt;br /&gt;
&lt;br /&gt;
8. Flash messages names have been changed and given for meaningful names.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/47b4b11e4b4b2e6793dbd54259ae36749ed113a7&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; RSpec &lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
; Physical Testing&lt;br /&gt;
: &lt;br /&gt;
=== Login as instructor ===&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Click the Green Check for any topic&lt;br /&gt;
# Enter a student UnityID and click submit&lt;br /&gt;
&lt;br /&gt;
=== Login as student ===&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143384</id>
		<title>CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143384"/>
		<updated>2022-03-21T23:55:42Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2223 OSS assignment for Spring 2022, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is a open source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller &lt;br /&gt;
* Allows an instructor to add/remove topics&lt;br /&gt;
* Allows an instructor to assign/remove students to topics&lt;br /&gt;
* Allows an student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
1. Naming is inconsistent.  When used as a verb, “sign up” is two words.  When an adjective or a noun, it should be one word, e.g., “signup_sheet_controller.”  Cf. “sign_up_as_instructor”.  Please make the naming consistent.  Of course, this will result in changes in calling methods as well.&lt;br /&gt;
&lt;br /&gt;
2. Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]&lt;br /&gt;
&lt;br /&gt;
3. Several method names can be improved.&lt;br /&gt;
&lt;br /&gt;
4. What are differences between signup_as_instructor and signup_as_instructor_action methods? Investigate if they are needed and improve the method names if both are needed. Provide comments as to what each method does.&lt;br /&gt;
&lt;br /&gt;
5. The list method is too long and is sparsely commented. Provide comments and identify if the method can be split or made cleaner by moving code to models or helper methods.&lt;br /&gt;
&lt;br /&gt;
6. Signup_as_instructor_action has if-else ladder. It can be made more elegant.&lt;br /&gt;
&lt;br /&gt;
7.Delete_signup and delete_signup_as_instructor have much in common and violate the DRY principle. Refactor.&lt;br /&gt;
&lt;br /&gt;
8.Giving elegant and more understandable names to flash in flash_delete_signup_message function&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed the name of the controller from sign_up_sheet_controller.rb --&amp;gt; signup_sheet_controller.rb. Also changed several method names that had 'sign_up' being used as an adjective or a noun to 'signup'.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/9e99f56c9f8051fa5ee6b6a4bdf3659ec50852dc&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/66fc8bc5fc3850639306ad2be79afaa3de1fad70&lt;br /&gt;
&lt;br /&gt;
2. The requirement that deadlines be submitted is no longer implemented and therefore a separate function for &amp;quot;staggered&amp;quot; is no longer needed.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/db12bf9c05831576183363b6bfe68bbad64e9c5a&lt;br /&gt;
&lt;br /&gt;
3. Renaming function ad_info&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/6507f15f6d23f44900465536a91cc6c80f90ad75&lt;br /&gt;
&lt;br /&gt;
4. Remove signup_as_instructor, since its not being used anywhere as such.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/e92e704f5cb6c549d440784339bcce6eba408a6b&lt;br /&gt;
&lt;br /&gt;
5. The list method is broken into 2 functions. The small part of computing signup topics is created. Also comments has been added to understand the function better.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/4b7bb6113dfb8984d7aa4dca467b55f67de3c93a&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/bd86f5a4ec8aa02c27a0cd34c85bd21776feca2c&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/56be9eed8ac89632041608947108f87dfbcb28ab&lt;br /&gt;
&lt;br /&gt;
6. Signup_as_instructor_action's if-else ladder has been made more elegant. &lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/50aae43edb7fcec3804deb93df28471db1b31c15&lt;br /&gt;
&lt;br /&gt;
7. delete_signup and delete_signup_as_instructor violated the DRY principle due to both functions using identical if/else statements.  To solve this issue, flash_delete_signup_message function was created.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/ddf35e88a2486d5ca748d3d93b15d9f6f4984af9&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/df1342b5239bb4e49214149b877a5ccf9c6117ae&lt;br /&gt;
&lt;br /&gt;
8. Flash messages names have been changed and given for meaningful names.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/47b4b11e4b4b2e6793dbd54259ae36749ed113a7&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; RSpec &lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
; Physical Testing&lt;br /&gt;
: &lt;br /&gt;
=== Login as instructor ===&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Click the Green Check for any topic&lt;br /&gt;
# Enter a student UnityID and click submit&lt;br /&gt;
&lt;br /&gt;
=== Login as student ===&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indiactes functionality is as before after refactoring list function.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143383</id>
		<title>CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143383"/>
		<updated>2022-03-21T23:55:06Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2223 OSS assignment for Spring 2022, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is a open source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller &lt;br /&gt;
* Allows an instructor to add/remove topics&lt;br /&gt;
* Allows an instructor to assign/remove students to topics&lt;br /&gt;
* Allows an student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
1. Naming is inconsistent.  When used as a verb, “sign up” is two words.  When an adjective or a noun, it should be one word, e.g., “signup_sheet_controller.”  Cf. “sign_up_as_instructor”.  Please make the naming consistent.  Of course, this will result in changes in calling methods as well.&lt;br /&gt;
&lt;br /&gt;
2. Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]&lt;br /&gt;
&lt;br /&gt;
3. Several method names can be improved.&lt;br /&gt;
&lt;br /&gt;
4. What are differences between signup_as_instructor and signup_as_instructor_action methods? Investigate if they are needed and improve the method names if both are needed. Provide comments as to what each method does.&lt;br /&gt;
&lt;br /&gt;
5. The list method is too long and is sparsely commented. Provide comments and identify if the method can be split or made cleaner by moving code to models or helper methods.&lt;br /&gt;
&lt;br /&gt;
6. Signup_as_instructor_action has if-else ladder. It can be made more elegant.&lt;br /&gt;
&lt;br /&gt;
7.Delete_signup and delete_signup_as_instructor have much in common and violate the DRY principle. Refactor.&lt;br /&gt;
&lt;br /&gt;
8.Giving elegant and more understandable names to flash in flash_delete_signup_message function&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed the name of the controller from sign_up_sheet_controller.rb --&amp;gt; signup_sheet_controller.rb. Also changed several method names that had 'sign_up' being used as an adjective or a noun to 'signup'.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/9e99f56c9f8051fa5ee6b6a4bdf3659ec50852dc&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/66fc8bc5fc3850639306ad2be79afaa3de1fad70&lt;br /&gt;
&lt;br /&gt;
2. The requirement that deadlines be submitted is no longer implemented and therefore a separate function for &amp;quot;staggered&amp;quot; is no longer needed.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/db12bf9c05831576183363b6bfe68bbad64e9c5a&lt;br /&gt;
&lt;br /&gt;
3. Renaming function ad_info&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/6507f15f6d23f44900465536a91cc6c80f90ad75&lt;br /&gt;
&lt;br /&gt;
4. Remove signup_as_instructor, since its not being used anywhere as such.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/e92e704f5cb6c549d440784339bcce6eba408a6b&lt;br /&gt;
&lt;br /&gt;
5. The list method is broken into 2 functions. The small part of computing signup topics is created. Also comments has been added to understand the function better.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/4b7bb6113dfb8984d7aa4dca467b55f67de3c93a&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/bd86f5a4ec8aa02c27a0cd34c85bd21776feca2c&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/56be9eed8ac89632041608947108f87dfbcb28ab&lt;br /&gt;
&lt;br /&gt;
6. Signup_as_instructor_action's if-else ladder has been made more elegant. &lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/50aae43edb7fcec3804deb93df28471db1b31c15&lt;br /&gt;
&lt;br /&gt;
7. delete_signup and delete_signup_as_instructor violated the DRY principle due to both functions using identical if/else statements.  To solve this issue, flash_delete_signup_message function was created.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/ddf35e88a2486d5ca748d3d93b15d9f6f4984af9&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/df1342b5239bb4e49214149b877a5ccf9c6117ae&lt;br /&gt;
&lt;br /&gt;
8. Flash messages names have been changed and given for meaningful names.&lt;br /&gt;
&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/47b4b11e4b4b2e6793dbd54259ae36749ed113a7&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; RSpec &lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
; Physical Testing&lt;br /&gt;
: &lt;br /&gt;
=== Login as instructor ===&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Click the Green Check for any topic&lt;br /&gt;
# Enter a student UnityID and click submit&lt;br /&gt;
&lt;br /&gt;
=== Login as student ===&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indiactes functionality is as before after refactoring list fucntion.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143310</id>
		<title>CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143310"/>
		<updated>2022-03-21T22:50:24Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2223 OSS assignment for Spring 2022, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is a open source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller &lt;br /&gt;
* Allows an instructor to add/remove topics&lt;br /&gt;
* Allows an instructor to assign/remove students to topics&lt;br /&gt;
* Allows an student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
1. Naming is inconsistent.  When used as a verb, “sign up” is two words.  When an adjective or a noun, it should be one word, e.g., “signup_sheet_controller.”  Cf. “sign_up_as_instructor”.  Please make the naming consistent.  Of course, this will result in changes in calling methods as well.&lt;br /&gt;
&lt;br /&gt;
2. Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]&lt;br /&gt;
&lt;br /&gt;
3. Several method names can be improved (including: load_add_signup_topics, list, ad_info etc.)&lt;br /&gt;
&lt;br /&gt;
4. What are differences between signup_as_instructor and signup_as_instructor_action methods? Investigate if they are needed and improve the method names if both are needed. Provide comments as to what each method does.&lt;br /&gt;
&lt;br /&gt;
5. The list method is too long and is sparsely commented. Provide comments and identify if the method can be split or made cleaner by moving code to models or helper methods.&lt;br /&gt;
&lt;br /&gt;
6. Signup_as_instructor_action has if-else ladder. It can be made more elegant.&lt;br /&gt;
&lt;br /&gt;
7.  Delete_signup and delete_signup_as_instructor have much in common and violate the DRY principle. Refactor.&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed the name of the controller from sign_up_sheet_controller.rb --&amp;gt; signup_sheet_controller.rb. Also changed several method names that had 'sign_up' being used as an adjective or a noun to 'signup'.&lt;br /&gt;
&lt;br /&gt;
2. Changed the create method to only create a new topic if that topic doesn't already exist. If it does exist, the program flashes an error message and backs out. &lt;br /&gt;
&lt;br /&gt;
3. Used a single update_attributes method in place of the many instance variables.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      @topic.topic_identifier = params[:topic][:topic_identifier]&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      @topic.category = params[:topic][:category]&lt;br /&gt;
      @topic.topic_name = params[:topic][:topic_name]&lt;br /&gt;
      @topic.micropayment = params[:topic][:micropayment]&lt;br /&gt;
      @topic.description = params[:topic][:description]&lt;br /&gt;
      @topic.link = params[:topic][:link]&lt;br /&gt;
      @topic.save&lt;br /&gt;
      params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      updated_max_choosers = @topic.max_choosers&lt;br /&gt;
      @topic.update_attributes(topic_identifier: params[:topic][:topic_identifier], max_choosers: updated_max_choosers, category: params[:topic][:category], topic_name: params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The requirement that deadlines be submitted is no longer implemented and therefore a separate function for &amp;quot;staggered&amp;quot; is no longer needed.&lt;br /&gt;
&lt;br /&gt;
5. Ad_info was renamed to ads_for_partners_info to give better picture of what function does. &lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/6507f15f6d23f44900465536a91cc6c80f90ad75&lt;br /&gt;
&lt;br /&gt;
6. signup_as_instructor is not needed and has been removed.&lt;br /&gt;
&lt;br /&gt;
7. The list method is broken into 2 functions. The small part of computing signup topics is created. Also comments has been added to understand the functio better.&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/4b7bb6113dfb8984d7aa4dca467b55f67de3c93a&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/bd86f5a4ec8aa02c27a0cd34c85bd21776feca2c&lt;br /&gt;
https://github.com/palvitgarg99/expertiza/commit/56be9eed8ac89632041608947108f87dfbcb28ab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Refactored the participants variable and improved readability.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(assignment_id, session[:ip])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ip = session[:ip]&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(@id, ip)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.  Previously signup_as_instructor_action provided unhelpful feedback to the instructor by only stating if the instructor could/couldn't assign a topic for a student.  The refactored code provides the instructor with the student id of the person that they are assigning, the team that the student is on, and the topic that the instructor is assigning to the team. &lt;br /&gt;
&lt;br /&gt;
'''Before''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up student for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a student who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'The student is not registered for the assignment: ' &amp;lt;&amp;lt; user.id)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    #put name of student and team in log&lt;br /&gt;
    # flash name of student and team&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    team = Team.find_team_for_assignment_and_user(params[:assignment_id], user.id).first&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = user.name + &amp;quot; does not exist!&amp;quot;&lt;br /&gt;
    else #If the user is not null and the student exists then sign up student for topic&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up &amp;quot; + user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot;  for the topic &amp;quot; + params[:topic_id].to_s&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up ' + user.name + ' on team ' + team.name + ' for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else #If the students team already has a topic then cancel the sign up&lt;br /&gt;
          flash[:error] = user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot; has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a ' + user.name + 'on ' + team.name + ' who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else #If the student isn't a part of the assignment then cancel the sign up&lt;br /&gt;
        flash[:error] = user.name + &amp;quot; is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', user.name + ' is not registered for the assignment: ' + assignment.name)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. delete_signup and delete_signup_as_instructor violated the DRY principle due to both functions using identical if/else statements.  To solve this issue, delete_signup_heleper function was created. &lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], session[:user].id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped your topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for already submitted work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Student has been dropped from the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup_helper(isInstructor, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    messages = [&amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped your topic!&amp;quot;,&lt;br /&gt;
                &amp;quot;The team has already submitted their work, so you are not allowed to remove them.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    ]&lt;br /&gt;
    if isInstructor == false&lt;br /&gt;
      flash1 = messages[0]&lt;br /&gt;
      flash2 = messages[1]&lt;br /&gt;
      flash3 = messages[2]&lt;br /&gt;
      id_param = session[:user]&lt;br /&gt;
    else&lt;br /&gt;
      flash1 = messages[3]&lt;br /&gt;
      flash2 = messages[4]&lt;br /&gt;
      flash3 = messages[5]&lt;br /&gt;
      id_param = participant&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = flash1&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = flash2&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], id_param.id)&lt;br /&gt;
      flash[:success] = flash3&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # this function is used to delete a previous signup&lt;br /&gt;
  def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    delete_signup_helper(false, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    delete_signup_helper(true, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; RSpec &lt;br /&gt;
: signup_as_instructor_action is the only function updated.  All other functions has remained the same.  To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
; Physical Testing&lt;br /&gt;
: &lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Click the Green Check for any topic&lt;br /&gt;
# Enter a student UnityID and click submit&lt;br /&gt;
&lt;br /&gt;
# Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indiactes functionality is as before after refactoring list fucntion.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143278</id>
		<title>CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143278"/>
		<updated>2022-03-21T22:18:53Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb to CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143277</id>
		<title>CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143277"/>
		<updated>2022-03-21T22:18:53Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb to CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2223 OSS assignment for Spring 2022, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is a open source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller &lt;br /&gt;
* Allows an instructor to add/remove topics&lt;br /&gt;
* Allows an instructor to assign/remove students to topics&lt;br /&gt;
* Allows an student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
1. Naming is inconsistent.  When used as a verb, “sign up” is two words.  When an adjective or a noun, it should be one word, e.g., “signup_sheet_controller.”  Cf. “sign_up_as_instructor”.  Please make the naming consistent.  Of course, this will result in changes in calling methods as well.&lt;br /&gt;
&lt;br /&gt;
2. Create method has and if-else condition determining if create or update should be called. Create method should not be responsible for calling update. Identify why the if-else condition exists and rectify it. [This may have already been fixed.]&lt;br /&gt;
&lt;br /&gt;
3. Update method has a plethora of instance variables defined before updating. These might not be necessary (For e.g., look at update method of bookmarks_controller)Decide whether so many instance variables are really needed. Refactor the variables not needed out. [This may have already been fixed, but save_topic_deadline also has these problems.]&lt;br /&gt;
&lt;br /&gt;
4. Add_signup_topics_staggered does not do anything different from add add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set.&lt;br /&gt;
&lt;br /&gt;
5. Several method names can be improved (including: load_add_signup_topics, list, ad_info etc.)&lt;br /&gt;
&lt;br /&gt;
6. What are differences between signup_as_instructor and signup_as_instructor_action methods? Investigate if they are needed and improve the method names if both are needed. Provide comments as to what each method does.&lt;br /&gt;
&lt;br /&gt;
7. The list method is too long and is sparsely commented. Provide comments and identify if the method can be split or made cleaner by moving code to models or helper methods.&lt;br /&gt;
&lt;br /&gt;
8. Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
&lt;br /&gt;
9.  Signup_as_instructor_action has if-else ladder. It can be made more elegant.&lt;br /&gt;
&lt;br /&gt;
10. Delete_signup and delete_signup_as_instructor have much in common and violate the DRY principle. Refactor.&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed the name of the controller from sign_up_sheet_controller.rb --&amp;gt; signup_sheet_controller.rb. Also changed several method names that had 'sign_up' being used as an adjective or a noun to 'signup'.&lt;br /&gt;
&lt;br /&gt;
2. Changed the create method to only create a new topic if that topic doesn't already exist. If it does exist, the program flashes an error message and backs out. &lt;br /&gt;
&lt;br /&gt;
3. Used a single update_attributes method in place of the many instance variables.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      @topic.topic_identifier = params[:topic][:topic_identifier]&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      @topic.category = params[:topic][:category]&lt;br /&gt;
      @topic.topic_name = params[:topic][:topic_name]&lt;br /&gt;
      @topic.micropayment = params[:topic][:micropayment]&lt;br /&gt;
      @topic.description = params[:topic][:description]&lt;br /&gt;
      @topic.link = params[:topic][:link]&lt;br /&gt;
      @topic.save&lt;br /&gt;
      params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      updated_max_choosers = @topic.max_choosers&lt;br /&gt;
      @topic.update_attributes(topic_identifier: params[:topic][:topic_identifier], max_choosers: updated_max_choosers, category: params[:topic][:category], topic_name: params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The requirement that deadlines be submitted is no longer implemented and therefore a separate function for &amp;quot;staggered&amp;quot; is no longer needed.&lt;br /&gt;
&lt;br /&gt;
5.  Load_add_signup_topics was removed and combined with add_signup_topics.  Ad_info was renamed to ads_for_topic and refactored to remove instance variables. &lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_signup_topics&lt;br /&gt;
    load_add_signup_topics(params[:id])&lt;br /&gt;
    SignUpSheet.add_signup_topic(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def add_signup_topics_staggered&lt;br /&gt;
    add_signup_topics&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # retrieves all the data associated with the given assignment. Includes all topics,&lt;br /&gt;
def load_add_signup_topics(assignment_id)&lt;br /&gt;
    @id = assignment_id&lt;br /&gt;
    @sign_up_topics = SignUpTopic.where('assignment_id = ?', assignment_id)&lt;br /&gt;
    @slots_filled = SignUpTopic.find_slots_filled(assignment_id)&lt;br /&gt;
    @slots_waitlisted = SignUpTopic.find_slots_waitlisted(assignment_id)&lt;br /&gt;
&lt;br /&gt;
    @assignment = Assignment.find(assignment_id)&lt;br /&gt;
    # ACS Removed the if condition (and corresponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    # Though called participants, @participants are actually records in signed_up_teams table, which&lt;br /&gt;
    # is a mapping table between teams and topics (waitlisted recored are also counted)&lt;br /&gt;
    ip = session[:ip]&lt;br /&gt;
    @participants = SignedUpTeam.find_team_participants(@id, ip)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def show_team&lt;br /&gt;
    if !(assignment = Assignment.find(params[:assignment_id])).nil? and !(topic = SignUpTopic.find(params[:id])).nil?&lt;br /&gt;
      @results = ad_info(assignment.id, topic.id)&lt;br /&gt;
    .........&lt;br /&gt;
&lt;br /&gt;
def ad_info(_assignment_id, topic_id)&lt;br /&gt;
    # List that contains individual result object&lt;br /&gt;
    @result_list = []&lt;br /&gt;
    # Get the results&lt;br /&gt;
    @results = SignedUpTeam.where(&amp;quot;topic_id = ?&amp;quot;, topic_id.to_s)&lt;br /&gt;
    # Iterate through the results of the query and get the required attributes&lt;br /&gt;
    @results.each do |result|&lt;br /&gt;
      team = result.team&lt;br /&gt;
      topic = result.topic&lt;br /&gt;
      resultMap = {}&lt;br /&gt;
      resultMap[:team_id] = team.id&lt;br /&gt;
      resultMap[:comments_for_advertisement] = team.comments_for_advertisement&lt;br /&gt;
      resultMap[:name] = team.name&lt;br /&gt;
      resultMap[:assignment_id] = topic.assignment_id&lt;br /&gt;
      resultMap[:advertise_for_partner] = team.advertise_for_partner&lt;br /&gt;
&lt;br /&gt;
      # Append to the list&lt;br /&gt;
      @result_list.append(resultMap)&lt;br /&gt;
    end&lt;br /&gt;
    @result_list&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def add_signup_topics&lt;br /&gt;
    / load_add_signup_topics(params[:id])/&lt;br /&gt;
    # retrieves all the data associated with the given assignment. Includes all topics,&lt;br /&gt;
    @id = params[:id]&lt;br /&gt;
    @sign_up_topics = SignUpTopic.where('assignment_id = ?', params[:id])&lt;br /&gt;
    @slots_filled = SignUpTopic.find_slots_filled(params[:id])&lt;br /&gt;
    @slots_waitlisted = SignUpTopic.find_slots_waitlisted(params[:id])&lt;br /&gt;
&lt;br /&gt;
    @assignment = Assignment.find(params[:id])&lt;br /&gt;
    # ACS Removed the if condition (and corresponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    # Though called participants, @participants are actually records in signed_up_teams table, which&lt;br /&gt;
    # is a mapping table between teams and topics (waitlisted recored are also counted)&lt;br /&gt;
    @participants = SignedUpTeam.find_team_participants(params[:id], session[:ip])&lt;br /&gt;
    SignUpSheet.add_signup_topic(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def add_signup_topics_staggered&lt;br /&gt;
    add_signup_topics&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def show_team&lt;br /&gt;
    if !(assignment = Assignment.find(params[:assignment_id])).nil? and !(topic = SignUpTopic.find(params[:id])).nil?&lt;br /&gt;
      @results = ads_for_topic(assignment.id, topic.id)&lt;br /&gt;
    .........&lt;br /&gt;
&lt;br /&gt;
def ads_for_topic(_assignment_id, topic_id)&lt;br /&gt;
    # List that contains individual result object&lt;br /&gt;
    ads = []&lt;br /&gt;
    # Get the results&lt;br /&gt;
    signed_up_teams = SignedUpTeam.where(&amp;quot;topic_id = ?&amp;quot;, topic_id.to_s)&lt;br /&gt;
    # Iterate through the results of the query and get the required attributes&lt;br /&gt;
    signed_up_teams.each do |result|&lt;br /&gt;
      team = result.team&lt;br /&gt;
      topic = result.topic&lt;br /&gt;
      new_ad = {}&lt;br /&gt;
      new_ad[:team_id] = team.id&lt;br /&gt;
      new_ad[:comments_for_advertisement] = team.comments_for_advertisement&lt;br /&gt;
      new_ad[:name] = team.name&lt;br /&gt;
      new_ad[:assignment_id] = topic.assignment_id&lt;br /&gt;
      new_ad[:advertise_for_partner] = team.advertise_for_partner&lt;br /&gt;
&lt;br /&gt;
      # Append to the list&lt;br /&gt;
      ads.append(new_ad)&lt;br /&gt;
    end&lt;br /&gt;
    ads&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. signup_as_instructor is not needed and has been removed.&lt;br /&gt;
&lt;br /&gt;
7. Comments on the list method have been provided, but the code is best left in the list method.&lt;br /&gt;
&lt;br /&gt;
8. Refactored the participants variable and improved readability.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(assignment_id, session[:ip])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ip = session[:ip]&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(@id, ip)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.  Previously signup_as_instructor_action provided unhelpful feedback to the instructor by only stating if the instructor could/couldn't assign a topic for a student.  The refactored code provides the instructor with the student id of the person that they are assigning, the team that the student is on, and the topic that the instructor is assigning to the team. &lt;br /&gt;
&lt;br /&gt;
'''Before''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up student for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a student who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'The student is not registered for the assignment: ' &amp;lt;&amp;lt; user.id)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    #put name of student and team in log&lt;br /&gt;
    # flash name of student and team&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    team = Team.find_team_for_assignment_and_user(params[:assignment_id], user.id).first&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = user.name + &amp;quot; does not exist!&amp;quot;&lt;br /&gt;
    else #If the user is not null and the student exists then sign up student for topic&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up &amp;quot; + user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot;  for the topic &amp;quot; + params[:topic_id].to_s&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up ' + user.name + ' on team ' + team.name + ' for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else #If the students team already has a topic then cancel the sign up&lt;br /&gt;
          flash[:error] = user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot; has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a ' + user.name + 'on ' + team.name + ' who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else #If the student isn't a part of the assignment then cancel the sign up&lt;br /&gt;
        flash[:error] = user.name + &amp;quot; is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', user.name + ' is not registered for the assignment: ' + assignment.name)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. delete_signup and delete_signup_as_instructor violated the DRY principle due to both functions using identical if/else statements.  To solve this issue, delete_signup_heleper function was created. &lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], session[:user].id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped your topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for already submitted work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Student has been dropped from the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup_helper(isInstructor, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    messages = [&amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped your topic!&amp;quot;,&lt;br /&gt;
                &amp;quot;The team has already submitted their work, so you are not allowed to remove them.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    ]&lt;br /&gt;
    if isInstructor == false&lt;br /&gt;
      flash1 = messages[0]&lt;br /&gt;
      flash2 = messages[1]&lt;br /&gt;
      flash3 = messages[2]&lt;br /&gt;
      id_param = session[:user]&lt;br /&gt;
    else&lt;br /&gt;
      flash1 = messages[3]&lt;br /&gt;
      flash2 = messages[4]&lt;br /&gt;
      flash3 = messages[5]&lt;br /&gt;
      id_param = participant&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = flash1&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = flash2&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], id_param.id)&lt;br /&gt;
      flash[:success] = flash3&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # this function is used to delete a previous signup&lt;br /&gt;
  def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    delete_signup_helper(false, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    delete_signup_helper(true, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; RSpec &lt;br /&gt;
: signup_as_instructor_action is the only function updated.  All other functions has remained the same.  To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
; Physical Testing&lt;br /&gt;
: &lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Click the Green Check for any topic&lt;br /&gt;
# Enter a student UnityID and click submit&lt;br /&gt;
&lt;br /&gt;
# Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indiactes functionality is as before after refactoring list fucntion.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=143273</id>
		<title>CSC/ECE 517 Spring 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=143273"/>
		<updated>2022-03-21T22:16:16Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2200: Testing advice_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2203: Adding tests for courses_controller, eula_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2204: Adding tests for markup_styles_controller, lock_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2203: Testing for submission_records_controller, profile_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2218: Refactor response_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2216: Refactor late_policies_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2215: Refactor student_quizzes_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2214: Refactor teams_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2219: Improve assessment360_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2211: Testing for summary_helper]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2225: Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2221: Refactor submitted content controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2206: Testing for users_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2205: Testing for participants_controller, versions_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2212: Testing for hamer.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2200: Refactoring evaluation of SQL queries (Java/JUnit)]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2222: Refactor impersonate_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2202- Testing for badges_controller, publishing_controller]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2022 - E2220: Refactor reputation_web_service_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2224: Refactor review_mapping_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2209: Testing for analytic helper.rb, join team requests helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2227: SQL Injection Fix]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_Wiki:CSC/ECE_517_Fall_2021_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143272</id>
		<title>Expertiza Wiki:CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_Wiki:CSC/ECE_517_Fall_2021_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143272"/>
		<updated>2022-03-21T22:15:03Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page PG Wiki:CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb to CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb]]&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143271</id>
		<title>CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143271"/>
		<updated>2022-03-21T22:15:03Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page PG Wiki:CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb to CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2223 OSS assignment for Spring 2022, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is a open source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller &lt;br /&gt;
* Allows an instructor to add/remove topics&lt;br /&gt;
* Allows an instructor to assign/remove students to topics&lt;br /&gt;
* Allows an student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
1. Naming is inconsistent.  When used as a verb, “sign up” is two words.  When an adjective or a noun, it should be one word, e.g., “signup_sheet_controller.”  Cf. “sign_up_as_instructor”.  Please make the naming consistent.  Of course, this will result in changes in calling methods as well.&lt;br /&gt;
&lt;br /&gt;
2. Create method has and if-else condition determining if create or update should be called. Create method should not be responsible for calling update. Identify why the if-else condition exists and rectify it. [This may have already been fixed.]&lt;br /&gt;
&lt;br /&gt;
3. Update method has a plethora of instance variables defined before updating. These might not be necessary (For e.g., look at update method of bookmarks_controller)Decide whether so many instance variables are really needed. Refactor the variables not needed out. [This may have already been fixed, but save_topic_deadline also has these problems.]&lt;br /&gt;
&lt;br /&gt;
4. Add_signup_topics_staggered does not do anything different from add add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set.&lt;br /&gt;
&lt;br /&gt;
5. Several method names can be improved (including: load_add_signup_topics, list, ad_info etc.)&lt;br /&gt;
&lt;br /&gt;
6. What are differences between signup_as_instructor and signup_as_instructor_action methods? Investigate if they are needed and improve the method names if both are needed. Provide comments as to what each method does.&lt;br /&gt;
&lt;br /&gt;
7. The list method is too long and is sparsely commented. Provide comments and identify if the method can be split or made cleaner by moving code to models or helper methods.&lt;br /&gt;
&lt;br /&gt;
8. Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
&lt;br /&gt;
9.  Signup_as_instructor_action has if-else ladder. It can be made more elegant.&lt;br /&gt;
&lt;br /&gt;
10. Delete_signup and delete_signup_as_instructor have much in common and violate the DRY principle. Refactor.&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed the name of the controller from sign_up_sheet_controller.rb --&amp;gt; signup_sheet_controller.rb. Also changed several method names that had 'sign_up' being used as an adjective or a noun to 'signup'.&lt;br /&gt;
&lt;br /&gt;
2. Changed the create method to only create a new topic if that topic doesn't already exist. If it does exist, the program flashes an error message and backs out. &lt;br /&gt;
&lt;br /&gt;
3. Used a single update_attributes method in place of the many instance variables.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      @topic.topic_identifier = params[:topic][:topic_identifier]&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      @topic.category = params[:topic][:category]&lt;br /&gt;
      @topic.topic_name = params[:topic][:topic_name]&lt;br /&gt;
      @topic.micropayment = params[:topic][:micropayment]&lt;br /&gt;
      @topic.description = params[:topic][:description]&lt;br /&gt;
      @topic.link = params[:topic][:link]&lt;br /&gt;
      @topic.save&lt;br /&gt;
      params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      updated_max_choosers = @topic.max_choosers&lt;br /&gt;
      @topic.update_attributes(topic_identifier: params[:topic][:topic_identifier], max_choosers: updated_max_choosers, category: params[:topic][:category], topic_name: params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The requirement that deadlines be submitted is no longer implemented and therefore a separate function for &amp;quot;staggered&amp;quot; is no longer needed.&lt;br /&gt;
&lt;br /&gt;
5.  Load_add_signup_topics was removed and combined with add_signup_topics.  Ad_info was renamed to ads_for_topic and refactored to remove instance variables. &lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_signup_topics&lt;br /&gt;
    load_add_signup_topics(params[:id])&lt;br /&gt;
    SignUpSheet.add_signup_topic(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def add_signup_topics_staggered&lt;br /&gt;
    add_signup_topics&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # retrieves all the data associated with the given assignment. Includes all topics,&lt;br /&gt;
def load_add_signup_topics(assignment_id)&lt;br /&gt;
    @id = assignment_id&lt;br /&gt;
    @sign_up_topics = SignUpTopic.where('assignment_id = ?', assignment_id)&lt;br /&gt;
    @slots_filled = SignUpTopic.find_slots_filled(assignment_id)&lt;br /&gt;
    @slots_waitlisted = SignUpTopic.find_slots_waitlisted(assignment_id)&lt;br /&gt;
&lt;br /&gt;
    @assignment = Assignment.find(assignment_id)&lt;br /&gt;
    # ACS Removed the if condition (and corresponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    # Though called participants, @participants are actually records in signed_up_teams table, which&lt;br /&gt;
    # is a mapping table between teams and topics (waitlisted recored are also counted)&lt;br /&gt;
    ip = session[:ip]&lt;br /&gt;
    @participants = SignedUpTeam.find_team_participants(@id, ip)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def show_team&lt;br /&gt;
    if !(assignment = Assignment.find(params[:assignment_id])).nil? and !(topic = SignUpTopic.find(params[:id])).nil?&lt;br /&gt;
      @results = ad_info(assignment.id, topic.id)&lt;br /&gt;
    .........&lt;br /&gt;
&lt;br /&gt;
def ad_info(_assignment_id, topic_id)&lt;br /&gt;
    # List that contains individual result object&lt;br /&gt;
    @result_list = []&lt;br /&gt;
    # Get the results&lt;br /&gt;
    @results = SignedUpTeam.where(&amp;quot;topic_id = ?&amp;quot;, topic_id.to_s)&lt;br /&gt;
    # Iterate through the results of the query and get the required attributes&lt;br /&gt;
    @results.each do |result|&lt;br /&gt;
      team = result.team&lt;br /&gt;
      topic = result.topic&lt;br /&gt;
      resultMap = {}&lt;br /&gt;
      resultMap[:team_id] = team.id&lt;br /&gt;
      resultMap[:comments_for_advertisement] = team.comments_for_advertisement&lt;br /&gt;
      resultMap[:name] = team.name&lt;br /&gt;
      resultMap[:assignment_id] = topic.assignment_id&lt;br /&gt;
      resultMap[:advertise_for_partner] = team.advertise_for_partner&lt;br /&gt;
&lt;br /&gt;
      # Append to the list&lt;br /&gt;
      @result_list.append(resultMap)&lt;br /&gt;
    end&lt;br /&gt;
    @result_list&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def add_signup_topics&lt;br /&gt;
    / load_add_signup_topics(params[:id])/&lt;br /&gt;
    # retrieves all the data associated with the given assignment. Includes all topics,&lt;br /&gt;
    @id = params[:id]&lt;br /&gt;
    @sign_up_topics = SignUpTopic.where('assignment_id = ?', params[:id])&lt;br /&gt;
    @slots_filled = SignUpTopic.find_slots_filled(params[:id])&lt;br /&gt;
    @slots_waitlisted = SignUpTopic.find_slots_waitlisted(params[:id])&lt;br /&gt;
&lt;br /&gt;
    @assignment = Assignment.find(params[:id])&lt;br /&gt;
    # ACS Removed the if condition (and corresponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    # Though called participants, @participants are actually records in signed_up_teams table, which&lt;br /&gt;
    # is a mapping table between teams and topics (waitlisted recored are also counted)&lt;br /&gt;
    @participants = SignedUpTeam.find_team_participants(params[:id], session[:ip])&lt;br /&gt;
    SignUpSheet.add_signup_topic(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def add_signup_topics_staggered&lt;br /&gt;
    add_signup_topics&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def show_team&lt;br /&gt;
    if !(assignment = Assignment.find(params[:assignment_id])).nil? and !(topic = SignUpTopic.find(params[:id])).nil?&lt;br /&gt;
      @results = ads_for_topic(assignment.id, topic.id)&lt;br /&gt;
    .........&lt;br /&gt;
&lt;br /&gt;
def ads_for_topic(_assignment_id, topic_id)&lt;br /&gt;
    # List that contains individual result object&lt;br /&gt;
    ads = []&lt;br /&gt;
    # Get the results&lt;br /&gt;
    signed_up_teams = SignedUpTeam.where(&amp;quot;topic_id = ?&amp;quot;, topic_id.to_s)&lt;br /&gt;
    # Iterate through the results of the query and get the required attributes&lt;br /&gt;
    signed_up_teams.each do |result|&lt;br /&gt;
      team = result.team&lt;br /&gt;
      topic = result.topic&lt;br /&gt;
      new_ad = {}&lt;br /&gt;
      new_ad[:team_id] = team.id&lt;br /&gt;
      new_ad[:comments_for_advertisement] = team.comments_for_advertisement&lt;br /&gt;
      new_ad[:name] = team.name&lt;br /&gt;
      new_ad[:assignment_id] = topic.assignment_id&lt;br /&gt;
      new_ad[:advertise_for_partner] = team.advertise_for_partner&lt;br /&gt;
&lt;br /&gt;
      # Append to the list&lt;br /&gt;
      ads.append(new_ad)&lt;br /&gt;
    end&lt;br /&gt;
    ads&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. signup_as_instructor is not needed and has been removed.&lt;br /&gt;
&lt;br /&gt;
7. Comments on the list method have been provided, but the code is best left in the list method.&lt;br /&gt;
&lt;br /&gt;
8. Refactored the participants variable and improved readability.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(assignment_id, session[:ip])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ip = session[:ip]&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(@id, ip)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.  Previously signup_as_instructor_action provided unhelpful feedback to the instructor by only stating if the instructor could/couldn't assign a topic for a student.  The refactored code provides the instructor with the student id of the person that they are assigning, the team that the student is on, and the topic that the instructor is assigning to the team. &lt;br /&gt;
&lt;br /&gt;
'''Before''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up student for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a student who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'The student is not registered for the assignment: ' &amp;lt;&amp;lt; user.id)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    #put name of student and team in log&lt;br /&gt;
    # flash name of student and team&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    team = Team.find_team_for_assignment_and_user(params[:assignment_id], user.id).first&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = user.name + &amp;quot; does not exist!&amp;quot;&lt;br /&gt;
    else #If the user is not null and the student exists then sign up student for topic&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up &amp;quot; + user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot;  for the topic &amp;quot; + params[:topic_id].to_s&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up ' + user.name + ' on team ' + team.name + ' for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else #If the students team already has a topic then cancel the sign up&lt;br /&gt;
          flash[:error] = user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot; has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a ' + user.name + 'on ' + team.name + ' who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else #If the student isn't a part of the assignment then cancel the sign up&lt;br /&gt;
        flash[:error] = user.name + &amp;quot; is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', user.name + ' is not registered for the assignment: ' + assignment.name)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. delete_signup and delete_signup_as_instructor violated the DRY principle due to both functions using identical if/else statements.  To solve this issue, delete_signup_heleper function was created. &lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], session[:user].id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped your topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for already submitted work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Student has been dropped from the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup_helper(isInstructor, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    messages = [&amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped your topic!&amp;quot;,&lt;br /&gt;
                &amp;quot;The team has already submitted their work, so you are not allowed to remove them.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    ]&lt;br /&gt;
    if isInstructor == false&lt;br /&gt;
      flash1 = messages[0]&lt;br /&gt;
      flash2 = messages[1]&lt;br /&gt;
      flash3 = messages[2]&lt;br /&gt;
      id_param = session[:user]&lt;br /&gt;
    else&lt;br /&gt;
      flash1 = messages[3]&lt;br /&gt;
      flash2 = messages[4]&lt;br /&gt;
      flash3 = messages[5]&lt;br /&gt;
      id_param = participant&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = flash1&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = flash2&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], id_param.id)&lt;br /&gt;
      flash[:success] = flash3&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # this function is used to delete a previous signup&lt;br /&gt;
  def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    delete_signup_helper(false, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    delete_signup_helper(true, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; RSpec &lt;br /&gt;
: signup_as_instructor_action is the only function updated.  All other functions has remained the same.  To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
; Physical Testing&lt;br /&gt;
: &lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Click the Green Check for any topic&lt;br /&gt;
# Enter a student UnityID and click submit&lt;br /&gt;
&lt;br /&gt;
# Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indiactes functionality is as before after refactoring list fucntion.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Pgarg5&amp;diff=143269</id>
		<title>User:Pgarg5</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Pgarg5&amp;diff=143269"/>
		<updated>2022-03-21T22:14:31Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page User:Pgarg5 to PG Wiki:CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[PG Wiki:CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb]]&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143268</id>
		<title>CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143268"/>
		<updated>2022-03-21T22:14:31Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: Pgarg5 moved page User:Pgarg5 to PG Wiki:CSC/ECE 517 Fall 2021 - E2223. Refactor sign up sheet controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2223 OSS assignment for Spring 2022, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is a open source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller &lt;br /&gt;
* Allows an instructor to add/remove topics&lt;br /&gt;
* Allows an instructor to assign/remove students to topics&lt;br /&gt;
* Allows an student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
1. Naming is inconsistent.  When used as a verb, “sign up” is two words.  When an adjective or a noun, it should be one word, e.g., “signup_sheet_controller.”  Cf. “sign_up_as_instructor”.  Please make the naming consistent.  Of course, this will result in changes in calling methods as well.&lt;br /&gt;
&lt;br /&gt;
2. Create method has and if-else condition determining if create or update should be called. Create method should not be responsible for calling update. Identify why the if-else condition exists and rectify it. [This may have already been fixed.]&lt;br /&gt;
&lt;br /&gt;
3. Update method has a plethora of instance variables defined before updating. These might not be necessary (For e.g., look at update method of bookmarks_controller)Decide whether so many instance variables are really needed. Refactor the variables not needed out. [This may have already been fixed, but save_topic_deadline also has these problems.]&lt;br /&gt;
&lt;br /&gt;
4. Add_signup_topics_staggered does not do anything different from add add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set.&lt;br /&gt;
&lt;br /&gt;
5. Several method names can be improved (including: load_add_signup_topics, list, ad_info etc.)&lt;br /&gt;
&lt;br /&gt;
6. What are differences between signup_as_instructor and signup_as_instructor_action methods? Investigate if they are needed and improve the method names if both are needed. Provide comments as to what each method does.&lt;br /&gt;
&lt;br /&gt;
7. The list method is too long and is sparsely commented. Provide comments and identify if the method can be split or made cleaner by moving code to models or helper methods.&lt;br /&gt;
&lt;br /&gt;
8. Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
&lt;br /&gt;
9.  Signup_as_instructor_action has if-else ladder. It can be made more elegant.&lt;br /&gt;
&lt;br /&gt;
10. Delete_signup and delete_signup_as_instructor have much in common and violate the DRY principle. Refactor.&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed the name of the controller from sign_up_sheet_controller.rb --&amp;gt; signup_sheet_controller.rb. Also changed several method names that had 'sign_up' being used as an adjective or a noun to 'signup'.&lt;br /&gt;
&lt;br /&gt;
2. Changed the create method to only create a new topic if that topic doesn't already exist. If it does exist, the program flashes an error message and backs out. &lt;br /&gt;
&lt;br /&gt;
3. Used a single update_attributes method in place of the many instance variables.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      @topic.topic_identifier = params[:topic][:topic_identifier]&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      @topic.category = params[:topic][:category]&lt;br /&gt;
      @topic.topic_name = params[:topic][:topic_name]&lt;br /&gt;
      @topic.micropayment = params[:topic][:micropayment]&lt;br /&gt;
      @topic.description = params[:topic][:description]&lt;br /&gt;
      @topic.link = params[:topic][:link]&lt;br /&gt;
      @topic.save&lt;br /&gt;
      params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      updated_max_choosers = @topic.max_choosers&lt;br /&gt;
      @topic.update_attributes(topic_identifier: params[:topic][:topic_identifier], max_choosers: updated_max_choosers, category: params[:topic][:category], topic_name: params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The requirement that deadlines be submitted is no longer implemented and therefore a separate function for &amp;quot;staggered&amp;quot; is no longer needed.&lt;br /&gt;
&lt;br /&gt;
5.  Load_add_signup_topics was removed and combined with add_signup_topics.  Ad_info was renamed to ads_for_topic and refactored to remove instance variables. &lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_signup_topics&lt;br /&gt;
    load_add_signup_topics(params[:id])&lt;br /&gt;
    SignUpSheet.add_signup_topic(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def add_signup_topics_staggered&lt;br /&gt;
    add_signup_topics&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # retrieves all the data associated with the given assignment. Includes all topics,&lt;br /&gt;
def load_add_signup_topics(assignment_id)&lt;br /&gt;
    @id = assignment_id&lt;br /&gt;
    @sign_up_topics = SignUpTopic.where('assignment_id = ?', assignment_id)&lt;br /&gt;
    @slots_filled = SignUpTopic.find_slots_filled(assignment_id)&lt;br /&gt;
    @slots_waitlisted = SignUpTopic.find_slots_waitlisted(assignment_id)&lt;br /&gt;
&lt;br /&gt;
    @assignment = Assignment.find(assignment_id)&lt;br /&gt;
    # ACS Removed the if condition (and corresponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    # Though called participants, @participants are actually records in signed_up_teams table, which&lt;br /&gt;
    # is a mapping table between teams and topics (waitlisted recored are also counted)&lt;br /&gt;
    ip = session[:ip]&lt;br /&gt;
    @participants = SignedUpTeam.find_team_participants(@id, ip)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def show_team&lt;br /&gt;
    if !(assignment = Assignment.find(params[:assignment_id])).nil? and !(topic = SignUpTopic.find(params[:id])).nil?&lt;br /&gt;
      @results = ad_info(assignment.id, topic.id)&lt;br /&gt;
    .........&lt;br /&gt;
&lt;br /&gt;
def ad_info(_assignment_id, topic_id)&lt;br /&gt;
    # List that contains individual result object&lt;br /&gt;
    @result_list = []&lt;br /&gt;
    # Get the results&lt;br /&gt;
    @results = SignedUpTeam.where(&amp;quot;topic_id = ?&amp;quot;, topic_id.to_s)&lt;br /&gt;
    # Iterate through the results of the query and get the required attributes&lt;br /&gt;
    @results.each do |result|&lt;br /&gt;
      team = result.team&lt;br /&gt;
      topic = result.topic&lt;br /&gt;
      resultMap = {}&lt;br /&gt;
      resultMap[:team_id] = team.id&lt;br /&gt;
      resultMap[:comments_for_advertisement] = team.comments_for_advertisement&lt;br /&gt;
      resultMap[:name] = team.name&lt;br /&gt;
      resultMap[:assignment_id] = topic.assignment_id&lt;br /&gt;
      resultMap[:advertise_for_partner] = team.advertise_for_partner&lt;br /&gt;
&lt;br /&gt;
      # Append to the list&lt;br /&gt;
      @result_list.append(resultMap)&lt;br /&gt;
    end&lt;br /&gt;
    @result_list&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def add_signup_topics&lt;br /&gt;
    / load_add_signup_topics(params[:id])/&lt;br /&gt;
    # retrieves all the data associated with the given assignment. Includes all topics,&lt;br /&gt;
    @id = params[:id]&lt;br /&gt;
    @sign_up_topics = SignUpTopic.where('assignment_id = ?', params[:id])&lt;br /&gt;
    @slots_filled = SignUpTopic.find_slots_filled(params[:id])&lt;br /&gt;
    @slots_waitlisted = SignUpTopic.find_slots_waitlisted(params[:id])&lt;br /&gt;
&lt;br /&gt;
    @assignment = Assignment.find(params[:id])&lt;br /&gt;
    # ACS Removed the if condition (and corresponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    # Though called participants, @participants are actually records in signed_up_teams table, which&lt;br /&gt;
    # is a mapping table between teams and topics (waitlisted recored are also counted)&lt;br /&gt;
    @participants = SignedUpTeam.find_team_participants(params[:id], session[:ip])&lt;br /&gt;
    SignUpSheet.add_signup_topic(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def add_signup_topics_staggered&lt;br /&gt;
    add_signup_topics&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def show_team&lt;br /&gt;
    if !(assignment = Assignment.find(params[:assignment_id])).nil? and !(topic = SignUpTopic.find(params[:id])).nil?&lt;br /&gt;
      @results = ads_for_topic(assignment.id, topic.id)&lt;br /&gt;
    .........&lt;br /&gt;
&lt;br /&gt;
def ads_for_topic(_assignment_id, topic_id)&lt;br /&gt;
    # List that contains individual result object&lt;br /&gt;
    ads = []&lt;br /&gt;
    # Get the results&lt;br /&gt;
    signed_up_teams = SignedUpTeam.where(&amp;quot;topic_id = ?&amp;quot;, topic_id.to_s)&lt;br /&gt;
    # Iterate through the results of the query and get the required attributes&lt;br /&gt;
    signed_up_teams.each do |result|&lt;br /&gt;
      team = result.team&lt;br /&gt;
      topic = result.topic&lt;br /&gt;
      new_ad = {}&lt;br /&gt;
      new_ad[:team_id] = team.id&lt;br /&gt;
      new_ad[:comments_for_advertisement] = team.comments_for_advertisement&lt;br /&gt;
      new_ad[:name] = team.name&lt;br /&gt;
      new_ad[:assignment_id] = topic.assignment_id&lt;br /&gt;
      new_ad[:advertise_for_partner] = team.advertise_for_partner&lt;br /&gt;
&lt;br /&gt;
      # Append to the list&lt;br /&gt;
      ads.append(new_ad)&lt;br /&gt;
    end&lt;br /&gt;
    ads&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. signup_as_instructor is not needed and has been removed.&lt;br /&gt;
&lt;br /&gt;
7. Comments on the list method have been provided, but the code is best left in the list method.&lt;br /&gt;
&lt;br /&gt;
8. Refactored the participants variable and improved readability.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(assignment_id, session[:ip])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ip = session[:ip]&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(@id, ip)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.  Previously signup_as_instructor_action provided unhelpful feedback to the instructor by only stating if the instructor could/couldn't assign a topic for a student.  The refactored code provides the instructor with the student id of the person that they are assigning, the team that the student is on, and the topic that the instructor is assigning to the team. &lt;br /&gt;
&lt;br /&gt;
'''Before''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up student for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a student who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'The student is not registered for the assignment: ' &amp;lt;&amp;lt; user.id)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    #put name of student and team in log&lt;br /&gt;
    # flash name of student and team&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    team = Team.find_team_for_assignment_and_user(params[:assignment_id], user.id).first&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = user.name + &amp;quot; does not exist!&amp;quot;&lt;br /&gt;
    else #If the user is not null and the student exists then sign up student for topic&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up &amp;quot; + user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot;  for the topic &amp;quot; + params[:topic_id].to_s&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up ' + user.name + ' on team ' + team.name + ' for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else #If the students team already has a topic then cancel the sign up&lt;br /&gt;
          flash[:error] = user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot; has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a ' + user.name + 'on ' + team.name + ' who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else #If the student isn't a part of the assignment then cancel the sign up&lt;br /&gt;
        flash[:error] = user.name + &amp;quot; is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', user.name + ' is not registered for the assignment: ' + assignment.name)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. delete_signup and delete_signup_as_instructor violated the DRY principle due to both functions using identical if/else statements.  To solve this issue, delete_signup_heleper function was created. &lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], session[:user].id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped your topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for already submitted work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Student has been dropped from the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup_helper(isInstructor, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    messages = [&amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped your topic!&amp;quot;,&lt;br /&gt;
                &amp;quot;The team has already submitted their work, so you are not allowed to remove them.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    ]&lt;br /&gt;
    if isInstructor == false&lt;br /&gt;
      flash1 = messages[0]&lt;br /&gt;
      flash2 = messages[1]&lt;br /&gt;
      flash3 = messages[2]&lt;br /&gt;
      id_param = session[:user]&lt;br /&gt;
    else&lt;br /&gt;
      flash1 = messages[3]&lt;br /&gt;
      flash2 = messages[4]&lt;br /&gt;
      flash3 = messages[5]&lt;br /&gt;
      id_param = participant&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = flash1&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = flash2&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], id_param.id)&lt;br /&gt;
      flash[:success] = flash3&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # this function is used to delete a previous signup&lt;br /&gt;
  def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    delete_signup_helper(false, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    delete_signup_helper(true, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; RSpec &lt;br /&gt;
: signup_as_instructor_action is the only function updated.  All other functions has remained the same.  To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
; Physical Testing&lt;br /&gt;
: &lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Click the Green Check for any topic&lt;br /&gt;
# Enter a student UnityID and click submit&lt;br /&gt;
&lt;br /&gt;
# Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indiactes functionality is as before after refactoring list fucntion.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143216</id>
		<title>CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2223._Refactor_sign_up_sheet_controller.rb&amp;diff=143216"/>
		<updated>2022-03-21T21:07:47Z</updated>

		<summary type="html">&lt;p&gt;Pgarg5: CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the information regarding the changes made for the E2223 OSS assignment for Spring 2022, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Expertiza is a open source project developed on Ruby on Rails.  This web application is maintained by the student and faculty at NC State.  This application gives complete control to the instructor to maintain the assignments in their class.  With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well developed application that can handle all types of assignments.  To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller &lt;br /&gt;
* Allows an instructor to add/remove topics&lt;br /&gt;
* Allows an instructor to assign/remove students to topics&lt;br /&gt;
* Allows an student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
1. Naming is inconsistent.  When used as a verb, “sign up” is two words.  When an adjective or a noun, it should be one word, e.g., “signup_sheet_controller.”  Cf. “sign_up_as_instructor”.  Please make the naming consistent.  Of course, this will result in changes in calling methods as well.&lt;br /&gt;
&lt;br /&gt;
2. Create method has and if-else condition determining if create or update should be called. Create method should not be responsible for calling update. Identify why the if-else condition exists and rectify it. [This may have already been fixed.]&lt;br /&gt;
&lt;br /&gt;
3. Update method has a plethora of instance variables defined before updating. These might not be necessary (For e.g., look at update method of bookmarks_controller)Decide whether so many instance variables are really needed. Refactor the variables not needed out. [This may have already been fixed, but save_topic_deadline also has these problems.]&lt;br /&gt;
&lt;br /&gt;
4. Add_signup_topics_staggered does not do anything different from add add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set.&lt;br /&gt;
&lt;br /&gt;
5. Several method names can be improved (including: load_add_signup_topics, list, ad_info etc.)&lt;br /&gt;
&lt;br /&gt;
6. What are differences between signup_as_instructor and signup_as_instructor_action methods? Investigate if they are needed and improve the method names if both are needed. Provide comments as to what each method does.&lt;br /&gt;
&lt;br /&gt;
7. The list method is too long and is sparsely commented. Provide comments and identify if the method can be split or made cleaner by moving code to models or helper methods.&lt;br /&gt;
&lt;br /&gt;
8. Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
&lt;br /&gt;
9.  Signup_as_instructor_action has if-else ladder. It can be made more elegant.&lt;br /&gt;
&lt;br /&gt;
10. Delete_signup and delete_signup_as_instructor have much in common and violate the DRY principle. Refactor.&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
1. Changed the name of the controller from sign_up_sheet_controller.rb --&amp;gt; signup_sheet_controller.rb. Also changed several method names that had 'sign_up' being used as an adjective or a noun to 'signup'.&lt;br /&gt;
&lt;br /&gt;
2. Changed the create method to only create a new topic if that topic doesn't already exist. If it does exist, the program flashes an error message and backs out. &lt;br /&gt;
&lt;br /&gt;
3. Used a single update_attributes method in place of the many instance variables.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      @topic.topic_identifier = params[:topic][:topic_identifier]&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      @topic.category = params[:topic][:category]&lt;br /&gt;
      @topic.topic_name = params[:topic][:topic_name]&lt;br /&gt;
      @topic.micropayment = params[:topic][:micropayment]&lt;br /&gt;
      @topic.description = params[:topic][:description]&lt;br /&gt;
      @topic.link = params[:topic][:link]&lt;br /&gt;
      @topic.save&lt;br /&gt;
      params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update&lt;br /&gt;
    @topic = SignUpTopic.find(params[:id])&lt;br /&gt;
    if @topic&lt;br /&gt;
      update_max_choosers @topic&lt;br /&gt;
      updated_max_choosers = @topic.max_choosers&lt;br /&gt;
      @topic.update_attributes(topic_identifier: params[:topic][:topic_identifier], max_choosers: updated_max_choosers, category: params[:topic][:category], topic_name: params[:topic][:topic_name], micropayment: params[:topic][:micropayment], description: params[:topic][:description], link: params[:topic][:link])&lt;br /&gt;
      undo_link(&amp;quot;The topic: \&amp;quot;#{@topic.topic_name}\&amp;quot; has been successfully updated. &amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;The topic could not be updated.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    # Akshay - correctly changing the redirection url to topics tab in edit assignment view.&lt;br /&gt;
    redirect_to edit_assignment_path(params[:assignment_id]) + &amp;quot;#tabs-2&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The requirement that deadlines be submitted is no longer implemented and therefore a separate function for &amp;quot;staggered&amp;quot; is no longer needed.&lt;br /&gt;
&lt;br /&gt;
5.  Load_add_signup_topics was removed and combined with add_signup_topics.  Ad_info was renamed to ads_for_topic and refactored to remove instance variables. &lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_signup_topics&lt;br /&gt;
    load_add_signup_topics(params[:id])&lt;br /&gt;
    SignUpSheet.add_signup_topic(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def add_signup_topics_staggered&lt;br /&gt;
    add_signup_topics&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # retrieves all the data associated with the given assignment. Includes all topics,&lt;br /&gt;
def load_add_signup_topics(assignment_id)&lt;br /&gt;
    @id = assignment_id&lt;br /&gt;
    @sign_up_topics = SignUpTopic.where('assignment_id = ?', assignment_id)&lt;br /&gt;
    @slots_filled = SignUpTopic.find_slots_filled(assignment_id)&lt;br /&gt;
    @slots_waitlisted = SignUpTopic.find_slots_waitlisted(assignment_id)&lt;br /&gt;
&lt;br /&gt;
    @assignment = Assignment.find(assignment_id)&lt;br /&gt;
    # ACS Removed the if condition (and corresponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    # Though called participants, @participants are actually records in signed_up_teams table, which&lt;br /&gt;
    # is a mapping table between teams and topics (waitlisted recored are also counted)&lt;br /&gt;
    ip = session[:ip]&lt;br /&gt;
    @participants = SignedUpTeam.find_team_participants(@id, ip)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def show_team&lt;br /&gt;
    if !(assignment = Assignment.find(params[:assignment_id])).nil? and !(topic = SignUpTopic.find(params[:id])).nil?&lt;br /&gt;
      @results = ad_info(assignment.id, topic.id)&lt;br /&gt;
    .........&lt;br /&gt;
&lt;br /&gt;
def ad_info(_assignment_id, topic_id)&lt;br /&gt;
    # List that contains individual result object&lt;br /&gt;
    @result_list = []&lt;br /&gt;
    # Get the results&lt;br /&gt;
    @results = SignedUpTeam.where(&amp;quot;topic_id = ?&amp;quot;, topic_id.to_s)&lt;br /&gt;
    # Iterate through the results of the query and get the required attributes&lt;br /&gt;
    @results.each do |result|&lt;br /&gt;
      team = result.team&lt;br /&gt;
      topic = result.topic&lt;br /&gt;
      resultMap = {}&lt;br /&gt;
      resultMap[:team_id] = team.id&lt;br /&gt;
      resultMap[:comments_for_advertisement] = team.comments_for_advertisement&lt;br /&gt;
      resultMap[:name] = team.name&lt;br /&gt;
      resultMap[:assignment_id] = topic.assignment_id&lt;br /&gt;
      resultMap[:advertise_for_partner] = team.advertise_for_partner&lt;br /&gt;
&lt;br /&gt;
      # Append to the list&lt;br /&gt;
      @result_list.append(resultMap)&lt;br /&gt;
    end&lt;br /&gt;
    @result_list&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def add_signup_topics&lt;br /&gt;
    / load_add_signup_topics(params[:id])/&lt;br /&gt;
    # retrieves all the data associated with the given assignment. Includes all topics,&lt;br /&gt;
    @id = params[:id]&lt;br /&gt;
    @sign_up_topics = SignUpTopic.where('assignment_id = ?', params[:id])&lt;br /&gt;
    @slots_filled = SignUpTopic.find_slots_filled(params[:id])&lt;br /&gt;
    @slots_waitlisted = SignUpTopic.find_slots_waitlisted(params[:id])&lt;br /&gt;
&lt;br /&gt;
    @assignment = Assignment.find(params[:id])&lt;br /&gt;
    # ACS Removed the if condition (and corresponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    # Though called participants, @participants are actually records in signed_up_teams table, which&lt;br /&gt;
    # is a mapping table between teams and topics (waitlisted recored are also counted)&lt;br /&gt;
    @participants = SignedUpTeam.find_team_participants(params[:id], session[:ip])&lt;br /&gt;
    SignUpSheet.add_signup_topic(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def add_signup_topics_staggered&lt;br /&gt;
    add_signup_topics&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def show_team&lt;br /&gt;
    if !(assignment = Assignment.find(params[:assignment_id])).nil? and !(topic = SignUpTopic.find(params[:id])).nil?&lt;br /&gt;
      @results = ads_for_topic(assignment.id, topic.id)&lt;br /&gt;
    .........&lt;br /&gt;
&lt;br /&gt;
def ads_for_topic(_assignment_id, topic_id)&lt;br /&gt;
    # List that contains individual result object&lt;br /&gt;
    ads = []&lt;br /&gt;
    # Get the results&lt;br /&gt;
    signed_up_teams = SignedUpTeam.where(&amp;quot;topic_id = ?&amp;quot;, topic_id.to_s)&lt;br /&gt;
    # Iterate through the results of the query and get the required attributes&lt;br /&gt;
    signed_up_teams.each do |result|&lt;br /&gt;
      team = result.team&lt;br /&gt;
      topic = result.topic&lt;br /&gt;
      new_ad = {}&lt;br /&gt;
      new_ad[:team_id] = team.id&lt;br /&gt;
      new_ad[:comments_for_advertisement] = team.comments_for_advertisement&lt;br /&gt;
      new_ad[:name] = team.name&lt;br /&gt;
      new_ad[:assignment_id] = topic.assignment_id&lt;br /&gt;
      new_ad[:advertise_for_partner] = team.advertise_for_partner&lt;br /&gt;
&lt;br /&gt;
      # Append to the list&lt;br /&gt;
      ads.append(new_ad)&lt;br /&gt;
    end&lt;br /&gt;
    ads&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. signup_as_instructor is not needed and has been removed.&lt;br /&gt;
&lt;br /&gt;
7. Comments on the list method have been provided, but the code is best left in the list method.&lt;br /&gt;
&lt;br /&gt;
8. Refactored the participants variable and improved readability.&lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(assignment_id, session[:ip])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ip = session[:ip]&lt;br /&gt;
@participants = SignedUpTeam.find_team_participants(@id, ip)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.  Previously signup_as_instructor_action provided unhelpful feedback to the instructor by only stating if the instructor could/couldn't assign a topic for a student.  The refactored code provides the instructor with the student id of the person that they are assigning, the team that the student is on, and the topic that the instructor is assigning to the team. &lt;br /&gt;
&lt;br /&gt;
'''Before''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up student for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a student who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'The student is not registered for the assignment: ' &amp;lt;&amp;lt; user.id)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''' &lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
def signup_as_instructor_action&lt;br /&gt;
    #put name of student and team in log&lt;br /&gt;
    # flash name of student and team&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    team = Team.find_team_for_assignment_and_user(params[:assignment_id], user.id).first&lt;br /&gt;
    assignment = Assignment.find(params[:assignment_id])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = user.name + &amp;quot; does not exist!&amp;quot;&lt;br /&gt;
    else #If the user is not null and the student exists then sign up student for topic&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up &amp;quot; + user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot;  for the topic &amp;quot; + params[:topic_id].to_s&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor signed up ' + user.name + ' on team ' + team.name + ' for topic: ' + params[:topic_id].to_s)&lt;br /&gt;
        else #If the students team already has a topic then cancel the sign up&lt;br /&gt;
          flash[:error] = user.name + &amp;quot; on &amp;quot; + team.name + &amp;quot; has already signed up for a topic!&amp;quot;&lt;br /&gt;
          ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Instructor is signing up a ' + user.name + 'on ' + team.name + ' who already has a topic')&lt;br /&gt;
        end&lt;br /&gt;
      else #If the student isn't a part of the assignment then cancel the sign up&lt;br /&gt;
        flash[:error] = user.name + &amp;quot; is not registered for the assignment!&amp;quot;&lt;br /&gt;
        ExpertizaLogger.info LoggerMessage.new(controller_name, '', user.name + ' is not registered for the assignment: ' + assignment.name)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. delete_signup and delete_signup_as_instructor violated the DRY principle due to both functions using identical if/else statements.  To solve this issue, delete_signup_heleper function was created. &lt;br /&gt;
&lt;br /&gt;
'''Before'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping topic for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], session[:user].id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped your topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for already submitted work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Drop failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Student has been dropped from the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def delete_signup_helper(isInstructor, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    messages = [&amp;quot;You have already submitted your work, so you are not allowed to drop your topic.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop your topic after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped your topic!&amp;quot;,&lt;br /&gt;
                &amp;quot;The team has already submitted their work, so you are not allowed to remove them.&amp;quot;,&lt;br /&gt;
                &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;,&lt;br /&gt;
                &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    ]&lt;br /&gt;
    if isInstructor == false&lt;br /&gt;
      flash1 = messages[0]&lt;br /&gt;
      flash2 = messages[1]&lt;br /&gt;
      flash3 = messages[2]&lt;br /&gt;
      id_param = session[:user]&lt;br /&gt;
    else&lt;br /&gt;
      flash1 = messages[3]&lt;br /&gt;
      flash2 = messages[4]&lt;br /&gt;
      flash3 = messages[5]&lt;br /&gt;
      id_param = participant&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = flash1&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for already submitted a work: ' + params[:topic_id].to_s)&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = flash2&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, session[:user].id, 'Dropping failed for ended work: ' + params[:topic_id].to_s)&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], id_param.id)&lt;br /&gt;
      flash[:success] = flash3&lt;br /&gt;
      ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].id, 'Student has dropped the topic: ' + params[:topic_id].to_s)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # this function is used to delete a previous signup&lt;br /&gt;
  def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    # A student who has already submitted work should not be allowed to drop his/her topic!&lt;br /&gt;
    # (A student/team has submitted if participant directory_num is non-null or submitted_hyperlinks is non-null.)&lt;br /&gt;
    # If there is no drop topic deadline, student can drop topic at any time (if all the submissions are deleted)&lt;br /&gt;
    # If there is a drop topic deadline, student cannot drop topic after this deadline.&lt;br /&gt;
    delete_signup_helper(false, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    user = TeamsUser.find_by(team_id: team.id).user&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)&lt;br /&gt;
    delete_signup_helper(true, participant, assignment, drop_topic_deadline)&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
; RSpec &lt;br /&gt;
: signup_as_instructor_action is the only function updated.  All other functions has remained the same.  To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
; Physical Testing&lt;br /&gt;
: &lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Click the Green Check for any topic&lt;br /&gt;
# Enter a student UnityID and click submit&lt;br /&gt;
&lt;br /&gt;
# Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indiactes functionality is as before after refactoring list fucntion.&lt;/div&gt;</summary>
		<author><name>Pgarg5</name></author>
	</entry>
</feed>