Permalink
Browse files

MDL-33878: Assignment - prevent error when removing overridden flag i…

…n gradebook

This error only occurs when there is a submission but no grade in the assignment
and the feedback comments plugin is enabled.
  • Loading branch information...
1 parent e85b7e7 commit 14c46e24a91d3ab8d718e3ff3b38214151193cc9 Damyon Wiese committed Jun 20, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 mod/assign/locallib.php
@@ -3349,8 +3349,10 @@ public function get_user_grades_for_gradebook($userid) {
// now get the feedback
if ($gradebookplugin) {
$grade = $this->get_user_grade($result->userid, false);
- $gradebookgrade->feedbacktext = $gradebookplugin->text_for_gradebook($grade);
- $gradebookgrade->feedbackformat = $gradebookplugin->format_for_gradebook($grade);
+ if ($grade) {
+ $gradebookgrade->feedbacktext = $gradebookplugin->text_for_gradebook($grade);
+ $gradebookgrade->feedbackformat = $gradebookplugin->format_for_gradebook($grade);
+ }
}
$grades[$gradebookgrade->userid] = $gradebookgrade;
}

0 comments on commit 14c46e2

Please sign in to comment.