From: jamiesensei Date: Mon, 8 Sep 2008 10:35:14 +0000 (+0000) Subject: MDL-7308 "Check all the DB columns used to store grades, and make sure they all use... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c8b2ab1b009d4c9fcc218a872519b421b7dfc7b1;p=moodle.git MDL-7308 "Check all the DB columns used to store grades, and make sure they all use a consistent type." Since quiz->sumgrades is now string "0.00000" (quiz->sumgrades) no longer evaluates as false. Changing to (quiz->sumgrades != 0) --- diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index 60efc87057..50fc960cae 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);