Skip to content

Commit

Permalink
Fix code that removes previously reviewed submissions from
Browse files Browse the repository at this point in the history
the set of candidate submissions to review.
  • Loading branch information
efg committed Apr 15, 2014
1 parent 9b5adc7 commit 70cbec0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
12 changes: 1 addition & 11 deletions app/models/assignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def reject_by_least_reviewed(contributor_set)
end

def reject_previously_reviewed_submissions(contributor_set, reviewer)
contributor_set.reject! { |contributor| contributor.reviewed_by?(Participant.where(user_id: reviewer.id, parent_id: contributor.assignment.id).first) }
contributor_set.reject! { |contributor| contributor.reviewed_by?(reviewer) }
return contributor_set
end

Expand Down Expand Up @@ -151,7 +151,6 @@ def assign_reviewer_dynamically(reviewer, topic)
# The following method raises an exception if not successful which
# has to be captured by the caller (in review_mapping_controller)
contributor = contributor_to_review(reviewer, topic)

contributor.assign_reviewer(reviewer)
end

Expand Down Expand Up @@ -218,17 +217,11 @@ def quiz_taken_by?(contributor, reviewer)
def contributor_to_review(reviewer, topic)
raise 'Please select a topic' if has_topics? && topic.nil?
raise 'This assignment does not have topics' if !has_topics? && topic

# This condition might happen if the reviewer waited too much time in the
# select topic page and other students have already selected this topic.
# Another scenario is someone that deliberately modifies the view.
raise 'This topic has too many reviews; please select another one.' unless candidate_topics_to_review(reviewer).include?(topic) if topic

p "contributors.nil?"
p contributors.nil?
p "Contributors:"
p contributors.class
p contributors.size
contributor_set = Array.new(contributors)
work = (topic.nil?) ? 'assignment' : 'topic'

Expand Down Expand Up @@ -262,9 +255,6 @@ def contributor_to_review(reviewer, topic)
end

def contributors
p "in contributors method:"
p "teams.size"
p teams.size
#ACS Contributors are just teams, so removed check to see if it is a team assignment
@contributors ||= teams #ACS
end
Expand Down
1 change: 1 addition & 0 deletions app/views/student_review/_responses.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<td>Begin</td>
<td> (Work has not yet been submitted) for <% review_no += 1 %></td>
<% end %>
<% review_no+=1 %>
</tr>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/student_review/list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<% end %>
<% else%>
<br><br>
<span>Note: You can't have more than 3 outstanding review. Complete existing reviews.</span>
<span>Note: You can't have more than 3 outstanding reviews. You must complete one of your outstanding reviews before selecting another.</span>
<% end %>
<% end %>
Expand Down

0 comments on commit 70cbec0

Please sign in to comment.