<?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=Drupadhy</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=Drupadhy"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Drupadhy"/>
	<updated>2026-07-16T04:14:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124625</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124625"/>
		<updated>2019-04-27T01:34:26Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently, the instructors write hints as a part of review questions. These hints can be instructions on how to structure your review, what to include/exclude etc. These help students write constructive reviews. But this is clearly not enough. If the students could read through some sample reviews, they would gain a better understanding of how to write reviews. This project aims to do just that.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to:&lt;br /&gt;
# Add a feature for students to toggle the visibility of their reviews. When reviews are marked 'public', instructors will have the option of adding them as a 'sample review' to any assignment. When reviews are marked 'private' they will not be shown to other students as a sample. &lt;br /&gt;
# Add a feature for Instructor to select a subset of 'public' reviews and make those reviews visible as sample reviews of any of their assignments in the course.&lt;br /&gt;
# Add a feature for instructors to select a subset of 'sample' reviews and set those reviews as sample reviews for a particular assignment.&lt;br /&gt;
# Create a view where the student can see a list of sample reviews of the assignment and have a detailed view of each.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we added a checkbox to the review page. Checking this checkbox will make the review public. Unchecking it will make the review private. When this status changes, a message is displayed next to the checkbox saying if the status was changed successfully.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow students to make a review private''': Students should be able to change the visibility of their review even after they have submitted it. A checkbox similar to the one described above was implemented where students can see the reviews they have given. If a review has been made private after an instructor has selected it as a sample review, it is still not displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor is able to select that review to be made a sample review. If the review is already a sample review, the instructor is able to remove from the set of example reviews. If the review was private, the instructor is shown a notice that 'This review is private.' and they are not allowed to  select it as a sample review. This selection can be done when the instructor is viewing the review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Set some of selected reviews as sample for an assignment''': Sample reviews can be identified by the assignment, reviewer (a participant) and the reviewee (a team). When editing an assignment, the instructor is able to select past assignments, select a reviewer and select the reviewee. The way in which the instructor selects the assignment is to select the from a dropdown. the assignment dropdown is populated with all the assignments that the instructor has created and all the assignments that belong to the course. When the assignment is selected, the reviewer dropdown will then be populated with the names of the reviewers whose reviews have been made public and have been selected by the instructor. Once the reviewer is selected, the reviewee dropdown will get populated with names of teams to whom the review has been given. This will identify the selected review. The instructor will be able to set it as sample review for the current assignment. This means that the instructor can even set a review from any of their earlier assignments as a sample.  &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to see sample reviews''': When a student wants to review other team's work, they will be shown a list of sample reviews that the instructor has selected for them. In the list each review is a link to the full review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that changed === &lt;br /&gt;
&lt;br /&gt;
* Create migration to create a column called status which can take on the values 'selected' = 2, 'public' = 1 and 'private' = 0. Changes will reflect in '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
Status can have 3 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Status &lt;br /&gt;
! Explanation of the value &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response is marked public by the student but has not been selected as a sample review by the instructors.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response has been selected as a sample by the instructors.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Created a checkbox in a view: '''views/response/response.html.erb'''. To allow students to mark their reviews as public.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Added code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;). This will reflect the choice of the student in the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The instructors will select sample reviews from a set of public reviews. The code change will be in the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Students will be able to view sample reviews. The code change will be in the file '''list.html.erb''' which is under the '''views/student_review''' directory. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In order to paginate and display a list of reviews to chose from for the instructors, we will have to create partial view files. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
* Use Case -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:UseCase.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Power Users:''' Instructors, TAs, Admins and Super Admins&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
A team in the Fall 18 semester had partially done this project. As per their findings, there was no association maintained between assignments. Thus it is impossible to recognize if sample reviews from a previous session of the same course can be shown students of the current session of the course. The earlier team decided to create a model to store such an association between assignments. This model contains two columns both having different assignment IDs. This means that all the selected reviews in an assignment will be shown as sample in the other assignment&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Our Approach ===&lt;br /&gt;
1) We did not want the all selected reviews in an assignment to be shown. Instead we added a facility for instructors to select individual reviews and set them as sample. Hence we created a migration where we create a model. The model has an assignment id and a response_map_id. The assignment_id is the id of the assignment for which the sample is to be shown. The response_map_id is the id of the sample review.&amp;lt;br&amp;gt;&lt;br /&gt;
2) We also added a column called visibility to the responses model which will show if the review has been marked 'private', 'public' or 'selected'.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
This shows the overall flow of what the users of the system should be able to do. We will write tests such that the entire flow will be completely tested.&amp;lt;br&amp;gt;&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)''' (Scenario 1)&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)''' (Scenario 2)&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click Edit for a particular assignment.&lt;br /&gt;
# Click on the review tab.&lt;br /&gt;
# Select an assignment from the dropdown&lt;br /&gt;
# Select a reviewer from the second dropdown.&lt;br /&gt;
# Select a reviewee from the third dropdown.&lt;br /&gt;
# Click 'Add' button to add the selected review to be shown as a sample for this assignment.&lt;br /&gt;
# Add as many sample reviews as you want in the same way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student (Scenario 1)'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student (Scenario 2)'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
==Screenshots of implementation==&lt;br /&gt;
&lt;br /&gt;
Students are able to toggle between private and public visibility of their review.&lt;br /&gt;
&lt;br /&gt;
[[File: Making_review_private_resize.png]]&lt;br /&gt;
&lt;br /&gt;
[[File: Making_review_public_resize.png]]&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows a button next to every review which gives an option '''Mark as Sample'''. This access will be given to instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:No more a sample 1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the review is marked as sample, the instructor will be given an option to '''Remove as Sample'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Marked as sample 1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The instructor is able to select a review to be shown as sample by selecting from assignment, reviewer, reviewee dropdowns.&lt;br /&gt;
&lt;br /&gt;
[[File: Dropdown_before_selection_resize.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Students are able to see the sample review for an assignment.&lt;br /&gt;
[[File: Adding_sample_reviews_to_the_assignment_resize.png]]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
[https://youtu.be/Q1UczIJMmcE Screencast of the project] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1464 GitHub Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/E1867_allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example Previous team's documentation]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124142</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124142"/>
		<updated>2019-04-16T00:06:19Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to:&lt;br /&gt;
# Add a feature for students to make their reviews 'public', that is, allow other students to view them.&lt;br /&gt;
# Add a feature for Instructor to select a subset of 'public' reviews and make those reviews visible as sample reviews of any of his/her assignments in the course.&lt;br /&gt;
# Add a facility when instructors are creating &lt;br /&gt;
# Create a view where the student can see a list of sample reviews of the assignment and have a detailed view of each.&lt;br /&gt;
# Allow the student to toggle the visibility of a review they have submitted.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them. The link will show them a view of the list of all sample views.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
Status can have 3 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Status &lt;br /&gt;
! Explanation of the value &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response is marked public by the student but has not been selected as a sample review by the instructors.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response has been selected as a sample by the instructors.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''. To allow students to mark their reviews as public.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;). This will reflect the choice of the student in the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The instructors will select sample reviews from a set of public reviews. The code change will be in the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Students will be able to view sample reviews. The code change will be in the file '''list.html.erb''' which is under the '''views/student_review''' directory. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In order to paginate and display a list of reviews to chose from for the instructors, we will have to create partial view files. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
A team in the Fall 18 semester had partially done this project. As per their findings, there was no association maintained between assignments. Thus it is impossible to recognize if sample reviews from a previous session of the same course can be shown students of the current session of the course. The earlier team decided to create a model to store such an association between assignments. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Our Approach ===&lt;br /&gt;
Instead of creating a whole new model (and possibly a controller) we have decided to add a column to the existing '''assignments''' model. This column called '''is_similar_to''' will be used to get sample reviews from a previous assignment. This approach saves us a major schema change. Also, if an assignment is similar to multiple assignments and wants to take sample reviews from many of those assignments, we can follow the child to parent structure in the database. For example, if we find that assignment X (parent) was the earlier version of assignment Y(child) from the database, we will also look for the parent of assignment X and so on until there are no parents. Then we will find the sample reviews from that set of assignments.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
This shows the overall flow of what the users of the system should be able to do. We will write tests such that the entire flow will be completely tested.&amp;lt;br&amp;gt;&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student (Scenario 1)'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student (Scenario 2)'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
==Expected Output==&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows a button next to every review which gives an option '''Mark as Sample'''. This access will be given to instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:No more a sample 1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the review is marked as sample, the instructor will be given an option to '''Remove as Sample'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Marked as sample 1.png]]&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/E1867_allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example Previous team's documentation]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124141</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124141"/>
		<updated>2019-04-16T00:05:46Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to:&lt;br /&gt;
# Add a feature for students to make their reviews 'public', that is, allow other students to view them.&lt;br /&gt;
# Add a feature for Instructor to select a subset of 'public' reviews and make those reviews visible as sample reviews of any of his/her assignments in the course.&lt;br /&gt;
# Add a facility when instructors are creating &lt;br /&gt;
# Create a view where the student can see a list of sample reviews of the assignment and have a detailed view of each.&lt;br /&gt;
# Allow the student to toggle the visibility of a review they have submitted.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them. The link will show them a view of the list of all sample views.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
Status can have 3 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Status &lt;br /&gt;
! Explanation of the value &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response is marked public by the student but has not been selected as a sample review by the instructors.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response has been selected as a sample by the instructors.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''. To allow students to mark their reviews as public.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;). This will reflect the choice of the student in the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The instructors will select sample reviews from a set of public reviews. The code change will be in the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Students will be able to view sample reviews. The code change will be in the file '''list.html.erb''' which is under the '''views/student_review''' directory. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In order to paginate and display a list of reviews to chose from for the instructors, we will have to create partial view files. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
A team in the Fall 18 semester had partially done this project. As per their findings, there was no association maintained between assignments. Thus it is impossible to recognize if sample reviews from a previous session of the same course can be shown students of the current session of the course. The earlier team decided to create a model to store such an association between assignments. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Our Approach ===&lt;br /&gt;
Instead of creating a whole new model (and possibly a controller) we have decided to add a column to the existing '''assignments''' model. This column called '''is_similar_to''' will be used to get sample reviews from a previous assignment. This approach saves us a major schema change. Also, if an assignment is similar to multiple assignments and wants to take sample reviews from many of those assignments, we can follow the child to parent structure in the database. For example, if we find that assignment X (parent) was the earlier version of assignment Y(child) from the database, we will also look for the parent of assignment X and so on until there are no parents. Then we will find the sample reviews from that set of assignments.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
This shows the overall flow of what the users of the system should be able to do. We will write tests such that the entire flow will be completely tested.&amp;lt;br&amp;gt;&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''(Scenario 1)&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''(Scenario 2)&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
==Expected Output==&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows a button next to every review which gives an option '''Mark as Sample'''. This access will be given to instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:No more a sample 1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the review is marked as sample, the instructor will be given an option to '''Remove as Sample'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Marked as sample 1.png]]&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/E1867_allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example Previous team's documentation]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124139</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124139"/>
		<updated>2019-04-16T00:00:08Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to:&lt;br /&gt;
# Add a feature for students to make their reviews 'public', that is, allow other students to view them.&lt;br /&gt;
# Add a feature for Instructor to select a subset of 'public' reviews and make those reviews visible as sample reviews of any of his/her assignments in the course.&lt;br /&gt;
# Create a view where the student can see a list of sample reviews of the assignment and have a detailed view of each.&lt;br /&gt;
# Allow the student to toggle the visibility of a review they have submitted.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them. The link will show them a view of the list of all sample views.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
Status can have 3 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Status &lt;br /&gt;
! Explanation of the value &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response is marked public by the student but has not been selected as a sample review by the instructors.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response has been selected as a sample by the instructors.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''. To allow students to mark their reviews as public.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;). This will reflect the choice of the student in the database.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The instructors will select sample reviews from a set of public reviews. The code change will be in the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Students will be able to view sample reviews. The code change will be in the file '''list.html.erb''' which is under the '''views/student_review''' directory. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In order to paginate and display a list of reviews to chose from for the instructors, we will have to create partial view files. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
A team in the Fall 18 semester had partially done this project. As per their findings, there was no association maintained between assignments. Thus it is impossible to recognize if sample reviews from a previous session of the same course can be shown students of the current session of the course. The earlier team decided to create a model to store such an association between assignments. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Our Approach ===&lt;br /&gt;
Instead of creating a whole new model (and possibly a controller) we have decided to add a column to the existing '''assignments''' model. This column called '''is_similar_to''' will be used to get sample reviews from a previous assignment. This approach saves us a major schema change. Also, if an assignment is similar to multiple assignments and wants to take sample reviews from many of those assignments, we can follow the child to parent structure in the database. For example, if we find that assignment X (parent) was the earlier version of assignment Y(child) from the database, we will also look for the parent of assignment X and so on until there are no parents. Then we will find the sample reviews from that set of assignments.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
This shows the overall flow of what the users of the system should be able to do. We will write tests such that the entire flow will be completely tested.&amp;lt;br&amp;gt;&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
==Expected Output==&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows a button next to every review which gives an option '''Mark as Sample'''. This access will be given to instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:No more a sample 1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the review is marked as sample, the instructor will be given an option to '''Remove as Sample'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Marked as sample 1.png]]&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/E1867_allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example Previous team's documentation]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124015</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124015"/>
		<updated>2019-04-13T02:15:46Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to:&lt;br /&gt;
# Add a feature for students to make their reviews 'public', that is, allow other students to view them.&lt;br /&gt;
# Add a feature for TA to select a subset of 'public' reviews, and make those reviews visible as sample reviews of the particular assignment.&lt;br /&gt;
# Add a feature for Instructor to select a subset of 'public' reviews and make those reviews visible as sample reviews of any of his/her assignments in the course.&lt;br /&gt;
# Create a view where the student can see a list of sample reviews of the assignment and have a detailed view of each.&lt;br /&gt;
# Allow the student to toggle the visibility of a review he/she has submitted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are also planning to add a new field in the '''responses''' table (in the database), namely, visibility. &lt;br /&gt;
Visibility can have 4 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table showing list of visibility values and the properties&lt;br /&gt;
! Visibility &lt;br /&gt;
! Properties &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 3 || The response which was either in the review or approved earlier, has now been rejected as an example (it has been unmarked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New work (along with changes) ===&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Expected Output==&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows a button next to every review which gives an option '''Mark as Sample'''. This access will be given to instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:No more a sample.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the review is marked as sample, the instructor will be given an option to '''Remove as Sample'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Marked as sample.png]]&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124013</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124013"/>
		<updated>2019-04-13T02:15:09Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* New work: along with changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to:&lt;br /&gt;
