<?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=Hzhang62</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=Hzhang62"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Hzhang62"/>
	<updated>2026-08-15T14:29:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137087</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137087"/>
		<updated>2020-11-16T23:48:58Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 1:  create a review link for staff(TA/Instructor) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This is what it looks like.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:E2086 begin review.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Third, we found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses''' and let student review and staff review share one common template. We created a symbol variable ''':reviewer_role''' in order to identify the role of performing review. The shared template locates in app/view/shared/responses folder.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 3:  create shared view for response_action ===&lt;br /&gt;
In this file, student review and staff review share one template. We use '''reviewer_role''' to identify the role of the reviewer and render the different views for this reviewer. The page will show different review action base on the current stage and if the review did this review before (For example: if the current stage Finished and no previous review, the page will show &amp;quot;Begin review&amp;quot;).&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 5.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 4:  refactor response controller ===&lt;br /&gt;
Before modification, the normal review could only be done by students. When the student finished the review and clicked “Submit”, the page seemed to redirect from the students' review. Since we newly added staff to review, the location of redirect should also be modified accordingly.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 5: Allow students to identify that their submission has been reviewed by staff ===&lt;br /&gt;
A simple check is made to determine if the reviewer is a TA or Instructor. app/assets/images/staff.png is displayed to make an instructor performed review stand out from other reviews.&lt;br /&gt;
First, in order to determine if a review was completed by a staff participant (either a TA or an instructor), we create a function in app/models/review_response_map.rb.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step5 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If the mouse hovers over the icon a tooltip appears saying &amp;quot;Icon indicates this review was done by course staff&amp;quot;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step icon.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step6.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:E2086rspec.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137086</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137086"/>
		<updated>2020-11-16T23:48:27Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 1:  create a review link for staff(TA/Instructor) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:E2086 begin review.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Third, we found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses''' and let student review and staff review share one common template. We created a symbol variable ''':reviewer_role''' in order to identify the role of performing review. The shared template locates in app/view/shared/responses folder.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 3:  create shared view for response_action ===&lt;br /&gt;
In this file, student review and staff review share one template. We use '''reviewer_role''' to identify the role of the reviewer and render the different views for this reviewer. The page will show different review action base on the current stage and if the review did this review before (For example: if the current stage Finished and no previous review, the page will show &amp;quot;Begin review&amp;quot;).&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 5.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 4:  refactor response controller ===&lt;br /&gt;
Before modification, the normal review could only be done by students. When the student finished the review and clicked “Submit”, the page seemed to redirect from the students' review. Since we newly added staff to review, the location of redirect should also be modified accordingly.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 5: Allow students to identify that their submission has been reviewed by staff ===&lt;br /&gt;
A simple check is made to determine if the reviewer is a TA or Instructor. app/assets/images/staff.png is displayed to make an instructor performed review stand out from other reviews.&lt;br /&gt;
First, in order to determine if a review was completed by a staff participant (either a TA or an instructor), we create a function in app/models/review_response_map.rb.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step5 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If the mouse hovers over the icon a tooltip appears saying &amp;quot;Icon indicates this review was done by course staff&amp;quot;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step icon.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step6.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:E2086rspec.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2086_begin_review.png&amp;diff=137085</id>
		<title>File:E2086 begin review.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2086_begin_review.png&amp;diff=137085"/>
		<updated>2020-11-16T23:47:45Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137084</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137084"/>
		<updated>2020-11-16T23:37:07Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Rspec Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Third, we found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses''' and let student review and staff review share one common template. We created a symbol variable ''':reviewer_role''' in order to identify the role of performing review. The shared template locates in app/view/shared/responses folder.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 3:  create shared view for response_action ===&lt;br /&gt;
In this file, student review and staff review share one template. We use '''reviewer_role''' to identify the role of the reviewer and render the different views for this reviewer. The page will show different review action base on the current stage and if the review did this review before (For example: if the current stage Finished and no previous review, the page will show &amp;quot;Begin review&amp;quot;).&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 5.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 4:  refactor response controller ===&lt;br /&gt;
Before modification, the normal review could only be done by students. When the student finished the review and clicked “Submit”, the page seemed to redirect from the students' review. Since we newly added staff to review, the location of redirect should also be modified accordingly.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 5: Allow students to identify that their submission has been reviewed by staff ===&lt;br /&gt;
A simple check is made to determine if the reviewer is a TA or Instructor. app/assets/images/staff.png is displayed to make an instructor performed review stand out from other reviews.&lt;br /&gt;
First, in order to determine if a review was completed by a staff participant (either a TA or an instructor), we create a function in app/models/review_response_map.rb.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step5 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If the mouse hovers over the icon a tooltip appears saying &amp;quot;Icon indicates this review was done by course staff&amp;quot;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step icon.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step6.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:E2086rspec.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2086rspec.png&amp;diff=137083</id>
		<title>File:E2086rspec.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2086rspec.png&amp;diff=137083"/>
		<updated>2020-11-16T23:36:11Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rspec.png&amp;diff=137082</id>
		<title>File:Rspec.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rspec.png&amp;diff=137082"/>
		<updated>2020-11-16T23:34:27Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: Hzhang62 uploaded a new version of File:Rspec.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;testing rspec file&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137081</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137081"/>
		<updated>2020-11-16T23:32:09Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 5: Allow students to identify that their submission has been reviewed by staff */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Third, we found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses''' and let student review and staff review share one common template. We created a symbol variable ''':reviewer_role''' in order to identify the role of performing review. The shared template locates in app/view/shared/responses folder.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 3:  create shared view for response_action ===&lt;br /&gt;
