CSC/ECE 517 Fall 2018 E1870 Warn of deadlines and enforce them

From Expertiza_Wiki
Jump to navigation Jump to search

Introduction

Expertiza supports multi-round peer reviews. Currently, in this situation, student who did not do the previous round peer reviews can still do the subsequent round peer reviews, but will lose about 50 points according to the deduction policy. Therefore, it will be fairer to provide instructor an option to decide whether a student can do the subsequent round peer reviews when s/he did not do the previous round peer reviews.

Design Plan

UI Improvement

In assignment#edit page “Review strategy” tab, add a checkbox (e.g., “Allow student to join reviews late”*) to allow instructor to decide whether students can do the second round peer reviews without the first round peer reviews; by default this box is unchecked and it only appears when there are multi-round peer reviews.

  • Before

  • After

Functionality Implementation

Explanation

Currently, when students didn't request enough reviews(e.g. Each student is required to do at least 2 reviews, but s/he only request one in the first round), they can still request more reviews in the second round, but will lose points due to lack of first round reviews. Now, we want to add a functionality to split the case. Below is the flow chart that explains the improvement. * Note that whether submit or not doesn't matter, as long as request, it counts.

Code Level Design

1. First, check whether a certain assignment is multi-rounds Go to expertiza/app/models/assignment.rb, find the following function

def number_of_current_round(topic_id)
    next_due_date = DueDate.get_next_due_date(self.id, topic_id)
    return 0 if next_due_date.nil?
    next_due_date.round
    #next_due_date.round ||= 0
  end
  def current_stage_name(topic_id = nil)
    if self.staggered_deadline?
      return (topic_id.nil? ? 'Unknown' : get_current_stage(topic_id))
    end
    due_date = find_current_stage(topic_id)

check current rounds, if >=2, then checkbox can be clicked.

2. Then, Edit the database

Go to DB, add an attribute named 'is_second_round_allowed_checked' to assignment

3. Finally, add the function

Go to expertiza/app/models/assignment.rb, add a function called 'allow_second_round_review'. When rounds <2, do nothing; else, allow second_round reviews if box checked.

4. Change the view of student_review as following:

<% if check_reviewable_topics(@assignment) or @assignment.get_current_stage(@topic_id) == "Finished" %>
    <%= render :partial => 'responses', :locals => {:mappings => @review_mappings, :title => 'Review'} %>
    <% if @assignment.number_of_current_round(@topic_id) == 1 or (@assignment.number_of_current_round(@topic_id) >= 2 and @assignment.allow_doing_subsequent_review_without_first_round) %>   
      <% if @assignment.dynamic_reviewer_assignment? %>
          <% if @num_reviews_in_progress >= Assignment.max_outstanding_reviews %>
              <br><br>
              <span>Note: You can't have more than 2 outstanding reviews. You must complete one of your outstanding reviews before selecting another.</span>
          <% elsif @assignment.num_reviews && @assignment.num_reviews >= 0 && @num_reviews_total >= @assignment.num_reviews%>
              <br><br>
              <span>Note: You can't do more than <%=@assignment.num_reviews%> reviews according to assignment policy.</span>
          <%else %>
            <%= render :partial => 'set_dynamic_review', :locals => {:assignment => @assignment, :participant => @participant} %>
          <% end %>
      <% end %>
    <% end %>
<% else %>

where the second if-statement ensures that the student can only have request option during first peer review round or get the permission from instructor during second or more round.

Test Plan

We plan to write a feature test for the project. Go to expertiza/spec/features folder, add a file named 'Allow_second_round_review'. Below is the details of our test.

Test checkbox (Instructor side)

1. Log in as instructor

2. Navigate to “Manage…”,then “Assignments”

3. Under “Actions”, choose “Edit”

4. Navigate to “Review Strategy”

5. See the checkbox “Allow student to join reviews late”

Test task list(Student side)

Case 1: Check the checkbox

1. Log in as student

2. Navigate to “Assignments”

3. Choose an assignment

4. Navigate to “Others’ work”

5. Student cannot do the second review without the first one

Case 2: Uncheck the checkbox

1. Log in as student

2. Navigate to “Assignments”

3. Choose an assignment

4. Navigate to “Others’ work”

5. Student can do the second review without the first one

References

assignments/edit/_review_strategy.html.erb

student_task/list.html.erb

Expertiza in Github

Expertiza documentation

Documentation on Database Tables