# Add a feature for students to make their reviews 'public', that is, allow other students to view them.&lt;br /&gt;
# Add a feature for TA to select a subset of 'public' reviews, and make those reviews visible as sample reviews of the particular assignment.&lt;br /&gt;
# Add a feature for Instructor to select a subset of 'public' reviews and make those reviews visible as sample reviews of any of his/her assignments in the course.&lt;br /&gt;
# Create a view where the student can see a list of sample reviews of the assignment and have a detailed view of each.&lt;br /&gt;
# Allow the student to toggle the visibility of a review he/she has submitted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are also planning to add a new field in the '''responses''' table (in the database), namely, visibility. &lt;br /&gt;
Visibility can have 4 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table showing list of visibility values and the properties&lt;br /&gt;
! Visibility &lt;br /&gt;
! Properties &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 3 || The response which was either in the review or approved earlier, has now been rejected as an example (it has been unmarked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New work (along with changes) ===&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Expected Output==&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows a button next to every review which gives an option '''Mark as Sample'''. This access will be given to instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:No more a sample.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the review is marked as sample, the instructor will be given an option to '''Remove as Sample'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Marked as sample.png]]&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124010</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=124010"/>
		<updated>2019-04-13T02:14:16Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to:&lt;br /&gt;
# Add a feature for students to make their reviews 'public', that is, allow other students to view them.&lt;br /&gt;
# Add a feature for TA to select a subset of 'public' reviews, and make those reviews visible as sample reviews of the particular assignment.&lt;br /&gt;
# Add a feature for Instructor to select a subset of 'public' reviews and make those reviews visible as sample reviews of any of his/her assignments in the course.&lt;br /&gt;
# Create a view where the student can see a list of sample reviews of the assignment and have a detailed view of each.&lt;br /&gt;
# Allow the student to toggle the visibility of a review he/she has submitted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are also planning to add a new field in the '''responses''' table (in the database), namely, visibility. &lt;br /&gt;
Visibility can have 4 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table showing list of visibility values and the properties&lt;br /&gt;
! Visibility &lt;br /&gt;
! Properties &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 3 || The response which was either in the review or approved earlier, has now been rejected as an example (it has been unmarked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New work: along with changes ===&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Expected Output==&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows a button next to every review which gives an option '''Mark as Sample'''. This access will be given to instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:No more a sample.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the review is marked as sample, the instructor will be given an option to '''Remove as Sample'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Marked as sample.png]]&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123914</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123914"/>
		<updated>2019-04-12T23:01:10Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Expected Output */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are also planning to add a new field in the '''responses''' table (in the database), namely, visibility. &lt;br /&gt;
Visibility can have 4 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table showing list of visibility values and the properties&lt;br /&gt;
! Visibility &lt;br /&gt;
! Properties &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 3 || The response which was either in the review or approved earlier, has now been rejected as an example (it has been unmarked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New work: along with changes ===&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Expected Output==&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows a button next to every review which gives an option '''Mark as Sample'''. This access will be given to instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:No more a sample.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the review is marked as sample, the instructor will be given an option to '''Remove as Sample'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Marked as sample.png]]&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123912</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123912"/>
		<updated>2019-04-12T22:57:32Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are also planning to add a new field in the '''responses''' table (in the database), namely, visibility. &lt;br /&gt;
Visibility can have 4 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table showing list of visibility values and the properties&lt;br /&gt;
! Visibility &lt;br /&gt;
! Properties &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 3 || The response which was either in the review or approved earlier, has now been rejected as an example (it has been unmarked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New work: along with changes ===&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Expected Output==&lt;br /&gt;
&lt;br /&gt;
[[File:Marked as sample.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:No more a sample.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123911</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123911"/>
		<updated>2019-04-12T22:53:59Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Files that will change */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are also planning to add a new field in the '''responses''' table (in the database), namely, visibility. &lt;br /&gt;
Visibility can have 4 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table showing list of visibility values and the properties&lt;br /&gt;
! Visibility &lt;br /&gt;
! Properties &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 3 || The response which was either in the review or approved earlier, has now been rejected as an example (it has been unmarked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New work: along with changes ===&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123908</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123908"/>
		<updated>2019-04-12T22:53:36Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
We are planning to add a new field in the '''responses''' table (in the database), namely, visibility. &lt;br /&gt;
Visibility can have 4 values as listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table showing list of visibility values and the properties&lt;br /&gt;
! Visibility &lt;br /&gt;
! Properties &lt;br /&gt;
|-&lt;br /&gt;
| 0 || Response is private. This is the default value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || The response which was in the review has been approved as an example (that is, it has been marked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
| 3 || The response which was either in the review or approved earlier, has now been rejected as an example (it has been unmarked as a sample)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New work: along with changes ===&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123907</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123907"/>
		<updated>2019-04-12T22:50:47Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* DB Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New work: along with changes ===&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123906</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123906"/>
		<updated>2019-04-12T22:50:33Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* DB design (new: along with changes) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
=== New work: along with changes ===&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123905</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123905"/>
		<updated>2019-04-12T22:50:05Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* DB Design (Previous team) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
=== Previous work ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
== DB design (new: along with changes) ==&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123904</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123904"/>
		<updated>2019-04-12T22:49:19Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* DB design(new: along with changes) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
== DB Design (Previous team) ==&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
== DB design (new: along with changes) ==&lt;br /&gt;
&lt;br /&gt;
Most of the design used by the team will be used as it is but there will be some major change in the design, The change is mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students. Accordingly, changes will be made that are related to assignments. &lt;br /&gt;
&lt;br /&gt;
The advantage of using this design is that some of the code which is already available can be reused. No new code will be added that was previously existing.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123899</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123899"/>
		<updated>2019-04-12T22:37:41Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* DB Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
== DB Design (Previous team) ==&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
== DB design(new: along with changes) ==&lt;br /&gt;
&lt;br /&gt;
The previous team had created an entire table, that is made major changes in the database which lead to creating a new model, view and controller. This may lead to some major problems which can affect the other functionalities.&lt;br /&gt;
&lt;br /&gt;
We are preventing that by a different approach. We have decided to use the '''assignments''' table itself and just add an extra field called '''is_similar_for'''. This will be used to get the sample reviews from previous similar assignments that were assigned to students.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123848</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123848"/>
		<updated>2019-04-12T19:23:59Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
== DB Design ==&lt;br /&gt;
&lt;br /&gt;
Currently, the Expertiza database design does not maintain any link between different assignments. An assignment of the current semester is completely independent of any other assignment of any other course having similar or exact objectives. For example, in a course C, the assignment named A1 in a semester Sx has no association to the same assignment given in an earlier semester Sy.&lt;br /&gt;
&lt;br /&gt;
Since our task involves using reviews from the past as samples for the present, we should create this association as a new table. Further, reviews may not be the only intention to associate assignments with each other, as future requirements might require associating them on other criteria too. Thus, we find it appropriate to name the table as &amp;quot;similar_assignments&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The table structure is defined [http://wiki.expertiza.ncsu.edu/index.php/Similar_assignments here].&lt;br /&gt;
&lt;br /&gt;
This table can be visualized as a directed graph where vertices represent assignments. An edge (u,v) with a label L means u is similar to v for the intent of association, L.&lt;br /&gt;
&lt;br /&gt;
Consider a row (id = x, assignment_id = Ak, is_similar_for = An, association_intent = &amp;quot;review&amp;quot;). This means, given the intent of association as &amp;quot;review&amp;quot;, assignment Ak was chosen as a similar assignment for assignment An. That is, while marking some review for An as a sample, the instructor opted to have reviews of Ak as samples for An as well.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123846</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123846"/>
		<updated>2019-04-12T19:19:30Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as an inheritance.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''As a Power User (TA/Instructor/Admin/Super Admin)'''&lt;br /&gt;
# Log in&lt;br /&gt;
# Click on Manage-&amp;gt;Assignments&lt;br /&gt;
# Displays a list of Assignments&lt;br /&gt;
# Click View Report/Review for a particular assignment.&lt;br /&gt;
# Displays a list of reviews submitted by students.&lt;br /&gt;
# Click on any review in &amp;quot;team reviewed&amp;quot; column for a particular student.&lt;br /&gt;
# Displays the summary of reviews submitted by that student, with a &amp;quot;Make as sample&amp;quot; button on the right of every review.&lt;br /&gt;
# Click on &amp;quot;Make as sample&amp;quot; for the intended reviews, which opens a popup that displays a list of all assignments that are a part of the instructor's courses.&lt;br /&gt;
# From this list select all assignments for which the review has to be shown as a sample.&lt;br /&gt;
# Click on 'Submit' after selection (this closes the popup).&lt;br /&gt;
# Navigate to view reviews of that particular assignment and click on &amp;quot;Sample Reviews&amp;quot;.&lt;br /&gt;
# A new page is opened that lists out all the sample reviews of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''As a Student'''&lt;br /&gt;
# Log in.&lt;br /&gt;
# Click on Assignments&lt;br /&gt;
# List of assignments is displayed.&lt;br /&gt;
# Click on any assignment for which the review has to be submitted.&lt;br /&gt;
# Assignment task page is displayed.&lt;br /&gt;
# Click on &amp;quot;Other's work&amp;quot; to open the reviews summary page (at /student_review).&lt;br /&gt;
# Below the heading &amp;quot;Reviews for ...&amp;quot;, click on the &amp;quot;Show sample reviews&amp;quot; link.&lt;br /&gt;
# This opens a page where the student can view all sample reviews for that assignment.&lt;br /&gt;
# Use the browser's back button to go back to the Assignment review page.&lt;br /&gt;
# Chose to review any of the teams' assignments that are displayed.&lt;br /&gt;
# Select a team for review and fill in the review.&lt;br /&gt;
# Before submitting the review, select the checkbox that says &amp;quot;I agree to share this review anonymously as an example to the entire class&amp;quot;.&lt;br /&gt;
# After clicking on the submit button, the review submitted has been made public.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza Home]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123647</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123647"/>
		<updated>2019-04-08T22:05:07Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
* A new partial file will be created in various views possibly a helper for '''response_controller.rb'''.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
In our project, the implementation of a new functionality would be through a '''Delegation pattern''' which is an object-oriented design pattern that allows object composition to achieve the same code reuse as inheritance.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123642</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123642"/>
		<updated>2019-04-08T21:51:44Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Team Members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
&lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123641</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123641"/>
		<updated>2019-04-08T21:51:09Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123640</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123640"/>
		<updated>2019-04-08T21:50:35Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction (''Reviews in Expertiza'') ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123639</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123639"/>
		<updated>2019-04-08T21:49:31Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Reviews in Expertiza ===&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
1) Nikita Pramod Paranjape&lt;br /&gt;
2) Ashish Kumar Jayantilal Jain &lt;br /&gt;
3) Devang Upadhyay&lt;br /&gt;
4) Pranav Reddy Anumula&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123638</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123638"/>
		<updated>2019-04-08T21:46:45Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Questions for Akanksha == &lt;br /&gt;
