CSC/ECE 517 Fall 2019 - E1967. Fix glitches in author feedback

From Expertiza_Wiki
Revision as of 16:21, 28 October 2019 by Pmgaikwa (talk | contribs)
Jump to navigation Jump to search

E1967 Fix glitches in Author Feedback

Problem Statement

In Summary report for assignment (grades/view_team?id=xxxx) for instructors, the author feedback section list a different set of users than the reviewers. It should list the team's feedback to all it's reviewers to this particular assignment.

Introduction

Currently, the Author Feedback section for a team shows the feedback the team received from other Authors they reviewed earlier.

The Author Feedback section, however, should display the feedback the team gave to their reviewers.

To explain these ideas in more detail, let's consider the following scenario :

Team 22 has two members in the team : Team Member 1, and Team Member 2. This team reviewed assignments of Team 29 and Team 30. Currently, the author feedback section displays feedback given by Team 29 and Team 30 to Team 22. See following figure.

Current Output


Now, consider that the Team 22's assignment was reviewed by members from Team 23 and Team 24. Then, the Author Feedback section should display the feedback Team 22 gave to the members of Team 23 and Team 24.

Expected Output


Problem Identification

Controller responsible for this page : grades_controller.rb

View responsible for this page : _view_heatgrid.html.erb

Related models : vm_question_response.rb

Related helpers : grades_helper.rb

The helper grades_helper.rb has a method view_heatgrid(). This method is called whenever the application requires to show a table with reviews and scores in it. This table is also used in other tabs on the same page. We have to make sure that the code we add here doesn't break other parts of the application.

The method add_reviews() is called before the review table is rendered in the view. This method does different things based on what is being requested. In this function, we only have to change the if block for 'Author Feedback' tab.

Additionally, the heatgrid view is only capable of showing reviews, metareviews, etc. We cannot use the same logic for Author Feedback for following reasons :

  • The heatgrid is configured to use Reviewer id as column title. In case of Author Feedback, we want Reviewee id as column title instead.

  • The row title in detailed scores is not appropriate for Author Feedback




Problem Solution

Changes in model code

File : vm_question_response.rb

We only need to change the if block responsible for Author Feedback tab.

Logic :

  • Get the list of all FeedbackResponseMaps where current Participant is a reviewer. The participant id is already passed to the add_reviews() method. We have to
  • For each FeedbackResponseMap obtained above, find out all the most recent Response objects. We only need most recent responses since Participants may have edited their responses. The old responses are not deleted from Responses table.
  • Pass the list of Responses to the heatgrid view.

def add_reviews(participant, team, vary)

   ...
   
   elsif @questionnaire_type == "AuthorFeedbackQuestionnaire"
     reviews = []
     feedbacks = FeedbackResponseMap.where(reviewer_id: participant.id)
     feedbacks.each do |fback|
       participant = Participant.find_by(id: fback.reviewee_id)
       response = Response.where(map_id: fback.id).order('updated_at').last
       if response
         reviews << response
         @list_of_reviews << response
       end 
       @list_of_reviewers << participant
     end
  
   ...

end

Tests