CSC/ECE 517 Spring 2022 - E2242. Fix teammate-review view: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 28: Line 28:
For the view_team page of Expertiza the actors are instructor and student. Use cases are to access view_team page and to view teammate reviews of all students in a team for the instructor. Whereas, the use case for student is to access view_team page and to view teammate reviews for themselves subject to the condition that the instructor allows it.   
For the view_team page of Expertiza the actors are instructor and student. Use cases are to access view_team page and to view teammate reviews of all students in a team for the instructor. Whereas, the use case for student is to access view_team page and to view teammate reviews for themselves subject to the condition that the instructor allows it.   


[[File:Use_case_diagram_teammate_review_view.png|700px]]
[[File:Use_case_diagram_teammate_review_view.png|570px]]


==Explanation of Feature==
==Explanation of Feature==

Revision as of 22:52, 25 April 2022


Problem Statement

After the deadline to submit a project is crossed and the work is reviewed, both students and instructors can view teammate reviews. Students view them from the heatgrid at the bottom of the “Your scores” page. Instructors view them from “View scores”, then clicking on a particular team, then clicking on the Teammate Reviews tab.

  • In both cases, a single heatgrid is shown. It is not clear if the heatgrid shows the reviews that the student has given to his/her teammates or the reviews that the student has received from his/her teammates?
  • Also, there's no checkbox/option for the instructor to allow/disallow students to check the reviews received from their teammates, for their contribution to the project.
  • Ensure to show a composite score derived from all reviews. Ensure the code work on heatmaps in general, so other kinds of heatgrid views could use it.
  • Ensure not to display original names in anonymized view in the heatgrid.

Test Login Credentials

Instructor:

  • UserId: instructor6
  • Password: password

Student:

  • UserId: student7185
  • Password: password

Control Flow to access the concerned screens

For instructor (Log in as an instructor)

For Student (Log in as an student)

Enact as a student from instructor login/ login using student credentials

Use Case Diagram

For the view_team page of Expertiza the actors are instructor and student. Use cases are to access view_team page and to view teammate reviews of all students in a team for the instructor. Whereas, the use case for student is to access view_team page and to view teammate reviews for themselves subject to the condition that the instructor allows it.

Explanation of Feature

Existing functionality of teammate-review view

  • Instructor's view of teammate review:
    1. As we can see below, under the Teammate Reviews tab, the heatgrid for student 7185 doesn't clearly state if it is a review given by the student 7185 or is it the review score received by the student 7185.


  • Student's view of teammate review:
    1. As we can see below, the student's view of your scores doesn't show the teammate reviews. We need to implement the feature by invoking the pre-existing code for displaying a heatgrid, so that a student will be able to view the teammate reviews.



Proposed and Finished changes to Teammate Review View

1. In the instructor's view, distinguished reviews for students by rendering separate heat grids for each student. Both reviews by the student and reviews of the student’s contribution are now shown separately.

Old vs New UI:

 ::


2. In addition to the individual reviews, the composite score from all reviews is calculated and displayed below the heatgrid.

3. A checkbox( Show teammate reviews?) on the edit assignment/create assignment page was present but the functionality behind that was not implemented. Added functionality to the checkbox, so that the instructor can enable/disable heat grid visibility to students.

If the Show teammate reviews? checkbox is enabled by the instructor for a particular assignment, students can view the peer reviews on the your scores page.

4. If the display is in an anonymized view, where no names are to be shown, the student ID is not displayed

 ::

Data Flow changes used to display Teammate Reviews in student's 'your scores' page

In the old implementation the VmQuestionResponse object was not being populated with "TeammateReviewQuestionnaire". In the new implementation we are populating it with all the teammate responses too, by accessing the team of the particpant using participant ID.

Code changes

The following files will be changed to fulfill the requirements

Controllers:

  • app/controllers/grades_controller.rb
  • app/helpers/grades_helper.rb
  • app/controllers/assignments_controller.rb

Models:

  • app/models/vm_question_response_score_cell.rb
  • app/models/vm_question_response.rb
  • app/models/assignment_form.rb
  • app/models/assignment.rb

Views:

  • app/views/grades/_view_heatgrid.html.erb
  • app/views/grades/view_team.html.erb
  • app/views/assignments/new.html.erb

Rspec:

  • spec/controllers/grades_controller_spec.rb
  • spec/helpers/grades_helper_spec.rb
  • spec/models/assignment_spec.rb
  • spec/models/assignment_form_spec.rb
  • spec/features/assignment_creation_page_spec.rb

Refactor Code to follow good coding practices
Example:

  1. Rename method names more meaningfully and intuitive.
  2. Add comments to the existing functions.


1. Modified code to display teammate reviews to the student when the instructor enables the show_teammate_reviews checkbox. We followed good design principles, and invoked the pre-existing code for displaying a heatgrid.(DRY principle)


app/views/grades/_view_heatgrid.html.erb

Old code:

   <% if (vm.questionnaire_display_type == "Metareview" or vm.questionnaire_display_type == "Author Feedback" or 
   vm.questionnaire_display_type == "Teammate Review") and @current_role_name.eql?'Student' %>

