Browse files

Some error checking

  • Loading branch information...
1 parent 305ce2b commit e909c8d0903cfcd0de735a73c164886af0360d03 moodler committed Oct 21, 2002
Showing with 3 additions and 0 deletions.
  1. +3 −0 mod/quiz/lib.php
View
3 mod/quiz/lib.php
@@ -754,6 +754,7 @@ function quiz_save_best_grade($quiz, $user) {
/// and then saves that grade in the quiz_grades table.
if (!$attempts = quiz_get_user_attempts($quiz->id, $user->id)) {
+ notify("Could not find any user attempts");
return false;
}
@@ -764,6 +765,7 @@ function quiz_save_best_grade($quiz, $user) {
$grade->grade = $bestgrade;
$grade->timemodified = time();
if (!update_record("quiz_grades", $grade)) {
+ notify("Could not update best grade");
return false;
}
} else {
@@ -772,6 +774,7 @@ function quiz_save_best_grade($quiz, $user) {
$grade->grade = $bestgrade;
$grade->timemodified = time();
if (!insert_record("quiz_grades", $grade)) {
+ notify("Could not insert new best grade");
return false;
}
}

0 comments on commit e909c8d

Please sign in to comment.