diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/locallib.php
+++ b/mod/quiz/locallib.php
@@ -380,7 +380,7 @@ function quiz_get_all_question_grades($quiz) {
  * @return float the rescaled grade.
  */
 function quiz_rescale_grade($rawgrade, $quiz, $round = true) {
-    if ($quiz->sumgrades) {
+    if ($quiz->sumgrades != 0) {
         $grade = $rawgrade * $quiz->grade / $quiz->sumgrades;
         if ($round) {
             $grade = quiz_format_grade($quiz, $grade);
MDL-<I> "Check all the DB columns used to store grades, and make sure they all use a consistent type." Since quiz->sumgrades is now string "<I>" (quiz->sumgrades) no longer evaluates as false. Changing to (quiz->sumgrades != 0)