-
Bug
-
Resolution: Fixed
-
Minor
-
2.1.4, 2.2.1
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
It turns out that that fix for MDL-21934, while an improvement, was not sufficient. We (at the OU) have now thought of a better logic.
The problem is that if $quiz->sumgrades is 0 (such as when you have just removed all questions from a quiz, prior to adding some different ones) then we have to set $quiz->grade to 0, otherwise there will be a divide by zero error when a student attempts the quiz, and we try to compute their final grade.
However, when you are editing the quiz, there are no attempts yet, and so this theoretical difficulty does not arise, and the resetting to 0 is bloody annoying.
So, the proposed solution is:
1. In quiz_update_sumgrades, change the logic for doing quiz_set_grade(0, $quiz) from layout not empty to quiz has attempts.
2. Add a test when someone tries to start an attempt. If sumgrades is 0, while grade is non-zero, give a nice error at this time.
3. In addition, display quiz grade on the order and paging tab of mod/quiz/edit.php, so it is clearer what is going on.
- has a non-specific relationship to
-
MDL-21934 Setting Quiz value to 0 shuffles the feedback fields.
- Closed