/// 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;
}
$grade->grade = $bestgrade;
$grade->timemodified = time();
if (!update_record("quiz_grades", $grade)) {
+ notify("Could not update best grade");
return false;
}
} else {
$grade->grade = $bestgrade;
$grade->timemodified = time();
if (!insert_record("quiz_grades", $grade)) {
+ notify("Could not insert new best grade");
return false;
}
}