1) Is the instructor going to be able to select only one example review or many examples?&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Reviews in Expertiza ===&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== What is this project adding to the reviews? ===&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What needs to be done? === &lt;br /&gt;
&lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that will change === &lt;br /&gt;
&lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123637</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123637"/>
		<updated>2019-04-08T21:44:57Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Reviews in Expertiza */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Questions for Akanksha == &lt;br /&gt;
1) Is the instructor going to be able to select only one example review or many examples?&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Reviews in Expertiza ===&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is this project adding to the reviews? ==&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What needs to be done? == &lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files that will change == &lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123636</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123636"/>
		<updated>2019-04-08T21:42:50Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Files that will change */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Questions for Akanksha == &lt;br /&gt;
1) Is the instructor going to be able to select only one example review or many examples?&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reviews in Expertiza ==&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is this project adding to the reviews? ==&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What needs to be done? == &lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files that will change == &lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123635</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123635"/>
		<updated>2019-04-08T21:42:24Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Files that will change */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Questions for Akanksha == &lt;br /&gt;
1) Is the instructor going to be able to select only one example review or many examples?&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reviews in Expertiza ==&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is this project adding to the reviews? ==&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What needs to be done? == &lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files that will change == &lt;br /&gt;
* Create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes '''db/schema.rb''' &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a checkbox in a view: '''views/response/response.html.erb''':333.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add code to check the status field from response.html.erb and update the db, in controller: '''app/controllers/response_controller.rb''' (in method &amp;quot;create&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For the instructors to carry out the tasks of selecting reviews, the file '''team_users_popup.html.haml''' which is under the '''views/popup''' directory.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* For the other participants to view the sample reviews, the file '''list.html.erb''' which is under the '''views/student_review''' directory.&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123630</id>
		<title>CSC/ECE 517 Spring 2019/E1933 Allow reviewer to say review can be shown to class as an example</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019/E1933_Allow_reviewer_to_say_review_can_be_shown_to_class_as_an_example&amp;diff=123630"/>
		<updated>2019-04-08T20:43:01Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* What needs to be done? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Questions for Akanksha == &lt;br /&gt;
1) Is the instructor going to be able to select only one example review or many examples?&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reviews in Expertiza ==&lt;br /&gt;
In Expertiza, students can review other team's project. The instructors can create assignment specific questions based on which students can write these reviews. The questions are in rating and/or comment form. Currently the students can only see what review their team got for their work. The instructors can see who reviewed each team and the review they gave.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is this project adding to the reviews? ==&lt;br /&gt;
The goal of this project is to enable instructors to select certain reviews to show as examples to the entire class. Thus the students will be able to see good reviews that one student has submitted for another student's work. The students will be able to get understand what a good review looks like and what exactly is expected from them when they review any other team's work. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What needs to be done? == &lt;br /&gt;
1) '''Creating a checkbox''': When a student submits a review, they should be able to choose if they want to make their review public or private. Thus we are going to add a checkbox to the review page.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) '''Allow instructors to select(remove) sample reviews''': If a review has been made public by the reviewer, the instructor will be able to select that review to be made an example review. If the review is already an example review, the instructor will be able to remove from the set of example reviews. If the review was private, the instructor will be shown a notice that 'This review is private.' and they will not be able to select it as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) '''Allow students to see good reviews''': When a student wants to review other team's work, they will be shown a link to sample reviews that the instructor has selected for them.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) '''Sample reviews need not be from the current session of a course''': When an instructor selects sample reviews, they should be shown to students in all sessions of that course even after the original session has ended. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) '''Allow students to make a review private''': Students should be able to make a review private even after they have made it public. If a review has been made private after an instructor has selected it as an example review, it should still not be displayed to students as an example review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files that will change == &lt;br /&gt;
* create migration for the responses model called status which can take on the values 'selected', 'public' and 'private'. Changes db/schema.rb &amp;lt;br&amp;gt;&lt;br /&gt;
* create a checkbox in a view: views/response/response.html.erb:333.&lt;br /&gt;
* add code to check the status field from response.html.erb and update the db, in controller: app/controllers/response_controller.rb (in method &amp;quot;create&amp;quot;).&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1912._Export_Tagged_Comments&amp;diff=123084</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1912. Export Tagged Comments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1912._Export_Tagged_Comments&amp;diff=123084"/>
		<updated>2019-04-02T02:54:26Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
Expertiza is an Open Source Web Application Software managed by National Science Foundation. Expertiza is used by many courses including CSC 517 for assignment management. It has functionalities such as peer reviews, teammate reviews and tagging reviews in which students can provide feedback on other's work which helps peer in better developing the project. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
The Expertiza team currently had to manually fire queries in the database in order to get the tag submissions made by an individual user(student) on each review for a particular assignment. In this way, the team got the data from the entire class, which was then used to feed the Machine Learning algorithms. But many times it used to happen that students made random tags and the ML algorithm was not able to make good predictions out of it, hence in order to solve this issue a new idea was proposed as to select on the students which did not create outliers in the predictions and hence, therefore, it is a good proposal.&lt;br /&gt;
&lt;br /&gt;
===Tasks Identified===&lt;br /&gt;
In order to perform this task following files were identified where the code hasbeen added.&lt;br /&gt;
* In _answer_tagging_report.html.erb view, a button is added for exporting the student's tagged values&lt;br /&gt;
* A checkbox for each row has been added in order to select students whose tags are to be exported(By default all will be selected).&lt;br /&gt;
* A method is written in export_file_controller.rb controller named export_tags that exports the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The workflow diagram of our implementation is shown here: &lt;br /&gt;
&lt;br /&gt;
[[File:E1912flow.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have added a default select all checkbox under ''Report tags done by each user'' which enables student selection for exporting tags in the CSV file. We have added a column for the checkbox and a button named '''Export''' which on click generates the CSV file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912Export.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is the snippet of the same view ''_answer_tagging_report.html.erb ''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag(export_tags, method: 'put',:id =&amp;gt; 'tst') do %&amp;gt;&lt;br /&gt;
      &amp;lt;div id=&amp;quot;tab-summary&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;h4  align=&amp;quot;center&amp;quot;&amp;gt;Summary for each user&amp;lt;/h4&amp;gt;&lt;br /&gt;
        &amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;thead&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Username&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Percentage of tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags not done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# possible tags to do&amp;lt;img src='/assets/info.png' title='Number of answers that fulfil the prerequisite setup for each&lt;br /&gt;
 tags (Answer of certain question types and has a length of greater than the threshold).'/&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th&amp;gt;Tags export&amp;lt;/th&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;/thead&amp;gt;&lt;br /&gt;
          &amp;lt;% @user_tagging_report.each do |key, val| %&amp;gt;&lt;br /&gt;
              &amp;lt;tr&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.name(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.fullname(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.percentage.to_s %&amp;gt;%&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_not_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagable %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= check_box_tag 'names[]', val.user.name(session[:ip]), true %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
     &amp;lt;%= submit_tag &amp;quot;Export&amp;quot;,:value =&amp;gt; 'Export' ,:form =&amp;gt; 'tst',method: 'put' %&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Screencast==&lt;br /&gt;
# [https://drive.google.com/open?id=1B65_N3bWwPlSyiXMhXzXypKvKLN09g0r Here] is the link to a screen recording on how to access the functionality and export the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Code and Snapshots==&lt;br /&gt;
&lt;br /&gt;
We have written a method inside the ''export_file_controller.rb''. Once this method is called it queries on the ''name'' array passed from the view and exports the CSV file with the required data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def export_tags&lt;br /&gt;
    @user_ids = User.where(&amp;quot;name IN (?)&amp;quot;, params[:names])&lt;br /&gt;
    @students = AnswerTag.select('answers.*, answer_tags.*').joins(:answer).where(&amp;quot;answer_tags.answer_id = answers.id and answer_tags.user_id IN (?)&amp;quot;, @user_ids.pluck(:id))&lt;br /&gt;
    attributes = %w[user_id tag_prompt_deployment_id comments value]&lt;br /&gt;
&lt;br /&gt;
    csv_data = CSV.generate(col_sep: &amp;quot;,&amp;quot;) do |csv|&lt;br /&gt;
      csv &amp;lt;&amp;lt; attributes&lt;br /&gt;
      @students.each do |item|&lt;br /&gt;
        csv &amp;lt;&amp;lt; item.attributes.values_at(*attributes)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    filename = &amp;quot;Tags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    send_data csv_data,&lt;br /&gt;
              type: 'text/csv; charset=iso-8859-1; header=present',&lt;br /&gt;
              disposition: &amp;quot;attachment; filename=#{filename}.csv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file has '''user_id, tag_prompt_deployment_id, comments and value'''. We can see that some comments are repeated it is because every review that is received has at least 1 tag for it. Hence we see the repetition. The value column has -1, 0 and 1 as No, not answered and Yes meaning respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912csv.png]]&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
The functionality for our project was to implement exporting of tagged comments from the Expertiza system. For this, we will approach the project by using the delegation pattern to add exporting capabilities to the export file controller for exporting tags.&lt;br /&gt;
&lt;br /&gt;
==Teammates==&lt;br /&gt;
Mentor - Harsh Agrawal&lt;br /&gt;
&lt;br /&gt;
* Aishwarya Subramanian (asubram7)&lt;br /&gt;
* Dyuti De (dde)&lt;br /&gt;
* Ankit Mody (amody)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# [https://github.com/expertiza/expertiza Github Repository for Expertiza]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables Expertiza Documentation on Database Tables]&lt;br /&gt;
# [https://guides.rubyonrails.org/api_app.html Rails Guide Documentation]&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1912._Export_Tagged_Comments&amp;diff=123083</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1912. Export Tagged Comments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1912._Export_Tagged_Comments&amp;diff=123083"/>
		<updated>2019-04-02T02:53:59Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: Undo revision 123082 by Drupadhy (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
Expertiza is an Open Source Web Application Software managed by National Science Foundation. Expertiza is used by many courses including CSC 517 for assignment management. It has functionalities such as peer reviews, teammate reviews and tagging reviews in which students can provide feedback on other's work which helps peer in better developing the project. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
The Expertiza team currently had to manually fire queries in the database in order to get the tag submissions made by an individual user(student) on each review for a particular assignment. In this way, the team got the data from the entire class, which was then used to feed the Machine Learning algorithms. But many times it used to happen that students made random tags and the ML algorithm was not able to make good predictions out of it, hence in order to solve this issue a new idea was proposed as to select on the students which did not create outliers in the predictions and hence, therefore, it is a good proposal.&lt;br /&gt;
&lt;br /&gt;
===Tasks Identified===&lt;br /&gt;
In order to perform this task following files were identified where the code hasbeen added.&lt;br /&gt;
* In _answer_tagging_report.html.erb view, a button is added for exporting the student's tagged values&lt;br /&gt;
* A checkbox for each row has been added in order to select students whose tags are to be exported(By default all will be selected).&lt;br /&gt;
* A method is written in export_file_controller.rb controller named export_tags that exports the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The workflow diagram of our implementation is shown here: &lt;br /&gt;
&lt;br /&gt;
[[File:E1912flow.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have added a default select all checkbox under ''Report tags done by each user'' which enables student selection for exporting tags in the CSV file. We have added a column for the checkbox and a button named '''Export''' which on click generates the CSV file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912Export.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is the snippet of the same view ''_answer_tagging_report.html.erb ''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag(export_tags, method: 'put',:id =&amp;gt; 'tst') do %&amp;gt;&lt;br /&gt;
      &amp;lt;div id=&amp;quot;tab-summary&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;h4  align=&amp;quot;center&amp;quot;&amp;gt;Summary for each user&amp;lt;/h4&amp;gt;&lt;br /&gt;
        &amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;thead&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Username&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Percentage of tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags not done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# possible tags to do&amp;lt;img src='/assets/info.png' title='Number of answers that fulfil the prerequisite setup for each&lt;br /&gt;
 tags (Answer of certain question types and has a length of greater than the threshold).'/&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th&amp;gt;Tags export&amp;lt;/th&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;/thead&amp;gt;&lt;br /&gt;
          &amp;lt;% @user_tagging_report.each do |key, val| %&amp;gt;&lt;br /&gt;
              &amp;lt;tr&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.name(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.fullname(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.percentage.to_s %&amp;gt;%&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_not_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagable %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= check_box_tag 'names[]', val.user.name(session[:ip]), true %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
     &amp;lt;%= submit_tag &amp;quot;Export&amp;quot;,:value =&amp;gt; 'Export' ,:form =&amp;gt; 'tst',method: 'put' %&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Screen Record==&lt;br /&gt;
# [https://drive.google.com/open?id=1B65_N3bWwPlSyiXMhXzXypKvKLN09g0r Here] is the link to a screen recording on how to access the functionality and export the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Code and Snapshots==&lt;br /&gt;
&lt;br /&gt;
We have written a method inside the ''export_file_controller.rb''. Once this method is called it queries on the ''name'' array passed from the view and exports the CSV file with the required data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def export_tags&lt;br /&gt;
    @user_ids = User.where(&amp;quot;name IN (?)&amp;quot;, params[:names])&lt;br /&gt;
    @students = AnswerTag.select('answers.*, answer_tags.*').joins(:answer).where(&amp;quot;answer_tags.answer_id = answers.id and answer_tags.user_id IN (?)&amp;quot;, @user_ids.pluck(:id))&lt;br /&gt;
    attributes = %w[user_id tag_prompt_deployment_id comments value]&lt;br /&gt;
&lt;br /&gt;
    csv_data = CSV.generate(col_sep: &amp;quot;,&amp;quot;) do |csv|&lt;br /&gt;
      csv &amp;lt;&amp;lt; attributes&lt;br /&gt;
      @students.each do |item|&lt;br /&gt;
        csv &amp;lt;&amp;lt; item.attributes.values_at(*attributes)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    filename = &amp;quot;Tags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    send_data csv_data,&lt;br /&gt;
              type: 'text/csv; charset=iso-8859-1; header=present',&lt;br /&gt;
              disposition: &amp;quot;attachment; filename=#{filename}.csv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file has '''user_id, tag_prompt_deployment_id, comments and value'''. We can see that some comments are repeated it is because every review that is received has at least 1 tag for it. Hence we see the repetition. The value column has -1, 0 and 1 as No, not answered and Yes meaning respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912csv.png]]&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
The functionality for our project was to implement exporting of tagged comments from the Expertiza system. For this, we will approach the project by using the delegation pattern to add exporting capabilities to the export file controller for exporting tags.&lt;br /&gt;
&lt;br /&gt;
==Teammates==&lt;br /&gt;
Mentor - Harsh Agrawal&lt;br /&gt;
&lt;br /&gt;
* Aishwarya Subramanian (asubram7)&lt;br /&gt;
* Dyuti De (dde)&lt;br /&gt;
* Ankit Mody (amody)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# [https://github.com/expertiza/expertiza Github Repository for Expertiza]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables Expertiza Documentation on Database Tables]&lt;br /&gt;
# [https://guides.rubyonrails.org/api_app.html Rails Guide Documentation]&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1912._Export_Tagged_Comments&amp;diff=123082</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1912. Export Tagged Comments</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1912._Export_Tagged_Comments&amp;diff=123082"/>
		<updated>2019-04-02T02:52:42Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Screen Record */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
Expertiza is an Open Source Web Application Software managed by National Science Foundation. Expertiza is used by many courses including CSC 517 for assignment management. It has functionalities such as peer reviews, teammate reviews and tagging reviews in which students can provide feedback on other's work which helps peer in better developing the project. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
The Expertiza team currently had to manually fire queries in the database in order to get the tag submissions made by an individual user(student) on each review for a particular assignment. In this way, the team got the data from the entire class, which was then used to feed the Machine Learning algorithms. But many times it used to happen that students made random tags and the ML algorithm was not able to make good predictions out of it, hence in order to solve this issue a new idea was proposed as to select on the students which did not create outliers in the predictions and hence, therefore, it is a good proposal.&lt;br /&gt;
&lt;br /&gt;
===Tasks Identified===&lt;br /&gt;
In order to perform this task following files were identified where the code hasbeen added.&lt;br /&gt;
* In _answer_tagging_report.html.erb view, a button is added for exporting the student's tagged values&lt;br /&gt;
* A checkbox for each row has been added in order to select students whose tags are to be exported(By default all will be selected).&lt;br /&gt;
* A method is written in export_file_controller.rb controller named export_tags that exports the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The workflow diagram of our implementation is shown here: &lt;br /&gt;
&lt;br /&gt;
[[File:E1912flow.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have added a default select all checkbox under ''Report tags done by each user'' which enables student selection for exporting tags in the CSV file. We have added a column for the checkbox and a button named '''Export''' which on click generates the CSV file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912Export.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is the snippet of the same view ''_answer_tagging_report.html.erb ''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag(export_tags, method: 'put',:id =&amp;gt; 'tst') do %&amp;gt;&lt;br /&gt;
      &amp;lt;div id=&amp;quot;tab-summary&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;h4  align=&amp;quot;center&amp;quot;&amp;gt;Summary for each user&amp;lt;/h4&amp;gt;&lt;br /&gt;
        &amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;thead&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Username&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Percentage of tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags not done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# possible tags to do&amp;lt;img src='/assets/info.png' title='Number of answers that fulfil the prerequisite setup for each&lt;br /&gt;
 tags (Answer of certain question types and has a length of greater than the threshold).'/&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th&amp;gt;Tags export&amp;lt;/th&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;/thead&amp;gt;&lt;br /&gt;
          &amp;lt;% @user_tagging_report.each do |key, val| %&amp;gt;&lt;br /&gt;
              &amp;lt;tr&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.name(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.fullname(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.percentage.to_s %&amp;gt;%&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_not_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagable %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= check_box_tag 'names[]', val.user.name(session[:ip]), true %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
     &amp;lt;%= submit_tag &amp;quot;Export&amp;quot;,:value =&amp;gt; 'Export' ,:form =&amp;gt; 'tst',method: 'put' %&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Screencast==&lt;br /&gt;
# [https://drive.google.com/open?id=1B65_N3bWwPlSyiXMhXzXypKvKLN09g0r Here] is the link to a screen recording on how to access the functionality and export the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Code and Snapshots==&lt;br /&gt;
&lt;br /&gt;
We have written a method inside the ''export_file_controller.rb''. Once this method is called it queries on the ''name'' array passed from the view and exports the CSV file with the required data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def export_tags&lt;br /&gt;
    @user_ids = User.where(&amp;quot;name IN (?)&amp;quot;, params[:names])&lt;br /&gt;
    @students = AnswerTag.select('answers.*, answer_tags.*').joins(:answer).where(&amp;quot;answer_tags.answer_id = answers.id and answer_tags.user_id IN (?)&amp;quot;, @user_ids.pluck(:id))&lt;br /&gt;
    attributes = %w[user_id tag_prompt_deployment_id comments value]&lt;br /&gt;
&lt;br /&gt;
    csv_data = CSV.generate(col_sep: &amp;quot;,&amp;quot;) do |csv|&lt;br /&gt;
      csv &amp;lt;&amp;lt; attributes&lt;br /&gt;
      @students.each do |item|&lt;br /&gt;
        csv &amp;lt;&amp;lt; item.attributes.values_at(*attributes)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    filename = &amp;quot;Tags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    send_data csv_data,&lt;br /&gt;
              type: 'text/csv; charset=iso-8859-1; header=present',&lt;br /&gt;
              disposition: &amp;quot;attachment; filename=#{filename}.csv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file has '''user_id, tag_prompt_deployment_id, comments and value'''. We can see that some comments are repeated it is because every review that is received has at least 1 tag for it. Hence we see the repetition. The value column has -1, 0 and 1 as No, not answered and Yes meaning respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912csv.png]]&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
The functionality for our project was to implement exporting of tagged comments from the Expertiza system. For this, we will approach the project by using the delegation pattern to add exporting capabilities to the export file controller for exporting tags.&lt;br /&gt;
&lt;br /&gt;
==Teammates==&lt;br /&gt;
Mentor - Harsh Agrawal&lt;br /&gt;
&lt;br /&gt;
* Aishwarya Subramanian (asubram7)&lt;br /&gt;
* Dyuti De (dde)&lt;br /&gt;
* Ankit Mody (amody)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# [https://github.com/expertiza/expertiza Github Repository for Expertiza]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables Expertiza Documentation on Database Tables]&lt;br /&gt;
# [https://guides.rubyonrails.org/api_app.html Rails Guide Documentation]&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123078</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123078"/>
		<updated>2019-04-02T02:45:16Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method '''get_css_style_for_calibration_report''' had a switch case. It was refactored using a dictionary where the case numbers were keys and the outputs of each case were the corresponding values. &lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    css_class = case diff.abs&lt;br /&gt;
                when 0&lt;br /&gt;
                  'c5'&lt;br /&gt;
                when 1&lt;br /&gt;
                  'c4'&lt;br /&gt;
                when 2&lt;br /&gt;
                  'c3'&lt;br /&gt;
                when 3&lt;br /&gt;
                  'c2'&lt;br /&gt;
                else&lt;br /&gt;
                  'c1'&lt;br /&gt;
                end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    dict = {0 =&amp;gt; 'c5',1 =&amp;gt; 'c4',2 =&amp;gt; 'c3',3 =&amp;gt; 'c2'}&lt;br /&gt;
    if dict.key?(diff.abs)&lt;br /&gt;
      css_class = dict[diff.abs]&lt;br /&gt;
    else&lt;br /&gt;
      css_class = 'c1'&lt;br /&gt;
    end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
For the methods which were called in views, manual testing was carried out to check that the code was not affected after refactoring methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[File:Screenshot-FunctionCalls-Final.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[File:Screenshot-Partials-Final.png]]&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
RSpec.describe ReviewMappingHelper, :type =&amp;gt; :helper do&lt;br /&gt;
  describe &amp;quot;test get_css_style_for_calibration_report&amp;quot; do&lt;br /&gt;
    it &amp;quot;should return correct css for calibration report&amp;quot; do&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(1)).to eq('c4')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(0)).to eq('c5')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(2)).to eq('c3')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(3)).to eq('c2')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(4)).to eq('c1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request. For our project Strategy Pattern was very helpful in adding functions to views as partials.&lt;br /&gt;
&lt;br /&gt;
==Screencast==&lt;br /&gt;
&lt;br /&gt;
To access the screencast for our project, please click [https://drive.google.com/file/d/1b06VrvYOWb7ti0DVhQS_r6LaMEbNBzTd/view?usp=sharing '''Screencast''']&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123076</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123076"/>
		<updated>2019-04-02T02:44:05Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Screencast */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method '''get_css_style_for_calibration_report''' had a switch case. It was refactored using a dictionary where the case numbers were keys and the outputs of each case were the corresponding values. &lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    css_class = case diff.abs&lt;br /&gt;
                when 0&lt;br /&gt;
                  'c5'&lt;br /&gt;
                when 1&lt;br /&gt;
                  'c4'&lt;br /&gt;
                when 2&lt;br /&gt;
                  'c3'&lt;br /&gt;
                when 3&lt;br /&gt;
                  'c2'&lt;br /&gt;
                else&lt;br /&gt;
                  'c1'&lt;br /&gt;
                end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    dict = {0 =&amp;gt; 'c5',1 =&amp;gt; 'c4',2 =&amp;gt; 'c3',3 =&amp;gt; 'c2'}&lt;br /&gt;
    if dict.key?(diff.abs)&lt;br /&gt;
      css_class = dict[diff.abs]&lt;br /&gt;
    else&lt;br /&gt;
      css_class = 'c1'&lt;br /&gt;
    end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
For the methods which were called in views, manual testing was carried out to check that the code was not affected after refactoring methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[File:Screenshot-FunctionCalls-Final.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[File:Screenshot-Partials-Final.png]]&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
RSpec.describe ReviewMappingHelper, :type =&amp;gt; :helper do&lt;br /&gt;
  describe &amp;quot;test get_css_style_for_calibration_report&amp;quot; do&lt;br /&gt;
    it &amp;quot;should return correct css for calibration report&amp;quot; do&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(1)).to eq('c4')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(0)).to eq('c5')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(2)).to eq('c3')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(3)).to eq('c2')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(4)).to eq('c1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Screencast==&lt;br /&gt;
&lt;br /&gt;
To access the screencast for our project, please click [https://drive.google.com/file/d/1b06VrvYOWb7ti0DVhQS_r6LaMEbNBzTd/view?usp=sharing '''Screencast''']&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123067</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123067"/>
		<updated>2019-04-02T02:32:57Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Manual Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method '''get_css_style_for_calibration_report''' had a switch case. It was refactored using a dictionary where the case numbers were keys and the outputs of each case were the corresponding values. &lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    css_class = case diff.abs&lt;br /&gt;
                when 0&lt;br /&gt;
                  'c5'&lt;br /&gt;
                when 1&lt;br /&gt;
                  'c4'&lt;br /&gt;
                when 2&lt;br /&gt;
                  'c3'&lt;br /&gt;
                when 3&lt;br /&gt;
                  'c2'&lt;br /&gt;
                else&lt;br /&gt;
                  'c1'&lt;br /&gt;
                end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    dict = {0 =&amp;gt; 'c5',1 =&amp;gt; 'c4',2 =&amp;gt; 'c3',3 =&amp;gt; 'c2'}&lt;br /&gt;
    if dict.key?(diff.abs)&lt;br /&gt;
      css_class = dict[diff.abs]&lt;br /&gt;
    else&lt;br /&gt;
      css_class = 'c1'&lt;br /&gt;
    end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
For the methods which were called in views, manual testing was carried out to check that the code was not affected after refactoring methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[File:Screenshot-FunctionCalls-Final.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[File:Screenshot-Partials-Final.png]]&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
RSpec.describe ReviewMappingHelper, :type =&amp;gt; :helper do&lt;br /&gt;
  describe &amp;quot;test get_css_style_for_calibration_report&amp;quot; do&lt;br /&gt;
    it &amp;quot;should return correct css for calibration report&amp;quot; do&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(1)).to eq('c4')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(0)).to eq('c5')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(2)).to eq('c3')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(3)).to eq('c2')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(4)).to eq('c1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Screencast==&lt;br /&gt;
&lt;br /&gt;
To access the screencast for our project, please click the link: &amp;quot; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot-Partials-Final.png&amp;diff=123066</id>
		<title>File:Screenshot-Partials-Final.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot-Partials-Final.png&amp;diff=123066"/>
		<updated>2019-04-02T02:32:02Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot-Partials.png&amp;diff=123064</id>
		<title>File:Screenshot-Partials.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot-Partials.png&amp;diff=123064"/>
		<updated>2019-04-02T02:27:16Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123062</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123062"/>
		<updated>2019-04-02T02:24:56Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Manual Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method '''get_css_style_for_calibration_report''' had a switch case. It was refactored using a dictionary where the case numbers were keys and the outputs of each case were the corresponding values. &lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    css_class = case diff.abs&lt;br /&gt;
                when 0&lt;br /&gt;
                  'c5'&lt;br /&gt;
                when 1&lt;br /&gt;
                  'c4'&lt;br /&gt;
                when 2&lt;br /&gt;
                  'c3'&lt;br /&gt;
                when 3&lt;br /&gt;
                  'c2'&lt;br /&gt;
                else&lt;br /&gt;
                  'c1'&lt;br /&gt;
                end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    dict = {0 =&amp;gt; 'c5',1 =&amp;gt; 'c4',2 =&amp;gt; 'c3',3 =&amp;gt; 'c2'}&lt;br /&gt;
    if dict.key?(diff.abs)&lt;br /&gt;
      css_class = dict[diff.abs]&lt;br /&gt;
    else&lt;br /&gt;
      css_class = 'c1'&lt;br /&gt;
    end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
For the methods which were called in views, manual testing was carried out to check that the code was not affected after refactoring methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[File:Screenshot-FunctionCalls-Final.png]]&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
RSpec.describe ReviewMappingHelper, :type =&amp;gt; :helper do&lt;br /&gt;
  describe &amp;quot;test get_css_style_for_calibration_report&amp;quot; do&lt;br /&gt;
    it &amp;quot;should return correct css for calibration report&amp;quot; do&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(1)).to eq('c4')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(0)).to eq('c5')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(2)).to eq('c3')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(3)).to eq('c2')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(4)).to eq('c1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Screencast==&lt;br /&gt;
&lt;br /&gt;
To access the screencast for our project, please click the link: &amp;quot; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot-FunctionCalls-Final.png&amp;diff=123059</id>
		<title>File:Screenshot-FunctionCalls-Final.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot-FunctionCalls-Final.png&amp;diff=123059"/>
		<updated>2019-04-02T02:21:46Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot-FunctionCalls.png&amp;diff=123047</id>
		<title>File:Screenshot-FunctionCalls.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot-FunctionCalls.png&amp;diff=123047"/>
		<updated>2019-04-02T02:13:18Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123040</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123040"/>
		<updated>2019-04-02T02:08:30Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method '''get_css_style_for_calibration_report''' had a switch case. It was refactored using a dictionary where the case numbers were keys and the outputs of each case were the corresponding values. &lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    css_class = case diff.abs&lt;br /&gt;
                when 0&lt;br /&gt;
                  'c5'&lt;br /&gt;
                when 1&lt;br /&gt;
                  'c4'&lt;br /&gt;
                when 2&lt;br /&gt;
                  'c3'&lt;br /&gt;
                when 3&lt;br /&gt;
                  'c2'&lt;br /&gt;
                else&lt;br /&gt;
                  'c1'&lt;br /&gt;
                end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    dict = {0 =&amp;gt; 'c5',1 =&amp;gt; 'c4',2 =&amp;gt; 'c3',3 =&amp;gt; 'c2'}&lt;br /&gt;
    if dict.key?(diff.abs)&lt;br /&gt;
      css_class = dict[diff.abs]&lt;br /&gt;
    else&lt;br /&gt;
      css_class = 'c1'&lt;br /&gt;
    end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
RSpec.describe ReviewMappingHelper, :type =&amp;gt; :helper do&lt;br /&gt;
  describe &amp;quot;test get_css_style_for_calibration_report&amp;quot; do&lt;br /&gt;
    it &amp;quot;should return correct css for calibration report&amp;quot; do&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(1)).to eq('c4')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(0)).to eq('c5')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(2)).to eq('c3')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(3)).to eq('c2')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(4)).to eq('c1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Screencast==&lt;br /&gt;
&lt;br /&gt;
To access the screencast for our project, please click the link: &amp;quot; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123018</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123018"/>
		<updated>2019-04-02T01:48:29Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* RSpec Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method '''get_css_style_for_calibration_report''' had a switch case. It was refactored using a dictionary where the case numbers were keys and the outputs of each case were the corresponding values. &lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    css_class = case diff.abs&lt;br /&gt;
                when 0&lt;br /&gt;
                  'c5'&lt;br /&gt;
                when 1&lt;br /&gt;
                  'c4'&lt;br /&gt;
                when 2&lt;br /&gt;
                  'c3'&lt;br /&gt;
                when 3&lt;br /&gt;
                  'c2'&lt;br /&gt;
                else&lt;br /&gt;
                  'c1'&lt;br /&gt;
                end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    dict = {0 =&amp;gt; 'c5',1 =&amp;gt; 'c4',2 =&amp;gt; 'c3',3 =&amp;gt; 'c2'}&lt;br /&gt;
    if dict.key?(diff.abs)&lt;br /&gt;
      css_class = dict[diff.abs]&lt;br /&gt;
    else&lt;br /&gt;
      css_class = 'c1'&lt;br /&gt;
    end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
RSpec.describe ReviewMappingHelper, :type =&amp;gt; :helper do&lt;br /&gt;
  describe &amp;quot;test get_css_style_for_calibration_report&amp;quot; do&lt;br /&gt;
    it &amp;quot;should return correct css for calibration report&amp;quot; do&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(1)).to eq('c4')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(0)).to eq('c5')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(2)).to eq('c3')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(3)).to eq('c2')&lt;br /&gt;
      expect(helper.get_css_style_for_calibration_report(4)).to eq('c1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123014</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123014"/>
		<updated>2019-04-02T01:44:25Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Refactoring method */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method '''get_css_style_for_calibration_report''' had a switch case. It was refactored using a dictionary where the case numbers were keys and the outputs of each case were the corresponding values. &lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    css_class = case diff.abs&lt;br /&gt;
                when 0&lt;br /&gt;
                  'c5'&lt;br /&gt;
                when 1&lt;br /&gt;
                  'c4'&lt;br /&gt;
                when 2&lt;br /&gt;
                  'c3'&lt;br /&gt;
                when 3&lt;br /&gt;
                  'c2'&lt;br /&gt;
                else&lt;br /&gt;
                  'c1'&lt;br /&gt;
                end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    dict = {0 =&amp;gt; 'c5',1 =&amp;gt; 'c4',2 =&amp;gt; 'c3',3 =&amp;gt; 'c2'}&lt;br /&gt;
    if dict.key?(diff.abs)&lt;br /&gt;
      css_class = dict[diff.abs]&lt;br /&gt;
    else&lt;br /&gt;
      css_class = 'c1'&lt;br /&gt;
    end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123012</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123012"/>
		<updated>2019-04-02T01:43:54Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Refactoring method */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method '''get_css_style_for_calibration_report''' had a switch case. It was refactored using a dictionary where the case numbers were keys and the outputs of each case were the corresponding values. &lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    css_class = case diff.abs&lt;br /&gt;
                when 0&lt;br /&gt;
                  'c5'&lt;br /&gt;
                when 1&lt;br /&gt;
                  'c4'&lt;br /&gt;
                when 2&lt;br /&gt;
                  'c3'&lt;br /&gt;
                when 3&lt;br /&gt;
                  'c2'&lt;br /&gt;
                else&lt;br /&gt;
                  'c1'&lt;br /&gt;
                end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    dict = {0 =&amp;gt; 'c5',1 =&amp;gt; 'c4',2 =&amp;gt; 'c3',3 =&amp;gt; 'c2'}&lt;br /&gt;
    if dict.key?(diff.abs)&lt;br /&gt;
      css_class = dict[diff.abs]&lt;br /&gt;
    else&lt;br /&gt;
      css_class = 'c1'&lt;br /&gt;
    end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123009</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=123009"/>
		<updated>2019-04-02T01:41:46Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Refactoring method */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method '''get_css_style_for_calibration_report''' had a switch case. It was refactored using a dictionary where the case numbers were keys and the outputs of each case were the corresponding values. The refactored method is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def get_css_style_for_calibration_report(diff)&lt;br /&gt;
    # diff - difference between stu's answer and instructor's answer&lt;br /&gt;
    dict = {0 =&amp;gt; 'c5',1 =&amp;gt; 'c4',2 =&amp;gt; 'c3',3 =&amp;gt; 'c2'}&lt;br /&gt;
    if dict.key?(diff.abs)&lt;br /&gt;
      css_class = dict[diff.abs]&lt;br /&gt;
    else&lt;br /&gt;
      css_class = 'c1'&lt;br /&gt;
    end&lt;br /&gt;
    css_class&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=122881</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=122881"/>
		<updated>2019-04-01T21:31:38Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
There were changes made in the function name as well as one of the function was added to partials. Testing was carried out to check the behavior of these functions. In one of the case, a drop-down menu was tested i.e, all the links that were accessed were tested. It was checked that clicking on every link produced the desired output in all the options of the drop-down menu. For these cases, Manual testing, as well as RSpec testing, was carried out.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=122872</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=122872"/>
		<updated>2019-04-01T21:16:32Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* RSpec Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. The partial that was added had impacts on the drop-down menus. Given below is one of the snippets of the entire code written in the file '''review_mapping_helper_spec.rb'''. The file path is '''spec/features/review_mapping_helper_spec.rb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'Tests Review report' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:assignment, course: nil, name: 'Test Assignment')&lt;br /&gt;
    assignment_id = Assignment.where(name: 'Test Assignment')[0].id&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit &amp;quot;/reports/response_report?id=#{assignment_id}&amp;quot;&lt;br /&gt;
    click_on 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display reviews done&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display Reviewer&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display team reviewed&amp;quot; do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=122845</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1913. Refactor review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb&amp;diff=122845"/>
		<updated>2019-04-01T19:40:45Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: Created page with &amp;quot;==Introduction== This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.  ===Expertiza Background === Expertiza is ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. Given below are the tests which are written for the functions that are modified:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe 'My Test Cases' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:role_of_student)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'View reports'&lt;br /&gt;
    expect(page).to have_current_path('/reports/response_report')&lt;br /&gt;
    click_link 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review summary&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review summary&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review summary&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019&amp;diff=122844</id>
		<title>CSC/ECE 517 Spring 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019&amp;diff=122844"/>
		<updated>2019-04-01T19:39:13Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE 517 Spring 2019 - Project E1905. Refactor questionnaires_controller.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1916. Fix Code Climate issues in controllers with names beginning with A through N]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1906. Refactor stage deadlines in Assignment.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project M1901 Implement missing WebAudio automation support]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1917. Fix Code Climate issues in controllers with names beginning with P through Z]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1921. Write tests for popup controller.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - M1902 Refactor bluetooth support for better maintainability]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - E1922. Write tests for assessment360 controller.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1907 Refactor response controller]]&lt;br /&gt;
