| Class | SubmissionRule |
| In: |
app/models/submission_rule.rb
|
| Parent: | ActiveRecord::Base |
When Students view the File Manager after the collection time, MarkUs should warnthe Students with a message saying that the due date has passed, and that any work they‘re submitting will probably not be graded
# File app/models/submission_rule.rb, line 39
39: def after_collection_message
40: raise NotImplementedError.new("SubmissionRule: after_collection_message not implemented")
41: end
Takes a Submission (with an attached Result), and based on the properties of this SubmissionRule, applies penalties to the Result - for example, will add an ExtraMark of a negative value, or perhaps add the use of a Grace Day.
# File app/models/submission_rule.rb, line 58
58: def apply_submission_rule(submission)
59: raise NotImplementedError.new("SubmissionRule: apply_submission_rule not implemented")
60: end
Returns true or false based on whether the attached Assignment‘s properties will work with this particular SubmissionRule
# File app/models/submission_rule.rb, line 51
51: def assignment_valid?
52: raise NotImplementedError.new("SubmissionRule: assignment_valid? not implemented")
53: end
Based on the assignment‘s due date, return the collection time for submissions Return a value of type Time
# File app/models/submission_rule.rb, line 23
23: def calculate_collection_time
24: raise NotImplementedError.new("SubmissionRule: calculate_collection_time not implemented")
25: end
validates_associated :assignment validates_presence_of :assignment
# File app/models/submission_rule.rb, line 10
10: def can_collect_now?
11: return @can_collect_now if !@can_collect_now.nil?
12: @can_collect_now = Time.now >= get_collection_time
13: end
When Students commit code after the collection time, MarkUs should warn the Students with a message saying that the due date has passed, and the work they‘re submitting will probably not be graded
# File app/models/submission_rule.rb, line 30
30: def commit_after_collection_message
31: #I18n.t 'submission_rules.submission_rule.commit_after_collection_message'
32: raise NotImplementedError.new("SubmissionRule: commit_after_collection_message not implemented")
33: end
# File app/models/submission_rule.rb, line 62
62: def description_of_rule
63: raise NotImplementedError.new("SubmissionRule: description_of_rule not implemented")
64: end
Cache that allows us to quickly get collection time
# File app/models/submission_rule.rb, line 16
16: def get_collection_time
17: return @get_collection_time if !@get_collection_time.nil?
18: @get_collection_time = calculate_collection_time
19: end
# File app/models/submission_rule.rb, line 66
66: def grader_tab_partial(grouping)
67: raise NotImplementedError.new("SubmissionRule: render_grader_tab not implemented")
68: end
When we‘re past the due date, the File Manager for the students will display a message to tell them that they‘re currently past the due date.
# File app/models/submission_rule.rb, line 45
45: def overtime_message
46: raise NotImplementedError.new("SubmissionRule: overtime_message not implemented")
47: end