In this file, student review and staff review share one template. We use '''reviewer_role''' to identify the role of the reviewer and render the different views for this reviewer. The page will show different review action base on the current stage and if the review did this review before (For example: if the current stage Finished and no previous review, the page will show &amp;quot;Begin review&amp;quot;).&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 5.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 4:  refactor response controller ===&lt;br /&gt;
Before modification, the normal review could only be done by students. When the student finished the review and clicked “Submit”, the page seemed to redirect from the students' review. Since we newly added staff to review, the location of redirect should also be modified accordingly.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 5: Allow students to identify that their submission has been reviewed by staff ===&lt;br /&gt;
A simple check is made to determine if the reviewer is a TA or Instructor. app/assets/images/staff.png is displayed to make an instructor performed review stand out from other reviews.&lt;br /&gt;
First, in order to determine if a review was completed by a staff participant (either a TA or an instructor), we create a function in app/models/review_response_map.rb.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step5 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If the mouse hovers over the icon a tooltip appears saying &amp;quot;Icon indicates this review was done by course staff&amp;quot;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step icon.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step6.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step_icon.png&amp;diff=137080</id>
		<title>File:Step icon.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step_icon.png&amp;diff=137080"/>
		<updated>2020-11-16T23:31:46Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step6.png&amp;diff=137079</id>
		<title>File:Step6.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step6.png&amp;diff=137079"/>
		<updated>2020-11-16T23:28:53Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: Hzhang62 uploaded a new version of File:Step6.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137077</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137077"/>
		<updated>2020-11-16T23:24:29Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Third, we found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses''' and let student review and staff review share one common template. We created a symbol variable ''':reviewer_role''' in order to identify the role of performing review. The shared template locates in app/view/shared/responses folder.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 3:  create shared view for response_action ===&lt;br /&gt;
In this file, student review and staff review share one template. We use '''reviewer_role''' to identify the role of the reviewer and render the different views for this reviewer. The page will show different review action base on the current stage and if the review did this review before (For example: if the current stage Finished and no previous review, the page will show &amp;quot;Begin review&amp;quot;).&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 5.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 4:  refactor response controller ===&lt;br /&gt;
Before modification, the normal review could only be done by students. When the student finished the review and clicked “Submit”, the page seemed to redirect from the students' review. Since we newly added staff to review, the location of redirect should also be modified accordingly.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step4.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Step 5: Allow students to identify that their submission has been reviewed by staff ===&lt;br /&gt;
A simple check is made to determine if the reviewer is a TA or Instructor. app/assets/images/staff.png is displayed to make an instructor performed review stand out from other reviews.&lt;br /&gt;
First, in order to determine if a review was completed by a staff participant (either a TA or an instructor), we create a function in app/models/review_response_map.rb.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step5 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step5_1.png&amp;diff=137076</id>
		<title>File:Step5 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step5_1.png&amp;diff=137076"/>
		<updated>2020-11-16T23:24:05Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137068</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137068"/>
		<updated>2020-11-16T23:16:59Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Third, we found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses''' and let student review and staff review share one common template. We created a symbol variable ''':reviewer_role''' in order to identify the role of performing review. The shared template locates in app/view/shared/responses folder.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3:  create shared view for response_action ===&lt;br /&gt;
