-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
3.5.2, 3.6, 3.7, 3.11.11
-
MOODLE_311_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
This is a followup of MDL-64609, where it was detected that is extremely easy to end with a broken gradebook.
Reproduction steps:
1. Go into a course (can be new) with at least one student
2. Create any grade-able activity, give to it the "g1" idnumber (common activity settings).
2. Go to Gradebook setup
3. Add a category
6. Edit the category calculation and set it to =[[g1]]
7. Delete the activity from the course (and run adhoc tasks if needed to complete the deletion)
8. Once deleted completely, try visiting the overview report, the user report... all them end showing an exception about gradesneedregrading. For example:
Debug info:
|
Error code: gradesneedregrading
|
$a contents:
|
×Stack trace:
|
line 717 of /grade/export/lib.php: moodle_exception thrown
|
line 138 of /grade/lib.php: call to export_verify_grades()
|
line 432 of /grade/lib.php: call to graded_users_iterator->init()
|
line 39 of /grade/report/overview/renderer.php: call to grade_get_graded_users_select()
|
line 132 of /grade/report/overview/index.php: call to gradereport_overview_renderer->graded_users_selector()
|
So, it's extremely easy to break the gradebook with something as simple as removing an activity or grade item that is being used in calculations. And later it's extremely hard to find which formula is the one causing the mess.
This issue is about:
A) If possible, avoid removing activities or grade items that are being used. Consistency.
B) When any grade item needs update (or its formula is wrong), show it visually, so the teacher knows which one is the problematic item. Visibility.
C) If possible, allow all those reports to work ok, no matter there are items needing update. Apply B) to those reports too.
D) Maybe, coming from MDL-74449, build some consistency checker (and fixer) so we can see which the status of big and old gradebooks is. I think we'll fins a lot of orphaned stuff in many of them.
Ciao
PS: Only confirmed in 3.7dev, but I can imagine it's the same in stables, so adding them to the affected versions.
- Discovered while testing
-
MDL-64609 Regrade can get stuck in infinite loop
- Closed
- duplicates
-
MDL-72451 Show regrade error message in the quiz view page
- Closed
- has been marked as being related by
-
MDL-51360 Full course grade recalculation can have huge impact on opening/closing quizzes
- Closed
-
MDL-70745 Prepare Moodle for PHP 8.0
- Closed
- will be (partly) resolved by
-
MDL-74449 Error in gradebook with PHP8.0
- Closed
-
MDL-72451 Show regrade error message in the quiz view page
- Closed