CSC/ECE 517 Spring 2016 E1631 Team-based reviewing: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 111: Line 111:


* '''review_mapping_controller.rb:'''  
* '''review_mapping_controller.rb:'''  


1. We have added a check in the assign_reviewer_dynamically method that checks if the assignment is a team_reviewed assignment to fetch the respective row from the participants or the teams_users table
1. We have added a check in the assign_reviewer_dynamically method that checks if the assignment is a team_reviewed assignment to fetch the respective row from the participants or the teams_users table

Revision as of 00:18, 28 April 2016

Purpose

When a participant of a team reviewed an assignment, his/her review is independent of his teammate’s reviews. To allow teammates to discuss and review together, allowing teams to submit reviews for the team as a whole should be allowed ideally. We intend to do this in our project.

  • Currently all reviews in Expertiza are done by individuals. This is true regardless of whether the assignment is done by individuals or teams .
  • There are occasions when it's advantageous to review projects as a team .
  • It helps foster discussion and thereby improves the process of learning.

Task Description

This project comprises of the following steps :

  1. Objects of ResponseMap record the information of who reviews whom. The field reviewee_id refers to the team who is being reviewed. The field reviewer_id refers to the individual/team performing the review. # We added a boolean field "reviewer_is_team" to identify if the review is being performed by a team or an individual.
  2. The review strategy is assignment specific and hence we have added a field reviewer_is_team to the assignments table as well
  3. For an Instructor to specify whether the review is a Team/Individual based review, we have provided a dropdown on the Review Strategy tab of assignment creation.
  4. If reviewer_is_team field is true the reviewer_id in the response_map is set to the corresponding team_id of the user
  5. Ensure that features such as "view my scores", or the "alternate view/heat map" continued working.

Design

Design Pattern

Model View Controller

In an MVC model, a software application is divided into three major components: Model, View and Controller.

Model - Keeps data, logic and relations between objects and the database. It also handles validations, associations and transactions.

View - Displays the data received from the controller in the user interface.

Controller - Accepts the client's input and converts it into action points for the model or view. Other responsibilities include querying models and organizing data in a structure that is displayed by the view.

Use Case Diagram

Name: Specify review type on Review Strategy tab.

Actor: Instructor.

Description: The instructor specifies whether this review is an individual review or a team based review on the Review Strategy tab.


Name: Perform Review.

Actor: Individual Student/Team.

Description: The individual/team will perform a review for the Assignment.

Database Design

ResponseMap in essence, records who reviews whom. Schema of ResponseMap:

Field Data type
id int(11)
reviewed_object_id int(11)
reviewer_id int(11)
reviewee_id int(11)
type varchar(255)
created_at datetime
updated_at datetime
caliberate_to boolean
reviewer_is_team boolean

The description of the fields of the database for ResponseMap:

1. id: The unique record identifier.

2. reviewed_object_id: The id of the object that is reviewed. Assignments or ReviewMaps could be reviewed.

3. reviewer_id: The reviewer can either be an “AssignmentTeam” or “AssignmentParticipant”, which is indicated by the field reviwer_is_team.

4. reviewee_id: The id “AssignmentTeam” who is getting the “Response” i.e., the one whose work is being reviewed.

5. type : Indicates the type of the ResponseMap.

6. created_at: The timestamp when the Response was created.

7. updated_at: The timestamp when the Response was updated.

8. calibrate_to: A field of boolean data type.

9. reviewer_is_team: If this field is ‘true’, the reviewer_id refers to the id of the “AssignmentTeam” to which the participant belongs. Else, it refers to the id of the “Participant” itself.

Implementation

Below are the key files modified:

Controllers

  • review_mapping_controller.rb:

1. We have added a check in the assign_reviewer_dynamically method that checks if the assignment is a team_reviewed assignment to fetch the respective row from the participants or the teams_users table


2. Also while redirecting to the student_review controller the participant_id or the team_id is passed based on the type of review


  • response_controller:

1. Below is the get_reviewer_from_response_map method that returns the team or participant id based on the type of review . Also this value is passed forward to the respective controller we redirect to. The get_participant method returns the row from the participants table corresponding to the current user.


Models

  • assignment.rb: Add a field review_type , that indicates if the assignment is a team based or an individual assignment decided by the instructor.


Views

  • assignments/edit/_review_report.html.erb: Add a dropdown for the instructors to select if the reviews are individual or team-based.


Handling Concurrency

There can exist a concurrency problem with the team review system. If two members from the team start with the review at the same time, the member who started the review first will lose his/her changes as the second members changes will be overwritten.

To solve this problem, we plan to use a boolean field 'lock' for locking mechanism. If any member from the team starts with the review, we will set the lock field to true. Once the response is locked, no other member is allowed to edit the response. This lock will be released after the response has been saved.

Testing Details

RSpec

RSpec is a testing framework for Rails, and is a Behavioral-Driven Development tool. It is a domain specific language(DSL). All the tests can be executed by rspec spec command, or can also be executed individually using the command "rspec spec/models/assignment_team_spec.rb".

We intend to write unit tests using RSpec for all the methods which we modified/created.

Factory Girl

Factory Girl is used for creating Assignment and Team objects to be used for testing. Factory Girl is a replacement for fixtures. Fixtures have to be updated whenever we change a data model whereas adding and removing fields is much easier in Factory Girl. Fixture definitions are global whereas Factories can be local, so isolated cases can be tested. Factories are defined to create objects for testing.

Running RSpec

 $ rspec spec/models/assignment_team_spec.rb

Test Cases

1. If the instructor selects "Review by team", check if the review is done by a team member, not by participant.

2. If one teammate is working on a review, another teammate should not be able to edit it at the same time.