Skip to content

Commit

Permalink
MDL-39535 grade: only display grade errors once
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed May 7, 2013
1 parent e0fc61f commit 63d2081
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion grade/export/lib.php
Expand Up @@ -434,6 +434,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)));
}
}
8 changes: 3 additions & 5 deletions grade/lib.php
Expand Up @@ -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.
Expand Down Expand Up @@ -134,10 +135,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
Expand Down

0 comments on commit 63d2081

Please sign in to comment.