-
Bug
-
Resolution: Fixed
-
Minor
-
4.3.8, 4.4.4, 4.5
This is a regression from MDL-67183, which only affects some question types (we found it with https://moodle.org/plugins/qtype_varnumericset.
The stack trace looks like:
Exception occurred while calling mod_quiz\privacy\provider::export_user_data.
|
This means that plugin mod_quiz did not complete the processing of data. The following exception information may be passed on to the plugin developer:
|
|
Call to a member function evaluate() on null
|
|
#0 /var/www/html/moodle/question/type/varnumericset/calculatorbase.php(400): qtype_varnumeric_calculator_base->evaluate('b', 'temp')
|
|
#1 /var/www/html/moodle/question/type/varnumericset/questionbase.php(522): qtype_varnumeric_calculator_base->evaluate_variables_in_text('
|
|
The correct ...')
|
|
#2 /var/www/html/moodle/question/type/questionbase.php(468): qtype_varnumeric_question_base->format_text('
|
|
The correct ...', '1', Object(question_attempt), 'question', 'generalfeedback', '1770197')
|
|
#3 /var/www/html/moodle/question/classes/privacy/provider.php(200): question_definition->format_generalfeedback(Object(question_attempt))
|
|
#4 /var/www/html/moodle/mod/quiz/classes/privacy/provider.php(549): core_question\privacy\provider::export_question_usage(1332701, Object(core\context\module), Array, 7623405, Object(mod_quiz\question\display_options), true)
|
|
#5 /var/www/html/moodle/mod/quiz/classes/privacy/provider.php(337): mod_quiz\privacy\provider::export_quiz_attempts(Object(core_privacy\local\request\approved_contextlist))
|
|
#6 /var/www/html/moodle/lib/moodlelib.php(8303): mod_quiz\privacy\provider::export_user_data(Object(core_privacy\local\request\approved_contextlist))
|
|
#7 /var/www/html/moodle/privacy/classes/manager.php(578): component_class_callback('mod_quiz\\privac...', 'export_user_dat...', Array)
|
|
#8 /var/www/html/moodle/privacy/classes/manager.php(611): core_privacy\manager::component_class_callback('mod_quiz', 'core_privacy\\lo...', 'export_user_dat...', Array)
|
|
#9 /var/www/html/moodle/privacy/classes/manager.php(338): core_privacy\manager->handled_component_class_callback('mod_quiz', 'core_privacy\\lo...', 'export_user_dat...', Array)
|
|
#10 /var/www/html/moodle/admin/tool/dataprivacy/classes/task/process_data_request_task.php(122): core_privacy\manager->export_user_data(Object(core_privacy\local\request\contextlist_collection))
|
|
#11 /var/www/html/moodle/lib/classes/cron.php(556): tool_dataprivacy\task\process_data_request_task->execute()
|
|
#12 /var/www/html/moodle/lib/classes/cron.php(350): core\cron::run_inner_adhoc_task(Object(tool_dataprivacy\task\process_data_request_task))
|
|
#13 /var/www/html/moodle/lib/classes/cron.php(169): core\cron::run_adhoc_tasks(1731501142, 0, true, 1731501046)
|
|
#14 /var/www/html/moodle/admin/cli/cron.php(186): core\cron::run_main_process('60')
|
|
#15 {main}
|
The problem is line 172 of question/classes/privacy/provider.php
$question = $qa->get_question(false); |
The false there means that the question does not need to be fully initialised, which would be a performance saving, but ...
- That is not true, as the error message indicates. To export the user's data, we need the question to be fully initialised with the attempt data.
- Anyway, there is no performance saving, since later, there is a call to export_question_attempt_steps, which calls $qa->summarise_action which does ->ensure_question_initialised(), which is the think the lazy-loading is trying to avoid, so nothing is saved.
Therefore, we should just fully initialise the questoin fully from the start, by deleting the false in like 172, and therefore we should also get rid of the false in get_behaviour(false) on line 305.
(Most of the work of fixing this will be doing the testing to verify that what I think the required fix is, is actually right. – Tim)
- is a regression caused by
-
MDL-67183 Change the question_attempt class to only call apply_attempt_state if necessary
-
- Closed
-