-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.5, 4.2.2
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MDL-79332_401 -
The way things are supposed to work, there should never be statistics calculated for non-question questions like descriptions.
However, in the past, we had bugs where that did happen (e.g. MDL-77381 is related, but not the exact one).
In the case where you have some old stats analysis in the database, pointing at the wrong sore of question, this leads to a fatal error:
Exception - Call to a member function populate_from_record() on null
|
|
Stack trace:
|
line 214 of /question/classes/statistics/questions/all_calculated_for_qubaid_condition.php: Error thrown
|
line 492 of /question/classes/statistics/questions/calculator.php: call to core_question\statistics\questions\all_calculated_for_qubaid_condition->get_cached()
|
line 669 of /mod/quiz/report/statistics/report.php: call to core_question\statistics\questions\calculator->get_cached()
|
line 159 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report->get_all_stats_and_analysi
|
The code needs to be robust to this.
(If this does not cause a fatal error, you can go to the statistics report in the problem quiz, and click the 'Recalculate' button. However, with this fatal error, you can't get to the button.)
This can also happen with the variant stats 'e.g. for calcuated questions. So we need the same changes there too.
Anyway, this is affecting us, so I am going to change the code to be more robust.
- caused a regression
-
MDL-79587 Still getting occasional Call to a member function populate_from_record() because of a missing continue
- Development in progress