Skip to content
Browse files

MDL-39535 grade: only display grade errors once

  • Loading branch information...
1 parent 242ef45 commit 7b178abfbb5dad1d811430fa63a929b85c9a84cc @markn86 markn86 committed May 7, 2013
Showing with 4 additions and 6 deletions.
  1. +1 −1 grade/export/lib.php
  2. +3 −5 grade/lib.php
View
2 grade/export/lib.php
@@ -427,6 +427,6 @@ public function close() {
function export_verify_grades($courseid) {
$regraderesult = grade_regrade_final_grades($courseid);
if (is_array($regraderesult)) {
- throw new moodle_exception('gradecantregrade', 'error', '', implode(',', $regraderesult));
+ throw new moodle_exception('gradecantregrade', 'error', '', implode(', ', array_unique($regraderesult)));
}
}
View
8 grade/lib.php
@@ -22,7 +22,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once $CFG->libdir.'/gradelib.php';
+require_once($CFG->libdir . '/gradelib.php');
+require_once($CFG->dirroot . '/grade/export/lib.php');
/**
* This class iterates over all users that are graded in a course.
@@ -128,10 +129,7 @@ public function init() {
$this->close();
- $regraderesult = grade_regrade_final_grades($this->course->id);
- if (is_array($regraderesult)) {
- throw new moodle_exception('gradecantregrade', 'error', '', implode(',', $regraderesult));
- }
+ export_verify_grades($this->course->id);
$course_item = grade_item::fetch_course_item($this->course->id);
if ($course_item->needsupdate) {
// can not calculate all final grades - sorry

0 comments on commit 7b178ab

Please sign in to comment.
Something went wrong with that request. Please try again.