In this file, student review and staff review share one template. We use '''reviewer_role''' to identify the role of the reviewer and render the different views for this reviewer. The page will show different review action base on the current stage and if the review did this review before (For example: if the current stage Finished and no previous review, the page will show &amp;quot;Begin review&amp;quot;).&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step 4:  refactor response controller ===&lt;br /&gt;
Before modification, the normal review could only be done by students. When the student finished the review and clicked “Submit”, the page seemed to redirect from the students' review. Since we newly added staff to review, the location of redirect should also be modified accordingly.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step4.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step4.png&amp;diff=137067</id>
		<title>File:Step4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step4.png&amp;diff=137067"/>
		<updated>2020-11-16T23:16:53Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: Hzhang62 uploaded a new version of File:Step4.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137064</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137064"/>
		<updated>2020-11-16T23:08:52Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 3:  create shared view for response_action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Third, we found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses''' and let student review and staff review share one common template. We created a symbol variable ''':reviewer_role''' in order to identify the role of performing review. The shared template locates in app/view/shared/responses folder.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3:  create shared view for response_action ===&lt;br /&gt;
In this file, student review and staff review share one template. We use '''reviewer_role''' to identify the role of the reviewer and render the different views for this reviewer. The page will show different review action base on the current stage and if the review did this review before (For example: if the current stage Finished and no previous review, the page will show &amp;quot;Begin review&amp;quot;).&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 5.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_5.png&amp;diff=137063</id>
		<title>File:Step2 5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_5.png&amp;diff=137063"/>
		<updated>2020-11-16T23:08:22Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: Hzhang62 uploaded a new version of File:Step2 5.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137062</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137062"/>
		<updated>2020-11-16T23:05:46Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Third, we found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses''' and let student review and staff review share one common template. We created a symbol variable ''':reviewer_role''' in order to identify the role of performing review. The shared template locates in app/view/shared/responses folder.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3:  create shared view for response_action ===&lt;br /&gt;
