Review Board 1.5.5

Next/prev links in Grader now auto-create Submissions if past collection date

Updated 2 years, 4 months ago

Mike Conley Reviewers
release_0.5 markus_developers
None MarkUs Source Code Repository
So the next/prev links in the Grader View were only handy if the Submissions had already been created - they would skip over any Groupings that didn't have a Submission at all.

Now, if we're past the collection date, next/prev links will detect whether or not a Submission has been created, and create if necessary.

 

Diff revision 2 (Latest)

1 2
1 2

  1. branches/release_0.5/app/controllers/results_controller.rb: Loading...
  2. branches/release_0.5/app/models/grouping.rb: Loading...
branches/release_0.5/app/controllers/results_controller.rb
Revision 1028 New Change
... 66 lines hidden [Expand]
def edit
67
    end
67
    end
68
    
68
    
69
    # If a grouping's submission's marking_status is complete, we're not going
69
    # If a grouping's submission's marking_status is complete, we're not going
70
    # to include them in the next_submission/prev_submission list
70
    # to include them in the next_submission/prev_submission list
71
    
71
    

   
72
    # If a grouping doesn't have a submission, and we are past the collection time, 

   
73
    # we *DO* want to include them in the list.

   
74
    collection_time = @assignment.submission_rule.calculate_collection_time.localtime

   
75
    
72
    groupings.delete_if do |grouping|
76
    groupings.delete_if do |grouping|
73
      grouping != @grouping && (!grouping.has_submission? || grouping.get_submission_used.result.marking_state == Result::MARKING_STATES[:complete])
77
      grouping != @grouping && (grouping.marking_completed? || (!grouping.has_submission? && (Time.now < collection_time)))
74
    end
78
    end
75
    
79
    
76
    # We sort by Group name by default
80
    # We sort by Group name by default
77
    groupings = groupings.sort do |a, b|
81
    groupings = groupings.sort do |a, b|
78
      a.group.group_name <=> b.group.group_name
82
      a.group.group_name <=> b.group.group_name
... 240 lines hidden [Expand]
branches/release_0.5/app/models/grouping.rb
Revision 1023 New Change
 
  1. branches/release_0.5/app/controllers/results_controller.rb: Loading...
  2. branches/release_0.5/app/models/grouping.rb: Loading...