CSC/ECE 517 Fall 2017/E1774 Metareview fixes and improvements.rb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
 
(11 intermediate revisions by 2 users not shown)
Line 105: Line 105:
</pre>
</pre>


Updated code:
Recent code:


student_task/view.html.erb
student_task/view.html.erb
Line 124: Line 124:
=='''Test Plan'''==
=='''Test Plan'''==


==='''Automated'''====
==='''Automated'''===


===='''Issue #970 '''====
===='''Issue #970 '''====
Test Case: If review found, assign new metareview. Edge case: If no review found redirects to same page.


Code snippet:
<pre>
<pre>
  describe "GET #new_feedback" do
  describe "GET #new_feedback" do
Line 151: Line 153:


===='''Issue #298'''====
===='''Issue #298'''====
Test case: Meta reviewer should be able to see author feedback. Edge case: If no feedback from author, message "No feedback done yet." should be displayed on the screen.
Code snippet:
<pre>
RSpec.describe StudentReviewController do
  context 'logged in as metareviewer' do
    let(:review) { Response.create(map_id: 1, additional_comment: 'hello', round: 1) }
    let(:map) { FeedbackResponseMap.create(reviewed_object_id: 1, reviewer_id: 1, reviewee_id: 1) }
    let(:assignment) { AssignmentParticipant.new }
    let(:responsemap) { ResponseMap.new }
    describe "GET #authorFeedback" do
      it "returns authors feedback" do
        get :show_authors_Feedback
        expect(response).to redirect_to(request.env['HTTP_REFERER'] ? :back : :root)
      end
    end
  end
end
</pre>


