-
Bug
-
Resolution: Fixed
-
Major
-
2.3.4, 2.4.1, 3.4, 3.4.4
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_34_STABLE
-
MOODLE_34_STABLE, MOODLE_35_STABLE
-
MDL-38301-master -
I was looking at the code for validating dates for the new assignment.
if ($data['allowsubmissionsfromdate'] && $data['duedate']) {
|
if ($data['allowsubmissionsfromdate'] > $data['duedate']) {
|
$errors['duedate'] = get_string('duedatevalidation', 'assign');
|
}
|
}
|
if ($data['duedate'] && $data['cutoffdate']) {
|
if ($data['duedate'] > $data['cutoffdate']) {
|
$errors['cutoffdate'] = get_string('cutoffdatevalidation', 'assign');
|
}
|
}
|
if ($data['allowsubmissionsfromdate'] && $data['cutoffdate']) {
|
if ($data['allowsubmissionsfromdate'] > $data['cutoffdate']) {
|
$errors['cutoffdate'] = get_string('cutoffdatefromdatevalidation', 'assign');
|
}
|
}
|
Considering the ranges tested, I was wondering if the first and last tests should allow the submissionfrom and compared dates (duedate and cutoffdate) to be equal. I suggest that these two comparisons should use >= to prevent the case where the dates are equal to allow students to have time to submit. The validation strings support this assumption. I can't think of a contradictory case (perhaps an offline assignment).
(Damyon: Sounds correct to me - but the upgrade code will need to do something sensible for assignments with these dates already set to == - and if this is valid for offline assignments that will need special handling)
- has been marked as being related by
-
MDL-78435 Force error/warning when Moodle assignment start and due date are identical
- Closed