Skip to content
Permalink
Browse files
Merge branch 'MDL-38301-34' of git://github.com/junpataleta/moodle in…
…to MOODLE_34_STABLE
  • Loading branch information
David Monllao committed Sep 3, 2018
2 parents f14acd2 + 79c0b48 commit 0c8dfdcf0e9a73046406f3213b123e9f97b15b61
Showing with 9 additions and 9 deletions.
  1. +3 −3 mod/assign/lang/en/assign.php
  2. +6 −6 mod/assign/mod_form.php
@@ -133,8 +133,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.';
@@ -156,7 +156,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 0c8dfdc

Please sign in to comment.