In this file, student review and staff review share one template. We use '''reviewer_role''' to identify the role of the reviewer and render the different views for this reviewer. The page will show different review action base on the current stage and if the review did this review before (For example: if the current stage Finished and no previous review, the page will show &amp;quot;Begin review&amp;quot;)&lt;br /&gt;
[[File:Step2 5.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_5.png&amp;diff=137057</id>
		<title>File:Step2 5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_5.png&amp;diff=137057"/>
		<updated>2020-11-16T23:03:04Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137045</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137045"/>
		<updated>2020-11-16T22:53:40Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Third, we found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses''' and let student review and staff review share one common template. We created a symbol variable ''':reviewer_role''' in order to identify the role of performing review. The shared template locates in app/view/shared/responses folder.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 4.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_4.png&amp;diff=137044</id>
		<title>File:Step2 4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_4.png&amp;diff=137044"/>
		<updated>2020-11-16T22:53:31Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137040</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137040"/>
		<updated>2020-11-16T22:48:13Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we created a function called &amp;quot;find_team_member&amp;quot; and moved the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses'''.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137039</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137039"/>
		<updated>2020-11-16T22:47:52Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we create a function called &amp;quot;find_team_member&amp;quot; and move the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fixed this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses'''.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137038</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137038"/>
		<updated>2020-11-16T22:46:40Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we create a function called &amp;quot;find_team_member&amp;quot; and move the code into '''response_map'''.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fix this small issue.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses'''.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137037</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137037"/>
		<updated>2020-11-16T22:46:18Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we create a function called &amp;quot;find_team_member&amp;quot; and move the code into '''response_map'''.&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fix this small issue.&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses'''.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137036</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137036"/>
		<updated>2020-11-16T22:45:44Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we create a function called &amp;quot;find_team_member&amp;quot; and move the code into '''response_map'''.&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
Second, we found it is better to use '''unless''' instead of using ''' if ! ''' in ruby on rails. So we fix this small issue.&lt;br /&gt;
[[File:Step2 3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses'''.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_3.png&amp;diff=137035</id>
		<title>File:Step2 3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_3.png&amp;diff=137035"/>
		<updated>2020-11-16T22:45:38Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137033</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137033"/>
		<updated>2020-11-16T22:39:11Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
We found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses'''. &lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we create a function called &amp;quot;find_team_member&amp;quot; and move the code into '''response_map'''.&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
[[File:Step2 2.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_2.png&amp;diff=137031</id>
		<title>File:Step2 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_2.png&amp;diff=137031"/>
		<updated>2020-11-16T22:39:02Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137029</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137029"/>
		<updated>2020-11-16T22:37:55Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
We found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses'''. &lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we create a function called &amp;quot;find_team_member&amp;quot; and move the code into '''response_map'''.&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137028</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137028"/>
		<updated>2020-11-16T22:37:22Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 2:  refactor the view part of the review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
We found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses'''. &lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we create a function called &amp;quot;find_team_member&amp;quot; into '''response_map'''.&lt;br /&gt;
[[File:Step2 1.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_1.png&amp;diff=137027</id>
		<title>File:Step2 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step2_1.png&amp;diff=137027"/>
		<updated>2020-11-16T22:37:03Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137026</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137026"/>
		<updated>2020-11-16T22:35:53Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
=== Step 2:  refactor the view part of the review ===&lt;br /&gt;
We found that the student review and the staff review have a lot of common code. So we refactor the '''student_review/_responses'''. &lt;br /&gt;
first, we found some code in the '''student_review/_responses''' should not show here. The purpose of the code from line 5 to line 12 is to find team members. This action relates to response_map. So we create a function called &amp;quot;find_team_member&amp;quot; into '''response_map'''.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137024</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137024"/>
		<updated>2020-11-16T22:24:04Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 1:  create a review link for staff(TA/Instructor) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage becomes &amp;quot;Finished&amp;quot;, we show the &amp;quot;Assign Grade&amp;quot; link. We use function '''current_user_is_assignment_participant''' to check if the current user have access to perform review. If the current user does not have the access to this assignment. No link will be shown.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137022</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137022"/>
		<updated>2020-11-16T22:21:16Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 1:  create a review link for staff(TA/Instructor) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
We create a link &amp;quot;Begin review&amp;quot; in '''list_submissions.html.erb''' in order to let staff(TA/Instructor) perform review before the review deadline. And if the current stage become &amp;quot;Finished&amp;quot;, we show &amp;quot;Assign Grade&amp;quot; link.&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137019</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137019"/>
		<updated>2020-11-16T22:17:26Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Step 1:  create */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create a review link for staff(TA/Instructor) ===&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137018</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137018"/>
		<updated>2020-11-16T22:16:35Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Step 1:  create===&lt;br /&gt;
[[File:Step1.png]]&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Step1.png&amp;diff=137017</id>
		<title>File:Step1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Step1.png&amp;diff=137017"/>
		<updated>2020-11-16T22:16:21Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: Hzhang62 uploaded a new version of File:Step1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137016</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137016"/>
		<updated>2020-11-16T22:09:13Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Perform review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Begin review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Begin review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137015</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137015"/>
		<updated>2020-11-16T22:07:35Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Rspec Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
== Demo ==&lt;br /&gt;
The video [https://youtu.be/FyBfWrdX5Dk] demonstrates the functionalities implemented in this project.&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137014</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137014"/>
		<updated>2020-11-16T22:05:17Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Rspec Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Travis-pass.png&amp;diff=137013</id>
		<title>File:Travis-pass.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Travis-pass.png&amp;diff=137013"/>
		<updated>2020-11-16T22:04:14Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: Hzhang62 uploaded a new version of File:Travis-pass.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137012</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137012"/>
		<updated>2020-11-16T22:00:57Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Rspec Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Travis-pass.png&amp;diff=137011</id>
		<title>File:Travis-pass.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Travis-pass.png&amp;diff=137011"/>
		<updated>2020-11-16T22:00:19Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: Hzhang62 uploaded a new version of File:Travis-pass.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Travis-pass.png&amp;diff=137010</id>
		<title>File:Travis-pass.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Travis-pass.png&amp;diff=137010"/>
		<updated>2020-11-16T21:59:36Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137009</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=137009"/>
		<updated>2020-11-16T21:59:21Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Rspec Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All Rspec tests are passing for this implementation as is evident by the Travis CI.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Travis-pass.png]]&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136993</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136993"/>
		<updated>2020-11-16T18:38:24Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Project Index */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
   http://152.7.98.249:8080/&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136992</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136992"/>
		<updated>2020-11-16T16:32:23Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Files Involved */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Edited ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136991</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136991"/>
		<updated>2020-11-16T16:27:35Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Rspec Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136990</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136990"/>
		<updated>2020-11-16T16:26:08Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Rspec Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases ==&lt;br /&gt;
describe &amp;quot;check 'Begin review' showing up before due date and 'Assign grade' after due date&amp;quot; do&lt;br /&gt;
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Begin review&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone + 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;team_formation&amp;quot;).first, due_at: DateTime.now.in_time_zone .day)&lt;br /&gt;
&lt;br /&gt;
    questionnaire1 = create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/response/new?id=#{questionnaire1.id}&amp;amp;return=ta_review&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    fill_in &amp;quot;responses[0][comment]&amp;quot;, with: &amp;quot;Excellent Work&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Submit Review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;student6666&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    visit('/impersonate/start')&lt;br /&gt;
    expect(page).to have_content(&amp;quot;Enter user account&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Impersonate&amp;quot;)&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/student_task/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;User: #{student_test.name}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    click_link(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;Assign grade&amp;quot; do&lt;br /&gt;
    instructor6 = create(:instructor)   #create instructor6&lt;br /&gt;
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
    create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone - 10.day)&lt;br /&gt;
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;review&amp;quot;).first, due_at: DateTime.now.in_time_zone - 5.day)&lt;br /&gt;
&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire1&amp;quot;)&lt;br /&gt;
    create(:questionnaire, name: &amp;quot;TestQuestionnaire2&amp;quot;)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question1&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)&lt;br /&gt;
    create(:question, txt: &amp;quot;Question2&amp;quot;, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)&lt;br /&gt;
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)&lt;br /&gt;
&lt;br /&gt;
    expect(assignment_test.instructor_id).to eql(instructor6.id)&lt;br /&gt;
    expect(assignment_test.course_id).to eql(nil)&lt;br /&gt;
    student_test = create(:student, name: &amp;quot;student6666&amp;quot;, email: &amp;quot;stu6666@ncsu.edu&amp;quot;) #create a student for test&lt;br /&gt;
&lt;br /&gt;
    visit(root_path)&lt;br /&gt;
    fill_in('login_name', with: 'instructor6')&lt;br /&gt;
    fill_in('login_password', with: 'password')&lt;br /&gt;
    click_button('Sign in')&lt;br /&gt;
    expect(current_path).to eql(&amp;quot;/tree_display/list&amp;quot;)&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: instructor6.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(instructor6.name)&lt;br /&gt;
    expect(page).to have_content(instructor6.email)&lt;br /&gt;
    click_button(&amp;quot;Submit&amp;quot;, match: :first)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/participants/list?id=#{assignment_test.id}&amp;amp;model=Assignment&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;E2086&amp;quot;)&lt;br /&gt;
    fill_in(&amp;quot;user_name&amp;quot;, match: :first, with: student_test.name)&lt;br /&gt;
    click_button(&amp;quot;Add&amp;quot;, match: :first)&lt;br /&gt;
    expect(page).to have_content(student_test.name)&lt;br /&gt;
    expect(page).to have_content(student_test.email)&lt;br /&gt;
&lt;br /&gt;
    user_id = User.find_by(name: 'student6666').id&lt;br /&gt;
    participant_student = Participant.where(user_id: user_id)&lt;br /&gt;
    participant_id = participant_student.first.id&lt;br /&gt;
    parent_id = participant_student.first.parent_id&lt;br /&gt;
    team_student = Team.where(parent_id: parent_id)&lt;br /&gt;
    team_user = create(:team_user, user_id: user_id)&lt;br /&gt;
&lt;br /&gt;
    visit(&amp;quot;/assignments/list_submissions?id=#{assignment_test.id}&amp;quot;)&lt;br /&gt;
    expect(page).to have_content(&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;)&lt;br /&gt;
    expect(page).to have_link('Assign Grade', exact:true)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136989</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136989"/>
		<updated>2020-11-16T16:25:30Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Running Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/features/instructor_do_review_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136988</id>
		<title>CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2086._Let_course_staff_as_well_as_students_do_reviews&amp;diff=136988"/>
		<updated>2020-11-16T16:18:12Z</updated>

		<summary type="html">&lt;p&gt;Hzhang62: /* Files Involved */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Index ==&lt;br /&gt;
* Deployment Link: &lt;br /&gt;
&lt;br /&gt;
* Github Repository: &lt;br /&gt;
    https://github.com/MayoNaizz/expertiza&lt;br /&gt;
* Github Pull Request: &lt;br /&gt;
    https://github.com/expertiza/expertiza/pull/1834&lt;br /&gt;
* Youtube Video Link:&lt;br /&gt;
    https://youtu.be/FyBfWrdX5Dk&lt;br /&gt;
&lt;br /&gt;
== Project Background ==&lt;br /&gt;
&lt;br /&gt;
* Expertiza Project - E2086 : Let course staff as well as students do reviews&lt;br /&gt;
&lt;br /&gt;
=== Why This Project ===&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.&lt;br /&gt;
&lt;br /&gt;
=== Primary Goal of this Project===&lt;br /&gt;
&lt;br /&gt;
This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
'''Controller: '''  &lt;br /&gt;
   app/controllers/response_controller.rb&lt;br /&gt;
'''Model: '''&lt;br /&gt;
   app/models/review_response_map.rb&lt;br /&gt;
   app/models/response_map.rb&lt;br /&gt;
'''View:'''&lt;br /&gt;
   app/views/student_review/_responses.html.erb&lt;br /&gt;
   app/views/shared/responses/_response_actions.html.erb&lt;br /&gt;
   app/views/grades/view_team.html.erb&lt;br /&gt;
   app/views/grades/_add_icon_to_name.html.erb&lt;br /&gt;
   app/views/assignments/list_submissions.html.erb&lt;br /&gt;
   app/views/assignments/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Project Team Member===&lt;br /&gt;
&lt;br /&gt;
* Chenwei Zhou (czhou6)&lt;br /&gt;
* Tianrui Wang (twang33)&lt;br /&gt;
* Zhuolin Li(zli82)&lt;br /&gt;
* Hao Zhang (hzhang62)&lt;br /&gt;
&lt;br /&gt;
== Project Design Philosophy ==&lt;br /&gt;
Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first part involves the primary functionality of letting the staff perform a review on students submission.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.&amp;lt;/li&amp;gt;  &lt;br /&gt;
&amp;lt;li&amp;gt;Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Flowchart ==&lt;br /&gt;
&lt;br /&gt;
*Functions that were included&lt;br /&gt;
[[File:E2086 flowchart2.png]]&lt;br /&gt;
&lt;br /&gt;
== Issue ==&lt;br /&gt;
=== Plan of Work ===&lt;br /&gt;
*In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.&lt;br /&gt;
*In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person).  That will bring up a list of participants and allow you to add more participants.  &lt;br /&gt;
*Make the instructor and/or TAs participants, and then they should be allowed to do reviews.&lt;br /&gt;
[[File:E2086 assignment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.&lt;br /&gt;
[[File:E2086 view submission.png|900px]]&lt;br /&gt;
&lt;br /&gt;
*A list of submissions would be pulled up:&lt;br /&gt;
[[File:E2086 submission.png|900px]]&lt;br /&gt;
*If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.&lt;br /&gt;
* We will add the review link in &amp;lt;code&amp;gt;views/assignments/list_submissions.html.erb&amp;lt;/code&amp;gt; and once instructor/TA click that link. Controller &amp;lt;code&amp;gt; response &amp;lt;/code&amp;gt; will be called. Once the &amp;lt;code&amp;gt; get_current_stage() &amp;lt;/code&amp;gt; change to &amp;quot;Finished&amp;quot; it means the due day of the review round is over. The review link will be replaced by the grade link. &lt;br /&gt;
&lt;br /&gt;
*Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.&lt;br /&gt;
*We will add an icon in &amp;lt;code&amp;gt;views/grades/view_team.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/response/view.html.erb&amp;lt;/code&amp;gt; if these review is made by instructor or TA.&lt;br /&gt;
This function will be implemented in &amp;lt;code&amp;gt; helpers/grades_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:E2086 review.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend &lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate as one of the students to simulate the submission of work.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perform review ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'Manage' -&amp;gt; 'Assignments' to go to assignment page as instructor.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactor &amp;amp; Code Modification ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Tests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rspec Test Cases == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reference &amp;amp; Links ==&lt;br /&gt;
=== Previous Implementation ===&lt;br /&gt;
This project was done by Team E1985 on Fall 2019 with the following work:&lt;br /&gt;
&lt;br /&gt;
Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews&lt;br /&gt;
&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1631&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/Matrawick/expertiza&lt;br /&gt;
&lt;br /&gt;
Youtube screencast: https://youtu.be/kLfZ22vlu30&lt;br /&gt;
&lt;br /&gt;
=== Comments From Mentor ===&lt;br /&gt;
* Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).&lt;br /&gt;
&lt;br /&gt;
* There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here.  But the current code should have been refactored to put the common code into another method.&lt;br /&gt;
&lt;br /&gt;
* One test has been removed because it broke the build, &amp;amp; was evid. unrelated to their functionality.&lt;br /&gt;
&lt;br /&gt;
* The commit was too messy; if this had been merged, it would have required refactoring. &lt;br /&gt;
&lt;br /&gt;
for more information about this project, please visit [https://docs.google.com/document/d/1qphGGe8imRNufw2EhTZRqgs-I6XiQX74_I3UiwpPs5M/edit# Project Lists]&lt;/div&gt;</summary>
		<author><name>Hzhang62</name></author>
	</entry>
</feed>