Permalink
Browse files

Merge branch 'MDL-38301-master' of git://github.com/junpataleta/moodle

  • Loading branch information...
dmonllao committed Sep 3, 2018
2 parents c4aa41c + 8f7d07f commit dfc6f782e163de3dbc974c2e21246515e960bb6e
Showing with 9 additions and 9 deletions.
  1. +3 −3 mod/assign/lang/en/assign.php
  2. +6 −6 mod/assign/mod_form.php
@@ -134,8 +134,8 @@
$string['cutoffdate'] = 'Cut-off date';
$string['cutoffdatecolon'] = 'Cut-off date: {$a}';
$string['cutoffdate_help'] = 'If set, the assignment will not accept submissions after this date without an extension.';
$string['cutoffdatevalidation'] = 'The cut-off date cannot be earlier than the due date.';
$string['cutoffdatefromdatevalidation'] = 'Cut-off date must be after the allow submissions from date.';
$string['cutoffdatevalidation'] = 'Cut-off date cannot be earlier than the due date.';
$string['cutoffdatefromdatevalidation'] = 'Cut-off date cannot be earlier than the allow submissions from date.';
$string['defaultlayout'] = 'Restore default layout';
$string['defaultsettings'] = 'Default assignment settings';
$string['defaultsettings_help'] = 'These settings define the defaults for all new assignments.';
@@ -157,7 +157,7 @@
$string['submissionmodified'] = 'You have existing submission data. Please leave this page and try again.';
$string['submissionmodifiedgroup'] = 'The submission has been modified by somebody else. Please leave this page and try again.';
$string['duedatereached'] = 'The due date for this assignment has now passed';
$string['duedatevalidation'] = 'Due date must be after the allow submissions from date.';
$string['duedatevalidation'] = 'Due date cannot be earlier than the allow submissions from date.';
$string['editattemptfeedback'] = 'Edit the grade and feedback for attempt number {$a}.';
$string['editonline'] = 'Edit online';
$string['editingpreviousfeedbackwarning'] = 'You are editing the feedback for a previous attempt. This is attempt {$a->attemptnumber} out of {$a->totalattempts}.';
@@ -223,18 +223,18 @@ public function definition() {
public function validation($data, $files) {
$errors = parent::validation($data, $files);
if ($data['allowsubmissionsfromdate'] && $data['duedate']) {
if ($data['allowsubmissionsfromdate'] > $data['duedate']) {
if (!empty($data['allowsubmissionsfromdate']) && !empty($data['duedate'])) {
if ($data['duedate'] < $data['allowsubmissionsfromdate']) {
$errors['duedate'] = get_string('duedatevalidation', 'assign');
}
}
if ($data['duedate'] && $data['cutoffdate']) {
if ($data['duedate'] > $data['cutoffdate']) {
if (!empty($data['cutoffdate']) && !empty($data['duedate'])) {
if ($data['cutoffdate'] < $data['duedate'] ) {
$errors['cutoffdate'] = get_string('cutoffdatevalidation', 'assign');
}
}
if ($data['allowsubmissionsfromdate'] && $data['cutoffdate']) {
if ($data['allowsubmissionsfromdate'] > $data['cutoffdate']) {
if (!empty($data['allowsubmissionsfromdate']) && !empty($data['cutoffdate'])) {
if ($data['cutoffdate'] < $data['allowsubmissionsfromdate']) {
$errors['cutoffdate'] = get_string('cutoffdatefromdatevalidation', 'assign');
}
}

0 comments on commit dfc6f78

Please sign in to comment.