<?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=Ashah22</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=Ashah22"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Ashah22"/>
	<updated>2026-10-12T05:51:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114797</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114797"/>
		<updated>2017-12-14T21:53:27Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Changes to be Implemented */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&lt;br /&gt;
&lt;br /&gt;
=====Additional Changes=====&lt;br /&gt;
Other than the changes required to be done by us, during the course of the project we have implemented extra changes as suggested by the professor. These changes include:&lt;br /&gt;
&lt;br /&gt;
1. Providing the delete review logic in case the instructor decides to change the review strategy.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. To track 20 mins of inactivity to auto-save the review in case when the user starts the review and forgets to save it. A message will flash every 30 secs in the last 5 mins to inform the user that the review will be saved if there is no activity.&lt;br /&gt;
&lt;br /&gt;
3. Initially, the e-mail to the reviewee, for the review was sent when a response was created (i.e when a response is saved). Because of this there is a chance that the reviewee won't find any review since the review has not been submitted only saved. Thus, we changed this so that the e-mail is sent only when a review is submitted.&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id and they click on the '''edit''' button, then a error message will be displayed which will inform the user that his/her teammate is already editing the same review.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; color: black;&amp;quot;&lt;br /&gt;
|response_map.rb&lt;br /&gt;
|assignment.rb&lt;br /&gt;
|response_controller.rb&lt;br /&gt;
|review_mapping_controller.rb&lt;br /&gt;
|-&lt;br /&gt;
|/edit/_review_strategy.html.erb&lt;br /&gt;
|student_review/_responses.html.erb&lt;br /&gt;
|review_mapping/select_reviewer.html.haml&lt;br /&gt;
|response_controller_spec.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_controller.rb&lt;br /&gt;
|student_review_controller.rb&lt;br /&gt;
|application_helper.rb&lt;br /&gt;
|access_helper.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_team.rb&lt;br /&gt;
|/response/response.html.erb&lt;br /&gt;
|/review_mapping/_list_review_mapping.html.erb&lt;br /&gt;
|/student_review/_set_dynamic_review.html.erb&lt;br /&gt;
|-&lt;br /&gt;
|/student_review/list.html.erb&lt;br /&gt;
|config/routes.rb&lt;br /&gt;
|assignment_controller_spec.rb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we lock the response using that team member's id. It can only be unlocked when the review has been saved. When locked the other team members can only view the review.&lt;br /&gt;
&lt;br /&gt;
'''Case 2:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
The beginning of a review is a special case since when the begin button is clicked a review form is only rendered. Nothing is saved. Since there is no response object linked to the review, we cannot lock anything. Thus, if this case is not handled all the teammates will be able to begin the review concurrently and the person who saves last will overwrite changes of all teammates. Thus, we lock the respnse_map. Now when one of the teammate begins the review ,and the other teammates try to begin too, they will get an error saying that the review is already being edited by someone else. &lt;br /&gt;
&lt;br /&gt;
'''Case 3:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
If a team member forgets to save or submit a review and has not closed the browser window, then we automatically save the review after an inactivity timeout of 20 mins thus unlocking it for the other team members to edit. After 15 mins of inactivity a message will be flashed every 30 secs, on the users screen informing him/her that after 5 more mins of inactivity the review will be auto-saved. The progress will not be lost. If the user wishes to continue editing, the counter can be reset with a simple movement of the cursor.&lt;br /&gt;
&lt;br /&gt;
'''Case 4:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
At a critical time, if a team is unable to contact the team member who has locked the review by closing the browser window without saving the review, the other team members can contact the instructor who has been provided an unlock button for such emergency situations. The instructor can now unlock that review and then the other team members can edit it. This button was added since, in the case when a user directly closes the window without saving, we cannot track inactivity. Thus, the 20 mins auto-save condition will not function. For this condition to work there is a prerequisite that the browser window must be open. Thus, to handle the case when the aforementioned prerequisite fails, we have provided the unlock button to the instructor.&lt;br /&gt;
&lt;br /&gt;
'''Case 5:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
An instructor can delete completed review if he/she decides to change the review strategy for an assignment between team reviews and individual reviews. When the instructor changes the strategy and clicks on the save button, there will be a pop-up confirming if the instructor wants to delete all the reviews. If a user is editing a review at the instant when instructor is deleting the reviews, upon pressing the save review or submit review button, the user is redirected to the student_review/list.html.erb page&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants. As seen in the new implementation, the delete button has been removed from the review_strategy tab. Instead, now when the instructor decides to change the review policy, s/he will get a pop-up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Delete_new_imp.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''When Instructor assigns reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:instructor_assign_reviews.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Test the delete_reviews method to check whether it displays a flash message when there are no reviews to be delete.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
[https://github.com/ghnguye2/expertiza.git Github Project Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1118 Github Pull Request]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/8vkHx3Hqm8g Project Demo]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114796</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114796"/>
		<updated>2017-12-14T21:41:31Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Changes to be Implemented */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Additional Changes=====&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id and they click on the '''edit''' button, then a error message will be displayed which will inform the user that his/her teammate is already editing the same review.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; color: black;&amp;quot;&lt;br /&gt;
|response_map.rb&lt;br /&gt;
|assignment.rb&lt;br /&gt;
|response_controller.rb&lt;br /&gt;
|review_mapping_controller.rb&lt;br /&gt;
|-&lt;br /&gt;
|/edit/_review_strategy.html.erb&lt;br /&gt;
|student_review/_responses.html.erb&lt;br /&gt;
|review_mapping/select_reviewer.html.haml&lt;br /&gt;
|response_controller_spec.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_controller.rb&lt;br /&gt;
|student_review_controller.rb&lt;br /&gt;
|application_helper.rb&lt;br /&gt;
|access_helper.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_team.rb&lt;br /&gt;
|/response/response.html.erb&lt;br /&gt;
|/review_mapping/_list_review_mapping.html.erb&lt;br /&gt;
|/student_review/_set_dynamic_review.html.erb&lt;br /&gt;
|-&lt;br /&gt;
|/student_review/list.html.erb&lt;br /&gt;
|config/routes.rb&lt;br /&gt;
|assignment_controller_spec.rb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we lock the response using that team member's id. It can only be unlocked when the review has been saved. When locked the other team members can only view the review.&lt;br /&gt;
&lt;br /&gt;
'''Case 2:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
The beginning of a review is a special case since when the begin button is clicked a review form is only rendered. Nothing is saved. Since there is no response object linked to the review, we cannot lock anything. Thus, if this case is not handled all the teammates will be able to begin the review concurrently and the person who saves last will overwrite changes of all teammates. Thus, we lock the respnse_map. Now when one of the teammate begins the review ,and the other teammates try to begin too, they will get an error saying that the review is already being edited by someone else. &lt;br /&gt;
&lt;br /&gt;
'''Case 3:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
If a team member forgets to save or submit a review and has not closed the browser window, then we automatically save the review after an inactivity timeout of 20 mins thus unlocking it for the other team members to edit. After 15 mins of inactivity a message will be flashed every 30 secs, on the users screen informing him/her that after 5 more mins of inactivity the review will be auto-saved. The progress will not be lost. If the user wishes to continue editing, the counter can be reset with a simple movement of the cursor.&lt;br /&gt;
&lt;br /&gt;
'''Case 4:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
At a critical time, if a team is unable to contact the team member who has locked the review by closing the browser window without saving the review, the other team members can contact the instructor who has been provided an unlock button for such emergency situations. The instructor can now unlock that review and then the other team members can edit it. This button was added since, in the case when a user directly closes the window without saving, we cannot track inactivity. Thus, the 20 mins auto-save condition will not function. For this condition to work there is a prerequisite that the browser window must be open. Thus, to handle the case when the aforementioned prerequisite fails, we have provided the unlock button to the instructor.&lt;br /&gt;
&lt;br /&gt;
'''Case 5:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
An instructor can delete completed review if he/she decides to change the review strategy for an assignment between team reviews and individual reviews. When the instructor changes the strategy and clicks on the save button, there will be a pop-up confirming if the instructor wants to delete all the reviews. If a user is editing a review at the instant when instructor is deleting the reviews, upon pressing the save review or submit review button, the user is redirected to the student_review/list.html.erb page&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants. As seen in the new implementation, the delete button has been removed from the review_strategy tab. Instead, now when the instructor decides to change the review policy, s/he will get a pop-up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Delete_new_imp.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''When Instructor assigns reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:instructor_assign_reviews.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Test the delete_reviews method to check whether it displays a flash message when there are no reviews to be delete.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
[https://github.com/ghnguye2/expertiza.git Github Project Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1118 Github Pull Request]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/8vkHx3Hqm8g Project Demo]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114795</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114795"/>
		<updated>2017-12-14T21:36:31Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id and they click on the '''edit''' button, then a error message will be displayed which will inform the user that his/her teammate is already editing the same review.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; color: black;&amp;quot;&lt;br /&gt;
|response_map.rb&lt;br /&gt;
|assignment.rb&lt;br /&gt;
|response_controller.rb&lt;br /&gt;
|review_mapping_controller.rb&lt;br /&gt;
|-&lt;br /&gt;
|/edit/_review_strategy.html.erb&lt;br /&gt;
|student_review/_responses.html.erb&lt;br /&gt;
|review_mapping/select_reviewer.html.haml&lt;br /&gt;
|response_controller_spec.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_controller.rb&lt;br /&gt;
|student_review_controller.rb&lt;br /&gt;
|application_helper.rb&lt;br /&gt;
|access_helper.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_team.rb&lt;br /&gt;
|/response/response.html.erb&lt;br /&gt;
|/review_mapping/_list_review_mapping.html.erb&lt;br /&gt;
|/student_review/_set_dynamic_review.html.erb&lt;br /&gt;
|-&lt;br /&gt;
|/student_review/list.html.erb&lt;br /&gt;
|config/routes.rb&lt;br /&gt;
|assignment_controller_spec.rb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we lock the response using that team member's id. It can only be unlocked when the review has been saved. When locked the other team members can only view the review.&lt;br /&gt;
&lt;br /&gt;
'''Case 2:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
The beginning of a review is a special case since when the begin button is clicked a review form is only rendered. Nothing is saved. Since there is no response object linked to the review, we cannot lock anything. Thus, if this case is not handled all the teammates will be able to begin the review concurrently and the person who saves last will overwrite changes of all teammates. Thus, we lock the respnse_map. Now when one of the teammate begins the review ,and the other teammates try to begin too, they will get an error saying that the review is already being edited by someone else. &lt;br /&gt;
&lt;br /&gt;
'''Case 3:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
If a team member forgets to save or submit a review and has not closed the browser window, then we automatically save the review after an inactivity timeout of 20 mins thus unlocking it for the other team members to edit. After 15 mins of inactivity a message will be flashed every 30 secs, on the users screen informing him/her that after 5 more mins of inactivity the review will be auto-saved. The progress will not be lost. If the user wishes to continue editing, the counter can be reset with a simple movement of the cursor.&lt;br /&gt;
&lt;br /&gt;
'''Case 4:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
At a critical time, if a team is unable to contact the team member who has locked the review by closing the browser window without saving the review, the other team members can contact the instructor who has been provided an unlock button for such emergency situations. The instructor can now unlock that review and then the other team members can edit it. This button was added since, in the case when a user directly closes the window without saving, we cannot track inactivity. Thus, the 20 mins auto-save condition will not function. For this condition to work there is a prerequisite that the browser window must be open. Thus, to handle the case when the aforementioned prerequisite fails, we have provided the unlock button to the instructor.&lt;br /&gt;
&lt;br /&gt;
'''Case 5:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
An instructor can delete completed review if he/she decides to change the review strategy for an assignment between team reviews and individual reviews. When the instructor changes the strategy and clicks on the save button, there will be a pop-up confirming if the instructor wants to delete all the reviews. If a user is editing a review at the instant when instructor is deleting the reviews, upon pressing the save review or submit review button, the user is redirected to the student_review/list.html.erb page&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants. As seen in the new implementation, the delete button has been removed from the review_strategy tab. Instead, now when the instructor decides to change the review policy, s/he will get a pop-up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Delete_new_imp.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''When Instructor assigns reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:instructor_assign_reviews.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Test the delete_reviews method to check whether it displays a flash message when there are no reviews to be delete.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
[https://github.com/ghnguye2/expertiza.git Github Project Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1118 Github Pull Request]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/8vkHx3Hqm8g Project Demo]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Delete_new_imp.png&amp;diff=114794</id>
		<title>File:Delete new imp.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Delete_new_imp.png&amp;diff=114794"/>
		<updated>2017-12-14T21:33:32Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114793</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114793"/>
		<updated>2017-12-14T21:30:12Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Edge Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id and they click on the '''edit''' button, then a error message will be displayed which will inform the user that his/her teammate is already editing the same review.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; color: black;&amp;quot;&lt;br /&gt;
|response_map.rb&lt;br /&gt;
|assignment.rb&lt;br /&gt;
|response_controller.rb&lt;br /&gt;
|review_mapping_controller.rb&lt;br /&gt;
|-&lt;br /&gt;
|/edit/_review_strategy.html.erb&lt;br /&gt;
|student_review/_responses.html.erb&lt;br /&gt;
|review_mapping/select_reviewer.html.haml&lt;br /&gt;
|response_controller_spec.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_controller.rb&lt;br /&gt;
|student_review_controller.rb&lt;br /&gt;
|application_helper.rb&lt;br /&gt;
|access_helper.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_team.rb&lt;br /&gt;
|/response/response.html.erb&lt;br /&gt;
|/review_mapping/_list_review_mapping.html.erb&lt;br /&gt;
|/student_review/_set_dynamic_review.html.erb&lt;br /&gt;
|-&lt;br /&gt;
|/student_review/list.html.erb&lt;br /&gt;
|config/routes.rb&lt;br /&gt;
|assignment_controller_spec.rb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we lock the response using that team member's id. It can only be unlocked when the review has been saved. When locked the other team members can only view the review.&lt;br /&gt;
&lt;br /&gt;
'''Case 2:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
The beginning of a review is a special case since when the begin button is clicked a review form is only rendered. Nothing is saved. Since there is no response object linked to the review, we cannot lock anything. Thus, if this case is not handled all the teammates will be able to begin the review concurrently and the person who saves last will overwrite changes of all teammates. Thus, we lock the respnse_map. Now when one of the teammate begins the review ,and the other teammates try to begin too, they will get an error saying that the review is already being edited by someone else. &lt;br /&gt;
&lt;br /&gt;
'''Case 3:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
If a team member forgets to save or submit a review and has not closed the browser window, then we automatically save the review after an inactivity timeout of 20 mins thus unlocking it for the other team members to edit. After 15 mins of inactivity a message will be flashed every 30 secs, on the users screen informing him/her that after 5 more mins of inactivity the review will be auto-saved. The progress will not be lost. If the user wishes to continue editing, the counter can be reset with a simple movement of the cursor.&lt;br /&gt;
&lt;br /&gt;
'''Case 4:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
At a critical time, if a team is unable to contact the team member who has locked the review by closing the browser window without saving the review, the other team members can contact the instructor who has been provided an unlock button for such emergency situations. The instructor can now unlock that review and then the other team members can edit it. This button was added since, in the case when a user directly closes the window without saving, we cannot track inactivity. Thus, the 20 mins auto-save condition will not function. For this condition to work there is a prerequisite that the browser window must be open. Thus, to handle the case when the aforementioned prerequisite fails, we have provided the unlock button to the instructor.&lt;br /&gt;
&lt;br /&gt;
'''Case 5:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
An instructor can delete completed review if he/she decides to change the review strategy for an assignment between team reviews and individual reviews. When the instructor changes the strategy and clicks on the save button, there will be a pop-up confirming if the instructor wants to delete all the reviews. If a user is editing a review at the instant when instructor is deleting the reviews, upon pressing the save review or submit review button, the user is redirected to the student_review/list.html.erb page&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:review_strategy.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''When Instructor assigns reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:instructor_assign_reviews.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Test the delete_reviews method to check whether it displays a flash message when there are no reviews to be delete.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
[https://github.com/ghnguye2/expertiza.git Github Project Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1118 Github Pull Request]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/8vkHx3Hqm8g Project Demo]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114792</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114792"/>
		<updated>2017-12-14T21:26:09Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Edge Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id and they click on the '''edit''' button, then a error message will be displayed which will inform the user that his/her teammate is already editing the same review.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; color: black;&amp;quot;&lt;br /&gt;
|response_map.rb&lt;br /&gt;
|assignment.rb&lt;br /&gt;
|response_controller.rb&lt;br /&gt;
|review_mapping_controller.rb&lt;br /&gt;
|-&lt;br /&gt;
|/edit/_review_strategy.html.erb&lt;br /&gt;
|student_review/_responses.html.erb&lt;br /&gt;
|review_mapping/select_reviewer.html.haml&lt;br /&gt;
|response_controller_spec.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_controller.rb&lt;br /&gt;
|student_review_controller.rb&lt;br /&gt;
|application_helper.rb&lt;br /&gt;
|access_helper.rb&lt;br /&gt;
|-&lt;br /&gt;
|assignment_team.rb&lt;br /&gt;
|/response/response.html.erb&lt;br /&gt;
|/review_mapping/_list_review_mapping.html.erb&lt;br /&gt;
|/student_review/_set_dynamic_review.html.erb&lt;br /&gt;
|-&lt;br /&gt;
|/student_review/list.html.erb&lt;br /&gt;
|config/routes.rb&lt;br /&gt;
|assignment_controller_spec.rb&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we lock the response using that team member's id. It can only be unlocked when the review has been saved. When locked the other team members can only view the review.&lt;br /&gt;
&lt;br /&gt;
'''Case 2:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
The beginning of a review is a special case since when the begin button is clicked a review form is only rendered. Nothing is saved. Since there is no response object linked to the review, we cannot lock anything. Thus, if this case is not handled all the teammates will be able to begin the review concurrently and the person who saves last will overwrite changes of all teammates. Thus, we lock the respnse_map. Now when one of the teammate begins the review ,and the other teammates try to begin too, they will get an error saying that the review is already being edited by someone else. &lt;br /&gt;
&lt;br /&gt;
'''Case 3:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
If a team member forgets to save or submit a review and has not closed the browser window, then we automatically save the review after an inactivity timeout of 20 mins thus unlocking it for the other team members to edit. After 15 mins of inactivity a message will be flashed every 30 secs, on the users screen informing him/her that after 5 more mins of inactivity the review will be auto-saved. The progress will not be lost. If the user wishes to continue editing, the counter can be reset with a simple movement of the cursor.&lt;br /&gt;
&lt;br /&gt;
'''Case 4:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
At a critical time, if a team is unable to contact the team member who has locked the review by closing the browser window without saving the review, the other team members can contact the instructor who has been provided an unlock button for such emergency situations. The instructor can now unlock that review and then the other team members can edit it.&lt;br /&gt;
&lt;br /&gt;
'''Case 5:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
An instructor can delete completed review if he/she decides to change the review strategy for an assignment between team reviews and individual reviews. When the instructor changes the strategy and clicks on the save button, there will be a pop-up confirming if the instructor wants to delete all the reviews. If a user is editing a review at the instant when instructor is deleting the reviews, upon pressing the save review or submit review button, the user is redirected to the student_review/list.html.erb page&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:review_strategy.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''When Instructor assigns reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:instructor_assign_reviews.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Test the delete_reviews method to check whether it displays a flash message when there are no reviews to be delete.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional Links==&lt;br /&gt;
[https://github.com/ghnguye2/expertiza.git Github Project Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1118 Github Pull Request]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://youtu.be/8vkHx3Hqm8g Project Demo]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114420</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114420"/>
		<updated>2017-12-04T16:55:42Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Edge Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id and they click on the '''edit''' button, then a error message will be displayed which will inform the user that his/her teammate is already editing the same review.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
6. student_review/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
7. review_mapping/select_reviewer.html.haml&lt;br /&gt;
&lt;br /&gt;
8. response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
9. assignment_controller.rb&lt;br /&gt;
&lt;br /&gt;
10. student_review_controller.rb&lt;br /&gt;
&lt;br /&gt;
11. application_helper.rb&lt;br /&gt;
&lt;br /&gt;
12. access_helper.rb&lt;br /&gt;
&lt;br /&gt;
13. assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
14. /response/response.html.erb&lt;br /&gt;
&lt;br /&gt;
15. /review_mapping/_list_review_mapping.html.erb&lt;br /&gt;
&lt;br /&gt;
16. /student_review/_set_dynamic_review.html.erb&lt;br /&gt;
&lt;br /&gt;
17. /student_review/list.html.erb&lt;br /&gt;
&lt;br /&gt;
18. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
19. assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we lock the response using that team member's id. It can only be unlocked when the review has been saved. When locked the other team members can only view the review.&lt;br /&gt;
&lt;br /&gt;
'''Case 2:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
The beginning of a review is a special case since when the begin button is clicked a review form is only rendered. Nothing is saved. Since there is no response object linked to the review, we cannot lock anything. Thus, if this case is not handled all the teammates will be able to begin the review concurrently and the person who saves last will overwrite changes of all teammates. Thus, we lock the respnse_map. Now when one of the teammate begins the review ,and the other teammates try to begin too, they will get an error saying that the review is already being edited by someone else. &lt;br /&gt;
&lt;br /&gt;
'''Case 3:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
If a team member forgets to save or submit a review and has not closed the browser window, then we automatically save the review after an inactivity timeout of 20 mins thus unlocking it for the other team members to edit.&lt;br /&gt;
&lt;br /&gt;
'''Case 4:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
At a critical time, if a team is unable to contact the team member who has locked the review by closing the browser window without saving the review, the other team members can contact the instructor who has been provided an unlock button for such emergency situations. The instructor can now unlock that review and then the other team members can edit it.&lt;br /&gt;
&lt;br /&gt;
'''Case 5:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
An instructor can delete completed review if he/she decides to change the switch strategy for an assignment between tema reviews and individual reviews. If a user is editing a review at the instant when instructor is deleting the reviews, upon pressing the save review or submit review button, the user is redirected to the student_review/list.html.erb page&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Test the delete_reviews method to check whether it asks for a confirmation before deleting the reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114419</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114419"/>
		<updated>2017-12-04T16:38:49Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Files Involved */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id and they click on the '''edit''' button, then a error message will be displayed which will inform the user that his/her teammate is already editing the same review.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
6. student_review/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
7. review_mapping/select_reviewer.html.haml&lt;br /&gt;
&lt;br /&gt;
8. response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
9. assignment_controller.rb&lt;br /&gt;
&lt;br /&gt;
10. student_review_controller.rb&lt;br /&gt;
&lt;br /&gt;
11. application_helper.rb&lt;br /&gt;
&lt;br /&gt;
12. access_helper.rb&lt;br /&gt;
&lt;br /&gt;
13. assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
14. /response/response.html.erb&lt;br /&gt;
&lt;br /&gt;
15. /review_mapping/_list_review_mapping.html.erb&lt;br /&gt;
&lt;br /&gt;
16. /student_review/_set_dynamic_review.html.erb&lt;br /&gt;
&lt;br /&gt;
17. /student_review/list.html.erb&lt;br /&gt;
&lt;br /&gt;
18. config/routes.rb&lt;br /&gt;
&lt;br /&gt;
19. assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we do lock the response using that team member id&lt;br /&gt;
&lt;br /&gt;
'''Case 2:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
If a team member forgets to save or submit a review and has not closed the browser window, then we automatically save the review after a timeout of 20 mins thus unlocking it for the other team members to edit.&lt;br /&gt;
&lt;br /&gt;
'''Case 3:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
At a critical time, if a team is unable to contact the team member who has locked the review by closing the browser window without saving the review, the other team members can contact the instructor who has been provided an unlock button for such emergency situations. The instructor can now unlock that review and then the other team members can edit it.&lt;br /&gt;
&lt;br /&gt;
'''Case 4:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
An instructor can delete completed review if he/she decides to change the switch strategy for an assignment between tema reviews and individual reviews. If a user is editing a review at the instant when instructor is deleting the reviews, upon pressing the save review or submit review button, the user is redirected to the student_review/list.html.erb page&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Test the delete_reviews method to check whether it asks for a confirmation before deleting the reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114418</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114418"/>
		<updated>2017-12-04T16:34:28Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Files Involved */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id and they click on the '''edit''' button, then a error message will be displayed which will inform the user that his/her teammate is already editing the same review.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