*[[CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Spring_2019_-_Project_E1913. Refactor_review_mapping_helper.rb]]&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1913_refactor_review_mapping_helper&amp;diff=122749</id>
		<title>E1913 refactor review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1913_refactor_review_mapping_helper&amp;diff=122749"/>
		<updated>2019-03-31T22:55:01Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* RSpec Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. Given below are the tests which are written for the functions that are modified:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe 'My Test Cases' do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:role_of_student)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'View reports'&lt;br /&gt;
    expect(page).to have_current_path('/reports/response_report')&lt;br /&gt;
    click_link 'View'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review summary&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review summary&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Reviewer')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review summary&amp;quot;, js: true do&lt;br /&gt;
    expect(page).to have_content('Team reviewed')&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1913_refactor_review_mapping_helper&amp;diff=122738</id>
		<title>E1913 refactor review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1913_refactor_review_mapping_helper&amp;diff=122738"/>
		<updated>2019-03-31T20:33:36Z</updated>

		<summary type="html">&lt;p&gt;Drupadhy: /* Refactoring method */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page gives a description of the changes made for the ''review_mapping_helper.rb'' of Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
===Expertiza Background ===&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, codes, websites, etc). Instructors add and grade the assignments submitted by students to Expertiza. Students can be assigned in teams based on their selection of the topics. It has functionalities such as peer reviews in which students can provide feedback on other's work which helps peer in better developing the project. It is supported by the National Science Foundation.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
&lt;br /&gt;
The review_mapping_helper.rb  has multiple functions with a wrong naming convention, they are classic examples of bad function names. These functions are to be refactored accordingly. Few of the variables names used in the method must also be refactored to make it more relevant and understandable. In addition, some function's code is to be optimized to ensure that it follows DRY principle. Tests must be written for the functions which are modified. Also, comments must be added to all functions of the file. The create_report_table_header function contains HTML code which should be ideally placed in the view as partials, which will allow to easily reuse the code in Rails application.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
===Flowchart===&lt;br /&gt;
&lt;br /&gt;
The following process is carried out to complete the project-&lt;br /&gt;
&lt;br /&gt;
                                                                           [[File:Steps for project.png]]&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method names====&lt;br /&gt;