===='''Issue #198'''====
===='''Issue #198'''====
Test case: show original review to be reviewed to meta-reviewer. Edge case: No edge cases for this issue as the meta-reviewer will only have access to "Begin" link if review exists (see issue #970).
Code snippet:
<pre>
it "show review to be reviewed to meta reviewer" do
    # add_meta_reviewer
    first(:link, 'add reviewer').click
    add_reviewer(@student_reviewer.name)
    click_link('add metareviewer')
    add_matareviewer(@student_reviewer2.name)
    expect(page).to have_content @student_reviewer2.name
    load_questionnaire(@student_reviewer2.name)
    expect(page).to have_content "Show review"
    click_link('Show review')
    expect(page).to have_content "Ratings"
end
</pre>


==='''Manual '''===
==='''Manual '''===

Latest revision as of 06:19, 3 November 2017

Introduction

Problem Statement

In Expertiza, the metareview feature in Expertiza enables a third party to evaluate the quality of feedback that a reviewer gives to a reviewee. Metareview is an important feature that can help students become a better reviewer for their peers by providing detailed feedback that is actionable and positively formulated. Unfortunately, this feature is broken and the following issues were identified. Your task is to fix these issues so that this feature can be used again.


Team Members

The team members who worked on this particular problem are:-

Rachit Agarwal

Cherukeshi Machan

Aishwarya Sundararajan

Issues

Issue #970

Dynamic assignment of metareviews does not work. When requesting a new metareview to perform, it shows NoMethodError undefined method ‘includes?’ in assignment.rb line 102.

Fix: This line has been fixed and now checks if response_map.reviewer == metareviewer rather than response_map.reviewer.includes?(metareviewer), which was invalid.

response_map.reviewee == metareviewer or response_map.reviewer == metareviewer

Issue #298

New Feature: Metareviewer should be able to see author feedback. Currently, the metareviewer can only see the review and doesn't have access to the author feedback.

Implementation: This feature is implemented using the "reviewed_object_id" from the "response_maps" table to fetch the authors feedback for the particular reviewed id. Below are the code changes for implementing this feature.

responses.html

<% if map.type.to_s == "MetareviewResponseMap" %>
    <td> <%= link_to "Author's Feedback", {controller: 'student_review', action: 'show_authors_feedback',:id => map.reviewed_object_id}%></td>
<% end %>

student_review_controller.rb

def show_authors_feedback
    @map = FeedbackResponseMap.find_by(reviewed_object_id: params[:id])
end

show_authors_feedback.html

<% if @map and !@map.response.empty? then %>
    <%= @map.response.last.display_as_html %>
<%else%>
    <h3>Feedback from author</h3>
    <h4> No feedback done yet.</h4>
<%end%>
<a href="javascript:window.history.back()">Back</a>

Issue #198

Meta-reviews do not show the review to be reviewed. When I am assigned the meta-review, the original review I'm supposed to critique is not shown, only the link to the wiki article and the review rubric.

Fix: Updated response.html.erb: Previously, this view was rendering a partial which was actually not present in the views. So we are not rendering that partial anymore. Now the actual review is displayed by calling an action of response.controller to show the original review which metareviewer is supposed to critique.

Old Code

 <% if @responses_versions.empty? %>
    <I>No previous review was performed.</I><br/><hr/><br/>
 <% else %>
    <%= render :partial => 'review', :locals => {:versions => @responses_versions} %>
 <% end %>

New Code

<% if @responses_versions.empty? %>
    <I>No previous review was performed.</I><br/><hr/><br/>
<% else %>
        <%= @responses_versions.each do |response| %>
            <%= response.display_as_html() %>
            <br/>
        <% end %>
        <hr/>
    <br/>
<% end %>


Issue #162

Student selected a new meta review they get their own project to metareview

This functionality is working fine as per the requirement. When a user selects a new metareview, a review is assigned to the user to be reviewed, which have the different author other than the User. This can be tested using the test scenario mentioned in the testing section.

Issue #145

Metareviews need to be fixed to work with staggered-deadline assignments

Fix: The submission is reviewable if the submission is in a stage where reviews can be done. It does not depend on the stage of the topic the reviewer is writing on. The same has been incorporated by the below changes.

Code mentioned in defect:

<% if @assignment.review_allowed(@reviewee_topic_id) or @assignment.metareview_allowed(nil) or @assignment.get_current_stage(@participant.topic_id) == "Complete" %>

Recent code:

student_task/view.html.erb

<% if check_reviewable_topics(@assignment) or @assignment.metareview_allowed(nil) or @assignment.get_current_stage(@topic_id) == "Finished" %>

student_task_helper.rb

def check_reviewable_topics(assignment)
    return true if !assignment.has_topics? and assignment.get_current_stage != "submission"
    sign_up_topics = SignUpTopic.where(assignment_id: assignment.id)
    sign_up_topics.each {|topic| return true if assignment.can_review(topic.id) }
    false
end

Test Plan

Automated

Issue #970

Test Case: If review found, assign new metareview. Edge case: If no review found redirects to same page.

Code snippet:

 describe "GET #new_feedback" do
      it "redirects to new if review object is found" do
        allow(Response).to receive(:find).and_return(review)
        allow(session[:user]).to receive(:id).and_return(1)
        allow(review).to receive_message_chain(:map, :assignment, :id).and_return(1)
        allow(review).to receive_message_chain(:map, :reviewer, :id).and_return(1)
        allow_any_instance_of(AssignmentParticipant).to receive_message_chain(:where, :first).and_return(assignment)
        allow_any_instance_of(FeedbackResponseMap).to receive_message_chain(:where, :first).and_return(map)
        allow_any_instance_of(FeedbackResponseMap).to receive(:create).and_return(map)

        get :new_feedback

        expect(response).to redirect_to action: :new, id: map.id, return: "feedback"
      end
      it "redirects to same page if no review is found" do
        allow(Response).to receive(:find).and_return(false)
        expect(response).to have_http_status(200)
      end
    end

Issue #298

Test case: Meta reviewer should be able to see author feedback. Edge case: If no feedback from author, message "No feedback done yet." should be displayed on the screen.

Code snippet:

RSpec.describe StudentReviewController do
  context 'logged in as metareviewer' do
    let(:review) { Response.create(map_id: 1, additional_comment: 'hello', round: 1) }
    let(:map) { FeedbackResponseMap.create(reviewed_object_id: 1, reviewer_id: 1, reviewee_id: 1) }
    let(:assignment) { AssignmentParticipant.new }
    let(:responsemap) { ResponseMap.new }

    describe "GET #authorFeedback" do
      it "returns authors feedback" do
        get :show_authors_Feedback
        expect(response).to redirect_to(request.env['HTTP_REFERER'] ? :back : :root)

      end
    end
  end
end

Issue #198

Test case: show original review to be reviewed to meta-reviewer. Edge case: No edge cases for this issue as the meta-reviewer will only have access to "Begin" link if review exists (see issue #970).

Code snippet:

it "show review to be reviewed to meta reviewer" do
    # add_meta_reviewer
    first(:link, 'add reviewer').click
    add_reviewer(@student_reviewer.name)
    click_link('add metareviewer')
    add_matareviewer(@student_reviewer2.name)
    expect(page).to have_content @student_reviewer2.name

    load_questionnaire(@student_reviewer2.name)

    expect(page).to have_content "Show review"
    click_link('Show review')
    expect(page).to have_content "Ratings"
 end

Manual

Issue #970

1) Login as Admin, create an assignment with all the necessary details like maximum no of users per team, add topics for the assignment, enroll users(students) in the assignment.

2) Select checkbox "add metareview deadlines", select dates and add metareview rubric for the same.

