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

From Expertiza_Wiki
Jump to navigation Jump to search

E1967 Fix glitches in Author Feedback

Find our PR here : https://github.com/expertiza/expertiza/pull/1536

Team members :

  • Bin Patel (bpatel24)
  • Omkar Kulkarni (oskulkar)
  • Pranav Gaikwad (pmgaikwa)

Mentor : Mohit Jain

To test our code in a real Expertiza environment, please see instructions on E1967 : See It In Action page (Expires Nov 9, 2019).

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 its 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

List of files with code relevant to this issue :


view_heatgrid() method in grades_helper.rb is responsible for providing information about reviews, metareviews, author feedbacks, etc. For the purpose of this issue, we only need VmQuestionResponse data structure defined in this file. We do not need to make changes in this file.

'Author Feedback' tab in the UI contains tables for each team member with detailed breakdown of their feedback. The method add_reviews() is called before the review table is rendered in the view. This method does different things based on which tab we are on. In this function, we only have to change the if block for 'Author Feedback' tab.

Apart from these, we need to change the heatgrid view in the UI. Current view cannot be used 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. We need Reviewee Id there.

  • Logic to show total number of feedbacks in the title row doesn't work.



Proposed Solution

Changes in model

  • Line Numbers : #61-#70

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.
  • 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

Changes in view

As discussed in the previous section, we need to change UI elements specific to Author Feedback tab.

First, we change the title of each column to show Reviewee Id instead of Reviewer Id. To achieve that, we only add a simple if condition in the view to check whether the current tab is 'Author Feedback'. We change the title to use 'reviewee_id' whenever the current tab is Author Feedback.

        <% vm.list_of_reviews.each do |review| %>
           ....
                  
           <% elsif vm.questionnaire_display_type == "Author Feedback" %>
              <% user_name = User.find(Participant.find(ResponseMap.find(Response.find(review.id).map_id).reviewee_id).user_id).fullname(session[:ip]).to_s %>

<a target="_blank" href="../response/view?id=<%= review.id.to_s %>" data-toggle="tooltip" data-placement="right" title="Click to see details"><%= user_name.to_s %></a>

           <% else %>
                 
           .....

Secondly, we change the Title of each row in the detailed score view (when the dropdown of review is opened). Currently, it shows name of the Review. Here, we need the Id of the reviewee.

        <% if vm.questionnaire_display_type == "Author Feedback" %>

<%= vm.list_of_reviewers[index].user_id %>

        <% else %>

Review <%=index + 1%>

        <% end %>

At last, we need to change the count of Feedbacks displayed at the top of each row as shown in the figure.


        <a href="#" id="<%=prefix%>_<%=index.to_s%>_feedbackLink" name="<%=prefix%>_feedbackLink" onClick="toggleElement('<%=prefix%>_<%=index.to_s%>_feedback','author feedbacks');return false;"> 
        <%=participant.fullname(session[:ip]) %></a> (<%=  FeedbackResponseMap.where(reviewer_id: participant.id).count rescue 0 %>)

Side Effects

The code we changed is very specific and only applies to cases where 'Author Feedback' is to be shown. Therefore, we do not expect other parts of the application to get affected by our code.

Continue reading for more information on tests.

Test Plan

File : vm_question_response_spec.rb

  • There is a fundamental change in how Author Feedback is tested. In existing implementation, we test for the feedback received by a participant. However, in the new implementation, we are interested in testing feedback left by current participant to other team members. Therefore, variable @list_of_reviews should contain the list of reviews (feedbacks) left by current participant.
   To achieve that, we first create a new mock Author Feedback on behalf of the test user / participant. Then, we check whether the mocked feedback is returned in the variable @list_of_reviews
  • To view the deployed Expertiza associated with this assignment, use the following credentials : Instructor Login: username -> instructor6, password -> password

Manual Testing Via UI

1. Login to expertiza using the above credentials.

2. Impersonate as student7189 and for assignment Madeup Problem, click on Alternate View, then click on show reviews and save any review.

3. Follow the step2 for student7452.

4. Then as an instructor, click on Assignments under Manage Notifications Tab.

5. Click on View Scores under Madeup Problem Assignment.

6. expand Madeup problem_Team22.

7. click on tab "Author Feedback" and you will see all reviews made by that authors(all participant of Team22).

To test our code in a real Expertiza environment, please see instructions on E1967 : See It In Action page (Expires Nov 9, 2019).