From 68ef883354ee6c3877aaeee7b1eadb7f1d668d3f Mon Sep 17 00:00:00 2001 From: Kyle Matter Date: Tue, 14 Feb 2017 15:17:20 -0800 Subject: [PATCH] MDL-50650 core_grades: allow grade imports larger than 100 points --- grade/import/csv/classes/load_data.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/grade/import/csv/classes/load_data.php b/grade/import/csv/classes/load_data.php index 28d13f918b4..7d6aeb4fc98 100644 --- a/grade/import/csv/classes/load_data.php +++ b/grade/import/csv/classes/load_data.php @@ -159,17 +159,14 @@ class gradeimport_csv_load_data { $record->userid = $studentid; $record->importer = $USER->id; // By default the maximum grade is 100. - $gradepointmaximum = 100; // If the grade limit has been increased then use the gradepointmax setting. - if ($CFG->unlimitedgrades) { - $gradepointmaximum = $CFG->gradepointmax; - } + // Unlimitedgrades allows for scores over 100%. // If the record final grade is set then check that the grade value isn't too high. // Final grade will not be set if we are inserting feedback. - if (!isset($record->finalgrade) || $record->finalgrade <= $gradepointmaximum) { + if (!isset($record->finalgrade) || $record->finalgrade <= $CFG->gradepointmax || $CFG->unlimitedgrades) { return $DB->insert_record('grade_import_values', $record); } else { - $this->cleanup_import(get_string('gradevaluetoobig', 'grades', $gradepointmaximum)); + $this->cleanup_import(get_string('gradevaluetoobig', 'grades', $CFG->gradepointmax)); return null; } }