All the method names that are refactored are mentioned below-&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_each_review_and_feedback_response_map     ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''  &lt;br /&gt;
&lt;br /&gt;
  get_certain_round_review_and_feedback_response_map_for_feedback_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_certain_review_and_feedback_response_map   ''[Since the method and file is already about feedback report, we do not need to put feedback_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_team_name_color_in_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_team_colour   ''[The method suggests that team color is defined in the review report, so we do not need to put in_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_each_round_score_awarded_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_awarded_review_score   ''[The method gets the awarded score for review, so we do not need to put for_review_report in the method name]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:''' &lt;br /&gt;
&lt;br /&gt;
  get_min_max_avg_value_for_review_report&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  get_review_metrics   ''[Since minimum, maximum and average value is the part of metrics in review report, we can replace it all by metrics]'' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Refactoring method====&lt;br /&gt;
&lt;br /&gt;
The following method was not used or called in any of the files in the project. Due to that reason, the entire function was commented out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_current_round(reviewer_id)&lt;br /&gt;
    user_id = Participant.find(reviewer_id).user.id&lt;br /&gt;
    topic_id = SignedUpTeam.topic_id(@assignment.id, user_id)&lt;br /&gt;
    @assignment.number_of_current_round(topic_id)&lt;br /&gt;
    @assignment.num_review_rounds if @assignment.get_current_stage(topic_id) == &amp;quot;Finished&amp;quot; || @assignment.get_current_stage(topic_id) == &amp;quot;metareview&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Comments added to various functions===&lt;br /&gt;
There were several methods which didn't have any comments or the comments weren't meaningful. In all those cases, comments have been added or changed which are mentioned as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the review score awarded based on each round of the review&lt;br /&gt;
  def get_each_round_score_awarded_for_review_report(reviewer_id, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets minimum, maximum and average value for all the reviews&lt;br /&gt;
  def get_min_max_avg_value_for_review_report(round, team_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # sorts the reviewers by the average volume of reviews in each round, in descending order&lt;br /&gt;
  def sort_reviewer_by_review_volume_desc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # displays all the average scores in round 1, 2 and 3&lt;br /&gt;
  def display_volume_metric(overall_avg_vol, avg_vol_in_round_1, avg_vol_in_round_2, avg_vol_in_round_3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # moves data of reviews in each round from a current round&lt;br /&gt;
  def initialize_chart_elements(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # The data of all the reviews is displayed in the form of a bar chart&lt;br /&gt;
  def display_volume_metric_chart(reviewer)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # For assignments with 1 team member, the following method returns user's fullname else it returns &amp;quot;team name&amp;quot; that a particular reviewee belongs to.&lt;br /&gt;
  def get_team_reviewed_link_name(max_team_size, response, reviewee_id) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # if the current stage is &amp;quot;submission&amp;quot; or &amp;quot;review&amp;quot;, function returns the current round number otherwise &lt;br /&gt;
  # if the current stage is &amp;quot;Finished&amp;quot; or &amp;quot;metareview&amp;quot;, function returns the number of rounds of review completed&lt;br /&gt;
  def get_current_round_for_review_report(reviewer_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the response map data such as reviewer id, reviewd object id and type for the review report&lt;br /&gt;
  def get_data_for_review_report(reviewed_object_id, reviewer_id, type)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # gets the team name's color according to review and assignment submission status&lt;br /&gt;
  def get_team_name_color_in_review_report(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks if a review was submitted in every round and gives the total responses count&lt;br /&gt;
  def response_for_each_round?(response_map)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # returns hyperlink of the assignment that has been submitted on the due date&lt;br /&gt;
  def submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function placed in the view as partials=== &lt;br /&gt;
&lt;br /&gt;
The following method has been removed from the '''review_mapping_helper.rb''' and added to the views as partials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def create_report_table_header(headers = {})&lt;br /&gt;
    table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;\&lt;br /&gt;
                    &amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;\&lt;br /&gt;
                    &amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot;&lt;br /&gt;
    headers.each do |header, percentage|&lt;br /&gt;
      table_header += if percentage&lt;br /&gt;
                        &amp;quot;&amp;lt;th width = #{percentage}&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      else&lt;br /&gt;
                        &amp;quot;&amp;lt;th&amp;gt;\&lt;br /&gt;
                        #{header.humanize}\&lt;br /&gt;
                                        &amp;lt;/th&amp;gt;&amp;quot;&lt;br /&gt;
                      end&lt;br /&gt;
    end&lt;br /&gt;
    table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
    table_header.html_safe&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the code available in views in the file '''_report_table_header.html.erb''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% table_header = &amp;quot;&amp;lt;div class = 'reviewreport'&amp;gt;&amp;lt;table width='100% cellspacing='0' cellpadding='2' border='0' class='table table-striped'&amp;gt;&amp;lt;tr bgcolor='#CCCCCC'&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;%  headers.each do |header, percentage| %&amp;gt;&lt;br /&gt;
 &amp;lt;% table_header += if percentage %&amp;gt;&lt;br /&gt;
   &amp;lt;% &amp;quot;&amp;lt;th width = #{percentage}&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
   &amp;lt;%&amp;quot;&amp;lt;th&amp;gt; #{header.humanize} &amp;lt;/th&amp;gt;&amp;quot; %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;%  table_header += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;%&amp;gt;&lt;br /&gt;
&amp;lt;% return table_header.html_safe %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
&lt;br /&gt;
''To be carried out''&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
RSpec testing was carried out for the methods that had been refactored. Given below are the tests which are written for the functions that are modified:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rspec'&lt;br /&gt;
&lt;br /&gt;
describe 'My Test Cases' do&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review metrics&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:role_of_student)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'View reports'&lt;br /&gt;
    expect(page).to have_current_path('/reports/response_report')&lt;br /&gt;
    click_link 'View'&lt;br /&gt;
    expect(page).to have_content('Metrics')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review grades of each round&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:role_of_student)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'View reports'&lt;br /&gt;
    expect(page).to have_current_path('/reports/response_report')&lt;br /&gt;
    click_link 'View'&lt;br /&gt;
    expect(page).to have_content('Score awarded')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;can display review summary&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:role_of_student)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'View reports'&lt;br /&gt;
    expect(page).to have_current_path('/reports/response_report')&lt;br /&gt;
    click_link 'View'&lt;br /&gt;
    expect(page).to have_content('Reviews done')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
A design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
&lt;br /&gt;
During the process of refactoring methods as well as method names,'''Strategy Pattern''' was used in the implementation. The Strategy pattern is most useful when you want to provide multiple ways of processing a request, without hard-coding knowledge about those different methods into the object that handles the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1) https://www.rubyguides.com/2015/12/ruby-refactoring/&lt;br /&gt;
&lt;br /&gt;
2) http://rspec.info/documentation/3.8/rspec-core/&lt;br /&gt;
&lt;br /&gt;
3) http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
&lt;br /&gt;
Ashish Kumar Jayantilal Jain&lt;br /&gt;
&lt;br /&gt;
Aishwarya Tirumala&lt;br /&gt;
&lt;br /&gt;
Devang Upadhyay&lt;/div&gt;</summary>
		<author><name>Drupadhy</name></author>
	</entry>
</feed>