3) Go back to manage assignment and add select Assign reviewers.

4) Add meta-reviewer to a particular review submitted by students.

5) Impersonate the meta-reviewer assigned above and go to others work for the same assignment.

6) Select the option "request a new metareview" and a new review will be dynamically assigned for meta-review.

Issue #298

1) Login as Admin, create an assignment with all the necessary details like maximum no of users per team, add topics for the assignment, enroll users(students) in the assignment.

2) Select checkbox "add metareview deadlines", select dates and add metareview rubric for the same.

3) Go back to manage assignment and add select Assign reviewers.

4) Add meta-reviewer to a particular review submitted by students.

5) Impersonate the meta-reviewer assigned above and go to others work for the same assignment.

6) Select the option "request a new metareview" and a new review will be dynamically assigned for meta-review.

7) Option to view the author's feedback will be visible next to Begin button.

Issue #198

1) Login as Admin, create an assignment with all the necessary details like maximum no of users per team, add topics for the assignment, enroll users(students) in the assignment.

2) Select checkbox "add metareview deadlines", select dates and add metareview rubric for the same.

3) Go back to manage assignment and add select Assign reviewers.

4) Add meta-reviewer to a particular review submitted by students.

5) Impersonate the meta-reviewer assigned above and go to others work for the same assignment.

6) Select the option "request a new metareview" and a new review will be dynamically assigned for meta-review.

7) click begin button and show review option should be visible on the top to view the origin review to be reviewed.

Issue #162

1) Login as Admin, create an assignment with all the necessary details like maximum no of users per team, add topics for the assignment, enroll users(students) in the assignment.

2) Select checkbox "add metareview deadlines", select dates and add metareview rubric for the same.

3) Go back to manage assignment and add select Assign reviewers.

4) Add meta-reviewer to a particular review submitted by students.

5) Impersonate the meta-reviewer assigned above and go to others work for the same assignment.

6) Select the option "request a new metareview" and a new review will be dynamically assigned for meta-review.

7) Select begin button.

8) The submitted work is different from the work submitted by the metareviewer.

Issue #145

1) Login as Admin, create an assignment with all the necessary details like maximum no of users per team, add topics for the assignment, enroll users(students) in the assignment.

2) Select checkbox "add metareview deadlines", select "Staggered deadline assignment?" checkbox in general tab and update the deadlines for metareview in "due dates" tab.

3) Go back to manage assignment and add select Assign reviewers.

4) Add meta-reviewer to a particular review submitted by students.

5) Impersonate the meta-reviewer assigned above and go to others work for the same assignment.

6) "Request a new metareview" option should be visible to the user if the deadline is the future date for that particular assignment.

References

  1. Expertiza on GitHub
  2. GitHub Project Repository Fork
  3. The live Expertiza website
  4. Expertiza project documentation wiki