6. student_review/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
7. review_mapping/select_reviewer.html.haml&lt;br /&gt;
&lt;br /&gt;
8. response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
9. assignment_controller.rb&lt;br /&gt;
&lt;br /&gt;
10. student_review_controller.rb&lt;br /&gt;
&lt;br /&gt;
11. application_helper.rb&lt;br /&gt;
&lt;br /&gt;
12. access_helper.rb&lt;br /&gt;
&lt;br /&gt;
13. assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
14. /response/response.html.erb&lt;br /&gt;
&lt;br /&gt;
15. /review_mapping/_list_review_mapping.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we do lock the response using that team member id&lt;br /&gt;
&lt;br /&gt;
'''Case 2:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
If a team member forgets to save or submit a review and has not closed the browser window, then we automatically save the review after a timeout of 20 mins thus unlocking it for the other team members to edit.&lt;br /&gt;
&lt;br /&gt;
'''Case 3:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
At a critical time, if a team is unable to contact the team member who has locked the review by closing the browser window without saving the review, the other team members can contact the instructor who has been provided an unlock button for such emergency situations. The instructor can now unlock that review and then the other team members can edit it.&lt;br /&gt;
&lt;br /&gt;
'''Case 4:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
An instructor can delete completed review if he/she decides to change the switch strategy for an assignment between tema reviews and individual reviews. If a user is editing a review at the instant when instructor is deleting the reviews, upon pressing the save review or submit review button, the user is redirected to the student_review/list.html.erb page&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Test the delete_reviews method to check whether it asks for a confirmation before deleting the reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114334</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114334"/>
		<updated>2017-12-02T21:53:29Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id and they click on the '''edit''' button, then a error message will be displayed which will inform the user that his/her teammate is already editing the same review.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
6. student_review/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
7. review_mapping/select_reviewer.html.haml&lt;br /&gt;
&lt;br /&gt;
8. response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we do lock the response using that teammates id&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*new&lt;br /&gt;
1. Test the delete_reviews method to check whether it asks for a confirmation before deleting the reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*old &lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114329</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114329"/>
		<updated>2017-12-02T20:11:19Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Edge Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
6. student_review/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
7. review_mapping/select_reviewer.html.haml&lt;br /&gt;
&lt;br /&gt;
8. response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
'''Case 1:&amp;lt;br&amp;gt;'''&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
We are not allowing concurrent editing of reviews for teams. We are doing this by locking the response_map. Thus, when a team member is editing a review we do lock the response using that teammates id&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*new&lt;br /&gt;
1. Test the delete_reviews method to check whether it asks for a confirmation before deleting the reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*old &lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114328</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114328"/>
		<updated>2017-12-02T20:07:54Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Use Case */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
6. student_review/_responses.html.erb&lt;br /&gt;
&lt;br /&gt;
7. review_mapping/select_reviewer.html.haml&lt;br /&gt;
&lt;br /&gt;
8. response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Design Principles Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edge Cases===&lt;br /&gt;
Apart from the case explained above we have handled two edge cases. These cases are as explained below:&lt;br /&gt;
&lt;br /&gt;
*Case 1:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario:&amp;lt;br&amp;gt;&lt;br /&gt;
Since we are not allowing&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan includes testing for the new team-based reviewing functionality that we have added. Our test plan includes the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*new&lt;br /&gt;
1. Test the delete_reviews method to check whether it asks for a confirmation before deleting the reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Test the delete_reviews method to check whether it displays the success flash message on deletion of reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Test the action_allowed? method to check whether it denies certain action when the review is locked by a user other than current user.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Test the action_allowed? method to check whether it allows certain action when the review is locked by current user.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Test the reviewer_is_team_member method to check whether the current user is a member of the assignment review team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*old &lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114142</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114142"/>
		<updated>2017-12-02T01:45:14Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Database Migrations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Database Migrations===&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|centre]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114141</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114141"/>
		<updated>2017-12-02T01:44:46Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Database Migrations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Database Migrations===&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114140</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114140"/>
		<updated>2017-12-02T01:44:28Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Database Migrations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Database Migrations===&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
[[File:Db_migr13.png|none|frame]]&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114139</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114139"/>
		<updated>2017-12-02T01:42:58Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Database Migrations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Database Migrations===&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
Db_migr13.png&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114138</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114138"/>
		<updated>2017-12-02T01:42:46Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Changes to be Implemented */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Database Migrations===&lt;br /&gt;
We will add the following fields in existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
Db_migr13.png&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in various existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Db_migr13.png&amp;diff=114137</id>
		<title>File:Db migr13.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Db_migr13.png&amp;diff=114137"/>
		<updated>2017-12-02T01:40:01Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Db_migr12.png&amp;diff=114136</id>
		<title>File:Db migr12.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Db_migr12.png&amp;diff=114136"/>
		<updated>2017-12-02T01:38:51Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Db_migr1.png&amp;diff=114135</id>
		<title>File:Db migr1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Db_migr1.png&amp;diff=114135"/>
		<updated>2017-12-02T01:37:33Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114134</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114134"/>
		<updated>2017-12-02T01:32:33Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Changes to be Implemented */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database Migrations==&lt;br /&gt;
We will add the following fields in various existing models of the Expertiza.&lt;br /&gt;
&lt;br /&gt;
1. To assign team based reviewing attribute to the assignemnts a new boolean field reviewer_is_team was added to the with the default set to false.&lt;br /&gt;
&lt;br /&gt;
2. To create a common response for all the team members we added a team_id field to the ResponseMap model. This identifies the reviewer team.&lt;br /&gt;
&lt;br /&gt;
3. To prevent concurrent editing of the reviews by the team members we lock the response in the ResponseMap. This is check is based on the new is_locked field.&lt;br /&gt;
&lt;br /&gt;
4. To identify the user who has locked the review we have also added a locked_by field in the ResponseMap which carries the current_user.id.   &lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114133</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114133"/>
		<updated>2017-12-02T01:27:59Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field &amp;quot;reviewer_is_team?&amp;quot; should be added to the Assignments table to record whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. A new field &amp;quot;team_id&amp;quot; should be added to the ResponseMaps table which records the team_id when the reviewer_is_team? check-box is checked otherwise the default value is zero. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
6. This feature is provided to handle a rare edge case. Say that the instructor decides to change the review strategy after the reviews have already started. Now, the format of the response_maps already created will not match the response_maps that will be created after the strategy change. Thus, if the instructor wants to change the strategy, s/he can delete all reviews already done, and then instruct students to start over. The ''delete_reviews'' method is defined in the ''assignment'' model. Our method deletes all the response_maps as well as all the response objects created.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  def delete_reviews&lt;br /&gt;
    responsemap = ResponseMap.where(reviewed_object_id: self.id, type: 'ReviewResponseMap')&lt;br /&gt;
    response = Response.where(map_id: responsemap.ids)&lt;br /&gt;
    response.each { |r| Answer.destroy_all(response_id: r.id)}&lt;br /&gt;
    Response.destroy_all(map_id: responsemap.ids)&lt;br /&gt;
    ResponseMap.destroy_all(id: responsemap.ids)&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114130</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114130"/>
		<updated>2017-12-02T01:15:34Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field &amp;quot;reviewer_is_team?&amp;quot; should be added to the Assignments table to record whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. A new field &amp;quot;team_id&amp;quot; should be added to the ResponseMaps table which records the team_id when the reviewer_is_team? check-box is checked otherwise the default value is zero. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4/5. Changes 4 and 5 are both database migrations. Thus, we just add these fields in their respective tables.&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114129</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114129"/>
		<updated>2017-12-02T01:13:14Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field &amp;quot;reviewer_is_team?&amp;quot; should be added to the Assignments table to record whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. A new field &amp;quot;team_id&amp;quot; should be added to the ResponseMaps table which records the team_id when the reviewer_is_team? check-box is checked otherwise the default value is zero. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. This is an important feature since if we allow teammates to edit reviews concurrently, each of them will overwrite each other's changes. We have handled this by using the ''is_locked'' and ''locked_by'' field in the response_map table. Using these fields, we will lock the response for the current_user. Thus, when one teammate is editing, the response is locked and that members id is stored in the ''locked_by'' field. Now for other users we will check ''locked_by'' field. If it does not match their id then they will not see the ''edit'' button on the reviews page.&lt;br /&gt;
This response is then unlocked when the current_user saves the response. The methods for locking and unlocking the response are defined in the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  #E17A0 Lock response&lt;br /&gt;
  def lock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(Response.find(response_id).map_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; true, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  #E17A0 Unlock Response&lt;br /&gt;
  def unlock_response_map response_id&lt;br /&gt;
    review_response_map = ReviewResponseMap.find_by_id(response_id)&lt;br /&gt;
    unless review_response_map.nil?&lt;br /&gt;
      ReviewResponseMap.update(review_response_map.id, :is_locked =&amp;gt; false, :locked_by =&amp;gt; current_user.id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, no other reviewer can be editing the same review. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114128</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114128"/>
		<updated>2017-12-02T00:49:45Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field &amp;quot;reviewer_is_team?&amp;quot; should be added to the Assignments table to record whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. A new field &amp;quot;team_id&amp;quot; should be added to the ResponseMaps table which records the team_id when the reviewer_is_team? check-box is checked otherwise the default value is zero. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions. The code snippet below shows our new strategy to find the responses for a particular reviewer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. When the first member of the team asks for a review, a ResponseMap is created with the team_id field populated by the team_id of this participant for that particular assignment, and the ''reviewer_id'' as this members ''participant_id''. When other member of the team login and go to 'other's work', they should be seeing the same ResponseMap because of the strategy explained above.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the assignment is not reviewed by teams, then that ResponseMap is fetched from the database where reviewer_id = particpant_id.&lt;br /&gt;
&lt;br /&gt;
4. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, no other reviewer can be editing the same review. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114127</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114127"/>
		<updated>2017-12-02T00:44:56Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field &amp;quot;reviewer_is_team?&amp;quot; should be added to the Assignments table to record whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. A new field &amp;quot;team_id&amp;quot; should be added to the ResponseMaps table which records the team_id when the reviewer_is_team? check-box is checked otherwise the default value is zero. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. For this feature to work we must create correct mappings. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. Thus, if our mappings are created correctly, then the entire team will be directed to a single response_map and thus a single response irrespective of who requests the review. Thus, any of the team members will be able to request reviews as as the mappings will created with the team_id. The reason for us to not set the &amp;quot;reviewer_id&amp;quot; null or 0 for team reviewers is that, some of the functionalities like number of reviews, scores are all mapped to a single participant. Thus, if that is set that to any value, we will have to define all new methods for team reviewers. But, now we can use all those functions on our response and then make that same response object available to all members of the team. By doing this, we are neither creating redundant maps and nor are we defining new methods for the same functions.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt; Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. When the first member of the team asks for a review, a ResponseMap is created with the team_id field populated by the team_id of this participant for that particular assignment. When other's member of the team login and go to 'other's work', they should be seeing the same ResponseMap as we will be checking the team_id field of the ResponseMap table instead of the reviewer_id. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the assignment is not reviewed by teams, then that ResponseMap is fetched from the database where reviewer_id = particpant_id.&lt;br /&gt;
&lt;br /&gt;
4. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, no other reviewer can be editing the same review. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114126</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114126"/>
		<updated>2017-12-02T00:21:29Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field &amp;quot;reviewer_is_team?&amp;quot; should be added to the Assignments table to record whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. A new field &amp;quot;team_id&amp;quot; should be added to the ResponseMaps table which records the team_id when the reviewer_is_team? check-box is checked otherwise the default value is zero. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. In our design we are creating only one ResponseMap per team, i.e if the &amp;quot;reviewer_is_team&amp;quot; is set by the instructor, the ResponseMap created will have the reviewer_id as the participant_id of the requesting student and the team_id as the id of requesting students team in that assignment. Now to map this single response to all students in a team, we changed the strategy which returns response_mappings, in the &amp;quot;student_review_controller&amp;quot;, for a particular reviewer. If the assignment has team_reviewers, then we find the responses by &amp;quot;team_id&amp;quot;, and if there are no team reviewers for the assignment then we return responses by matching the &amp;quot;reviewer_id&amp;quot;. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. When the first member of the team asks for a review, a ResponseMap is created with the team_id field populated by the team_id of this participant for that particular assignment. When other's member of the team login and go to 'other's work', they should be seeing the same ResponseMap as we will be checking the team_id field of the ResponseMap table instead of the reviewer_id. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    # E17A0 If an assignment is to be reviewed by a team, select it by team_id otherwise by reviewer_id&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the assignment is not reviewed by teams, then that ResponseMap is fetched from the database where reviewer_id = particpant_id.&lt;br /&gt;
&lt;br /&gt;
4. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, no other reviewer can be editing the same review. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114124</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114124"/>
		<updated>2017-12-02T00:01:49Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field &amp;quot;reviewer_is_team?&amp;quot; should be added to the Assignments table to record whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. A new field &amp;quot;team_id&amp;quot; should be added to the ResponseMaps table which records the team_id when the reviewer_is_team? check-box is checked otherwise the default value is zero. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created. The default value for the checkbox is &amp;quot;false&amp;quot;. Thus, it will not break any existing functionality.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;!--#E17A0 Allow reviews to be set to be reviewed by a team --&amp;gt;&lt;br /&gt;
  &amp;lt;tr id=&amp;quot;reviewer_is_team&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][reviewer_is_team]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][reviewer_is_team]', 'true', @assignment_form.assignment.reviewer_is_team) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][reviewer_is_team]', 'Reviews are to be performed by teams.') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. When the first member of the team asks for a review, a ResponseMap is created with the team_id field populated by the team_id of this participant for that particular assignment. When other's member of the team login and go to 'other's work', they should be seeing the same ResponseMap as we will be checking the team_id field of the ResponseMap table instead of the reviewer_id. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end &lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the assignment is not reviewed by teams, then that ResponseMap is fetched from the database where reviewer_id = particpant_id.&lt;br /&gt;
&lt;br /&gt;
4. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, no other reviewer can be editing the same review. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114122</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114122"/>
		<updated>2017-12-01T23:56:32Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Changes to be Implemented */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field &amp;quot;reviewer_is_team?&amp;quot; should be added to the Assignments table to record whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. A new field &amp;quot;team_id&amp;quot; should be added to the ResponseMaps table which records the team_id when the reviewer_is_team? check-box is checked otherwise the default value is zero. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. The responses as well as the response_maps in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. When the first member of the team asks for a review, a ResponseMap is created with the team_id field populated by the team_id of this participant for that particular assignment. When other's member of the team login and go to 'other's work', they should be seeing the same ResponseMap as we will be checking the team_id field of the ResponseMap table instead of the reviewer_id. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end &lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the assignment is not reviewed by teams, then that ResponseMap is fetched from the database where reviewer_id = particpant_id.&lt;br /&gt;
&lt;br /&gt;
4. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, no other reviewer can be editing the same review. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114116</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=114116"/>
		<updated>2017-12-01T23:46:48Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Changes to be Implemented */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers review are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Any member of a team should be able to select a review to be done by their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Team members should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field reviewer_is_team? should be added to the Assignments table to record whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. A new field &amp;quot;team_id&amp;quot; should be added to the ResponseMaps table which records the team_id when the reviewer_is_team? check-box is checked otherwise the default value is zero. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. The reviews in the database should be deleted when the instructor decides to the change the 'Review Strategy' after the reviews have already started. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In summary, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In Expertiza, all reviewees are AssignmentTeams, even in a non-team assignment where each team consists of a single participant. However, with this project, ''reviewers'' can be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. When the first member of the team asks for a review, a ResponseMap is created with the team_id field populated by the team_id of this participant for that particular assignment. When other's member of the team login and go to 'other's work', they should be seeing the same ResponseMap as we will be checking the team_id field of the ResponseMap table instead of the reviewer_id. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    if @reviewer_team_info[:reviewer_is_team_member]&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(team_id: @reviewer_team_info[:team_id])&lt;br /&gt;
      @team = Team.find(@reviewer_team_info[:team_id])&lt;br /&gt;
    else&lt;br /&gt;
      @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    end &lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the assignment is not reviewed by teams, then that ResponseMap is fetched from the database where reviewer_id = particpant_id.&lt;br /&gt;
&lt;br /&gt;
4. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, no other reviewer can be editing the same review. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. DRY Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Select a new submission for your team to review.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112916</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112916"/>
		<updated>2017-11-12T23:59:57Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously. We can use ActiveRecord record locking method to lock the current record being edited.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field reviewer_is_team? should be added to the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In the new implementation of expertiza, the &amp;quot;reviewees&amp;quot; can no longer be participants. All reviewees will be teams, although the team can have a single participant. Although, &amp;quot;reviewers&amp;quot; can still be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, there won't be any other reviewers. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
4.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112915</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112915"/>
		<updated>2017-11-12T23:58:43Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Use Case */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously. We can use ActiveRecord record locking method to lock the current record being edited.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field reviewer_is_team? should be added to the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In the new implementation of expertiza, the &amp;quot;reviewees&amp;quot; can no longer be participants. All reviewees will be teams, although the team can have a single participant. Still, &amp;quot;reviewers&amp;quot; can still be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, there won't be any other reviewers. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
4.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;. This assignment also has only teams. No students can participate as an individual. Thus, when a participant is added to the assignment, s/he will be added as a single member team. Thus, in the diagram above, the participant is a single member team. &lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
The Assignments functions; including creation, updating, saving and modifying methods have already been tested, and our test plan will only deal with testing for the new team-based reviewing functionality we are adding. Our test plan will include the following test methods:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112907</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112907"/>
		<updated>2017-11-12T23:37:43Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously. We can use ActiveRecord record locking method to lock the current record being edited.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. A new field reviewer_is_team? should be added to the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In the new implementation of expertiza, the &amp;quot;reviewees&amp;quot; can no longer be participants. All reviewees will be teams, although the team can have a single participant. Still, &amp;quot;reviewers&amp;quot; can still be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, there won't be any other reviewers. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
4.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
For the complete testing of the new functionality of reviewing as a team we have to verify:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112904</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112904"/>
		<updated>2017-11-12T23:35:49Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously. We can use ActiveRecord record locking method to lock the current record being edited.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team? should be added to the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created.&amp;lt;br&amp;gt;&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In the new implementation of expertiza, the &amp;quot;reviewees&amp;quot; can no longer be participants. All reviewees will be teams, although the team can have a single participant. Still, &amp;quot;reviewers&amp;quot; can still be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
3. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, there won't be any other reviewers. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
4.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
For the complete testing of the new functionality of reviewing as a team we have to verify:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. If the review for the Assignment will have team id instead of the participant id in Response Map.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. If for an assignment the instructor can successfully apply the reviewer_is_team? attribute.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. If while a review is being edited by a team member, the other team members should not be given access to edit the same review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. If the team based reviewing functionality works in flow with the student based reviewing.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112896</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112896"/>
		<updated>2017-11-12T23:30:06Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously. We can use ActiveRecord record locking method to lock the current record being edited.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team? should be added to the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created.&amp;lt;br&amp;gt;&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In the new implementation of expertiza, the &amp;quot;reviewees&amp;quot; can no longer be participants. All reviewees will be teams, although the team can have a single participant. Still, &amp;quot;reviewers&amp;quot; can still be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
3. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, there won't be any other reviewers. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
4.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UC_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112895</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112895"/>
		<updated>2017-11-12T23:29:27Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously. We can use ActiveRecord record locking method to lock the current record being edited.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team? should be added to the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created.&amp;lt;br&amp;gt;&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In the new implementation of expertiza, the &amp;quot;reviewees&amp;quot; can no longer be participants. All reviewees will be teams, although the team can have a single participant. Still, &amp;quot;reviewers&amp;quot; can still be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
3. If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, there won't be any other reviewers. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
4.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UML_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112894</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112894"/>
		<updated>2017-11-12T23:28:47Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously. We can use ActiveRecord record locking method to lock the current record being edited.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team? should be added to the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
1. The first change is a simple view change. The checkbox will added in &amp;quot;assignments/edit/_review_strategy.html.erb&amp;quot;. The checkbox value will be passed to the response_controller and depending on the value of the checkbox, the response_map will be created.&amp;lt;br&amp;gt;&lt;br /&gt;
2. This change will be made in the &amp;quot;response_map.rb&amp;quot; model. This model creates all the mapping between the reviewers and reviewees. In the new implementation of expertiza, the &amp;quot;reviewees&amp;quot; can no longer be participants. All reviewees will be teams, although the team can have a single participant. Still, &amp;quot;reviewers&amp;quot; can still be either participants or teams. Thus, we still need to create a proper mapping between reviewers and reviewees for our new feature.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
3.If a review is being is being edited, that review should not be edited by other team members. In case of individual reviewers, there won't be any other reviewers. Thus, once a review is being edited, we can lock the record, irrespective of reviewers are teams or individual participants.  We will use ActiveRecord::Base#lock! method to lock one record by id. &lt;br /&gt;
In the &amp;quot;/app/view/student_review/_responses.html.erb&amp;quot; view, when the student clicks on &amp;quot;edit&amp;quot; button, the reviewer_id will be passed to the edit method in response_controller. Thus, in the &amp;quot;edit&amp;quot; method in response_controller, we find the response record being edited and then we can lock it using the following lines of code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.lock!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the record is locked, it can only be changed by the person who is currently working on it. Once the person &amp;quot;saves&amp;quot; the review, the record will be unlocked. This unlocking will be done in the &amp;quot;saving&amp;quot; method of the response_controller. We can unlock a &amp;quot;.lock!&amp;quot; record by using the &amp;quot;.save!&amp;quot; method. Once unlocked the other team members will be able to edit this record. Pseudocode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@response = Response.find(params[:id])&lt;br /&gt;
@response.save!&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
4.  We will be adding the reviewer_is_team? to the Assignments model (assignment.rb) instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unnecessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignment model.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. assignment.rb&lt;br /&gt;
&lt;br /&gt;
3. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
5. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UML_new.png|none]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112850</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112850"/>
		<updated>2017-11-12T22:45:16Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously. We can use ActiveRecord record locking method to lock the current record being edited. This will work the same way in individual and team reviews. One can also use ActiveRecord::Base#lock! method to lock one record by id. This may be better if you don't need to lock every row. Example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Account.transaction do&lt;br /&gt;
  # select * from accounts where ...&lt;br /&gt;
  accounts = Account.where(...)&lt;br /&gt;
  account1 = accounts.detect { |account| ... }&lt;br /&gt;
  account2 = accounts.detect { |account| ... }&lt;br /&gt;
  # select * from accounts where id=? for update&lt;br /&gt;
  account1.lock!&lt;br /&gt;
  account2.lock!&lt;br /&gt;
  account1.balance -= 100&lt;br /&gt;
  account1.save!&lt;br /&gt;
  account2.balance += 100&lt;br /&gt;
  account2.save!&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team?  should be added to the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam. We will be adding the reviewer_is_team? to the Assignments table instead of the Response Map as suggested in the project requirements. This is because if the checking is done on the Response Map, then it will have to be updated for every response and round. Thus a column will have to added to multiple places unncessarily which is not a good design decision. Hence our solution incorporates the addition of reviewer_is_team? to the Assignments table.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view, and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:UML_new.png|none|frame|'''UML Diagram''']]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up an assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and the number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112838</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112838"/>
		<updated>2017-11-12T22:09:11Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team?  should be added in the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide of a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Use_Case_(1).jpg|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Current Implementation is as follows:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''New Implementation will be as shown below:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has individual reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''If the assignment has team reviews:'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112837</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112837"/>
		<updated>2017-11-12T21:57:31Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team?  should be added in the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide of a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Use_Case_(1).jpg|none|frame|Use Case]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Current_implementation1.png|none|frame|Current Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame|New Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame|Individual Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame|Team Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Current_implementation1.png&amp;diff=112836</id>
		<title>File:Current implementation1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Current_implementation1.png&amp;diff=112836"/>
		<updated>2017-11-12T21:56:58Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112835</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112835"/>
		<updated>2017-11-12T21:54:00Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team?  should be added in the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide of a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Use_Case_(1).jpg|none|frame|Use Case]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Review_stratergy1.png|none|frame|Current Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_syn_chkbox.png|none|frame|New Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame|Individual Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Improved_review_req.png|none|frame|Team Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Improved_syn_chkbox.png&amp;diff=112834</id>
		<title>File:Improved syn chkbox.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Improved_syn_chkbox.png&amp;diff=112834"/>
		<updated>2017-11-12T21:52:36Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Improved_review_req.png&amp;diff=112833</id>
		<title>File:Improved review req.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Improved_review_req.png&amp;diff=112833"/>
		<updated>2017-11-12T21:52:08Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112829</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=112829"/>
		<updated>2017-11-11T07:58:18Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review. On the flip-side, it may be difficult sometimes for all team members to meet to perform reviews, and this may either delay reviews or curtail them. Ultimately, it is felt that the advantages of team-based reviews far outweigh any inherent shortcomings.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team?  should be added in the Assignments table to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Polymorphism - We will use polymorphism to provide of a single interface to entities of different types. In Expertiza, individual and team-based reviewers will share one single interface.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Use_Case_(1).jpg|none|frame|Use Case]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Review_stratergy1.png|none|frame|Current Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:New_Review_strat_noselect1.png|none|frame|New Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame|Individual Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_team_review1.png|none|frame|Team Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
[mailto:ashah22@ncsu.edu Aditya Shah]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:adeshmu@ncsu.edu Amey Deshmukh]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:dkalro@ncsu.edu Deepak Kalro]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:pmusyok@ncsu.edu Philip Musyoki]&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=111944</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=111944"/>
		<updated>2017-11-06T03:11:33Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team?  should be added in the Response Map to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Polymorphism -&lt;br /&gt;
4. Inheritance -&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Use_Case_(1).jpg|none|frame|Use Case]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Review_stratergy1.png|none|frame|Current Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:New_Review_strat_noselect1.png|none|frame|New Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame|Individual Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_team_review1.png|none|frame|Team Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=111943</id>
		<title>CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A0_Team-based_reviewing&amp;diff=111943"/>
		<updated>2017-11-06T03:06:29Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==='''Introduction'''===&lt;br /&gt;
==Motivation==&lt;br /&gt;
Traditionally, only single individuals have been able to perform assignment reviews in Expertiza. Over the years, it has been observed that it would be more desirable if assignment setters could define how a specific assignment could be reviewed. One of the ways will be by an individual, and a new way of reviews will be by teams. The same teams formed for the assignment would be able to participate in reviewing peer assignments.&lt;br /&gt;
&lt;br /&gt;
The benefits of peers reviews are numerous, and there is an additional benefit of reviews by teams. In general, we may be getting to a point where traditional individual reviews are becoming ineffective, often missing nuances in an assignments details and concepts. It is a general belief that team-based reviews will address this, often pooling together resources from multiple reviewers working as a team to form a one cohesive and often comprehensive review.&lt;br /&gt;
&lt;br /&gt;
==Changes to be Implemented==&lt;br /&gt;
1. A new button to select Reviewers as a team will be provided at the Assignments Edit page in the Review Strategy tab for the instructors.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student participants of the assignment should be able to ask for a review for their team.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Participants of the team should not be allowed to edit a review simultaneously.&amp;lt;br&amp;gt;&lt;br /&gt;
4. A new field reviewer_is_team?  should be added in the Response Map to determine whether the reviewer is an AssignmentParticipant or an AssignmentTeam.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Finally, functionality should be provided to allow Team reviews by connecting everything as mentioned above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Involved==&lt;br /&gt;
1. response_map.rb&lt;br /&gt;
&lt;br /&gt;
2. response_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
4. assignments/edit/_review_strategy.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Principles to be Followed==&lt;br /&gt;
1. MVC - The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&amp;lt;br&amp;gt;&lt;br /&gt;
2. Dry Principle - We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Polymorphism -&lt;br /&gt;
4. Inheritance -&lt;br /&gt;
&lt;br /&gt;
==Use Case==&lt;br /&gt;
1. Name: Teams submitting reviews for assignment or topic&lt;br /&gt;
&lt;br /&gt;
2. Actor: Student (as member of a team)&lt;br /&gt;
&lt;br /&gt;
3. Other Participants: Team Members&lt;br /&gt;
&lt;br /&gt;
4. Precondition: Instructor has set up assignment with review strategy as &amp;quot;Team Reviews&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
5. Primary Sequence:&lt;br /&gt;
&amp;lt;li&amp;gt; Log in to Expertiza.&lt;br /&gt;
&amp;lt;li&amp;gt; Select an assignment.&lt;br /&gt;
&amp;lt;li&amp;gt; Select &amp;quot;other's work&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt; The student can request a review for the team from here.&lt;br /&gt;
&amp;lt;li&amp;gt; Depending on the number of reviews allowed and number of reviews already performed by the team, they will be allotted a new review&lt;br /&gt;
&amp;lt;li&amp;gt; Begin the review.&lt;br /&gt;
&amp;lt;li&amp;gt; Only one member of the team can edit the review at an given time.&lt;br /&gt;
&amp;lt;li&amp;gt; All restrictions that apply to individual reviewers, also apply to teams (e.g. like a individual reviewer, a team also cannot have more than 2 outstanding incomplete reviews).&lt;br /&gt;
&amp;lt;li&amp;gt; Complete the review and Click Submit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Changes==&lt;br /&gt;
1. Currently there is no team reviewing in Expertiza. Thus, we will provide a check-box, in the review strategy tab of edit assignments, for the instructor. Checking this box will set the reviewers to teams, rather than individual participants.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Review_stratergy1.png|none|frame|Current Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:New_Review_strat_noselect1.png|none|frame|New Implementation]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. By default, the reviewers will be individual students. When they request reviews, they request reviews for themselves. If the instructor changes the reviewers to teams, then each participant (who is member of some team), will request reviews on behalf of the entire team.&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_review1.png|none|frame|Individual Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;padding: 0px 0px 0px 25px&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Student_team_review1.png|none|frame|Team Review Request]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Testing of the new controller methods to check whether all the functionality of reviewing as a participant is also working for the scenario when reviewing is done by a team.&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_Review_strat_noselect1.png&amp;diff=111942</id>
		<title>File:New Review strat noselect1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_Review_strat_noselect1.png&amp;diff=111942"/>
		<updated>2017-11-06T03:05:50Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Student_team_review1.png&amp;diff=111941</id>
		<title>File:Student team review1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Student_team_review1.png&amp;diff=111941"/>
		<updated>2017-11-06T03:03:40Z</updated>

		<summary type="html">&lt;p&gt;Ashah22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ashah22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Student_review1.png&amp;diff=111940</id>
		<title>File:Student review1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Student_review1.png&amp;diff=111940"/>
		<updated>2017-11-06T03:03:23Z</updated>

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