Merge branch 'MDL-54802-30-fix-2' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE

This commit is contained in:
Dan Poltawski
2016-10-05 14:33:53 +01:00
2 changed files with 9 additions and 2 deletions
+1
View File
@@ -400,6 +400,7 @@ $string['grademethod_help'] = 'When multiple attempts are allowed, the following
$string['gradesdeleted'] = 'Quiz grades deleted';
$string['gradesofar'] = '{$a->method}: {$a->mygrade} / {$a->quizgrade}.';
$string['gradetopassnotset'] = 'This quiz does not have a grade to pass set so you cannot use this option. Please use the require grade setting instead.';
$string['gradetopassmustbeset'] = 'Grade to pass cannot be zero as this quiz has its completion method set to require passing grade. Please set a non-zero value.';
$string['gradingdetails'] = 'Marks for this submission: {$a->raw}/{$a->max}.';
$string['gradingdetailsadjustment'] = 'With previous penalties this gives <strong>{$a->cur}/{$a->max}</strong>.';
$string['gradingdetailspenalty'] = 'This submission attracted a penalty of {$a}.';
+8 -2
View File
@@ -534,9 +534,15 @@ class mod_quiz_mod_form extends moodleform_mod {
}
if (array_key_exists('completion', $data) && $data['completion'] == COMPLETION_TRACKING_AUTOMATIC) {
$completionpass = isset($data['completionpass']) ? $data['completionpass'] : $this->current->completionpass;
// Show an error if require passing grade was selected and the grade to pass was set to 0.
if ($data['completionpass'] == 1 && (empty($data['gradepass']) || grade_floatval($data['gradepass']) == 0)) {
$errors['completionpassgroup'] = get_string('gradetopassnotset', 'quiz');
if ($completionpass && (empty($data['gradepass']) || grade_floatval($data['gradepass']) == 0)) {
if (isset($data['completionpass'])) {
$errors['completionpassgroup'] = get_string('gradetopassnotset', 'quiz');
} else {
$errors['gradepass'] = get_string('gradetopassmustbeset', 'quiz');
}
}
}