new code:

Removed the teammate review check from heatgrid and added the check in view_team.html.erb

   <% if (vm.questionnaire_display_type == "Metareview" or vm.questionnaire_display_type == "Author Feedback") and 
   @current_role_name.eql?'Student' %>

app/views/grades/view_team.html.erb

   <% if @current_role_name.eql?'Student' and @assignment.show_teammate_reviews==true %>
     <%=view_heatgrid(@participant.id, "TeammateReviewQuestionnaire") %>

<% end %> app/controllers/grades_controller.rb Old code: @vmlist << populate_view_model(questionnaire) New code: if questionnaire.type == "TeammateReviewQuestionnaire" # as teammate review will be different for each participant # we need to create a separate table for each teammate @participant.team.participants.each do |team_participant| @vmlist << populate_view_model(team_participant, questionnaire, @team) end else # only one participant needs iterating, as apart from teammatereview # all other reviews are at "team" level @vmlist << populate_view_model(@participant, questionnaire, @team) end 2. After the teammate review check box is enabled, the students would be able to view the scores. Modified code to let students see detailed review responses their teammates have given for them by clicking the review link near the grades table app/helpers/authorization_helper.rb Old code: (assignment.course && current_user_is_a?('Teaching Assistant') && current_user_has_ta_mapping_for_assignment?(assignment)) New code: (assignment.course && current_user_is_a?('Teaching Assistant') && current_user_has_ta_mapping_for_assignment?(assignment)) || (current_user_is_a?('Student') && assignment.show_teammate_reviews==true) 3. Made changes to make it easier to understand if the displayed heatgrid is for the reviews that the student has written of his/her teammates or has received from his/her teammates app/views/grades/_view_heatgrid.html.erb Old Code: <%= vm.questionnaire_display_type %> New Code: to be added 4. Earlier student names were visible in the teammate reviews tab, even in the anonymized view. Added code to replace the student id with a random string if the instructor is in anonymized view app/models/user.rb Old code: def fullname(ip_address = nil) User.anonymized_view?(ip_address) ? role.name + ', ' + id.to_s : self[:fullname] New Code: def fullname(ip_address = nil) if User.anonymized_view?(ip_address) return "Anonymized_User_#{self[:id]}" else return self[:fullname] end app/views/grades/_view_heatgrid.html.erb: Old code: <%= vm.display_team_members %> New Code: <%= vm.display_team_members(session[:ip]) %>

Design Patterns

The task is to fix the teammate_review view and requires changes to be made to an existing view associated with the user interface(UI) of Expertiza. We followed the DRY principle and invoked the pre-existing code for displaying a heatgrid when making the changes, there is no design pattern itself present in the teammate_review view. Other kinds of heatgrid views can also use it.

User Stories

  1. As a student, I can view the reviews given to me by my teammates.
  2. As an instructor, I can view the reviews a student has given to their teammates.
  3. As an instructor, I can choose to view only one student's teammate reviews or to view all students' teammate reviews together.
  4. As an instructor, I can view the name of the reviewers for a student's reviews.
  5. As a student and a TA for another subject, I cannot view an instructor's view to the view_team page.

Testing

Video Demonstration

will be added for the final submission

Testing Goals and Test Objects

Drawing from the project objectives:

  1. Verify that reviews by the student and reviews of the student’s contribution are shown.
  2. Verify that instructor can uncheck the “Show teammate reviews?” checkbox to disallow students to see teammate reviews.
  3. Verify that instructor can check the “Show teammate reviews?” checkbox to allow students to see teammate reviews.
  4. Verify the composite score derived from all individual reviews in a heat grid.
  5. Ensure that no names of students or instructors are shown in the anonymized view.
  6. Increase the test coverage for grades controller by adding Rspec unit tests.

RSpec Unit Tests

Test cases provided here, will add RSpec code blocks for the final submission

  • Student Account or Instructor acting as a student
Scenario: Choose to view "Your scores"
 Given: the user is logged in as a student or instructor acting as a student
 And: “Show teammate reviews?” is allowed by instructor
  When: user clicks on "your scores" link in student task page
   Then: display heatgrids for student's contribution provided by student's team and heatgrid of peer reviews. 
  • Instructor Account
Scenario: Choose to view "View scores"
 Given: the user is logged in as an instructor
  When: instructor clicks on "view scores" link
   Then: can view the reviews a student has given to their teammates without ambiguity
Scenario: Choose to view "View scores"
 Given: the user is logged in as an instructor
  When: instructor clicks on "view scores" link
   Then: can choose to view only one student's teammate reviews or to view all students' teammate reviews together.


Grades Controller Rspec to increase test coverage:
Currently the test coverage for grades controller here is 88.24% on beta branch. We will add testcases to increase the coverage further and also to test the additional functionality that we are going to add.

Github and Related Link

The forked git repository for this project can be found here.
The pull request can be found here.

Contributors

Mentor

  • Naman Shrimali (nshrima)

Students

  • Rachana Kondabala(rkondab)
  • Rahul Shukla (rshukla3)
  • Shubham Bansal (sbansal6)
  • Sravanth Reddy Bommana (sbomman)