Permalink
Browse files

Merge branch 'MDL-21934_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
2 parents 3386852 + 5e54da0 commit 4239318be97c9808b208a6661601d4e27c4be155 @stronk7 stronk7 committed Aug 16, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 mod/quiz/locallib.php
View
@@ -414,7 +414,9 @@ function quiz_update_sumgrades($quiz) {
WHERE id = ?';
$DB->execute($sql, array($quiz->id));
$quiz->sumgrades = $DB->get_field('quiz', 'sumgrades', array('id' => $quiz->id));
- if ($quiz->sumgrades < 0.000005) {
+ if ($quiz->sumgrades < 0.000005 && quiz_clean_layout($quiz->questions, true)) {
+ // If there is at least one question in the quiz, and the sumgrades has been
+ // set to 0, then also set the maximum possible grade to 0.
quiz_set_grade(0, $quiz);
}
}

0 comments on commit 4239318

Please sign in to comment.