Hello!
I hope you can help me. I have a Moodle 4.1.8 installation with PHP 8.1. I need to restore exams in a course from a backup of another course. The restoration process completes successfully, but when reviewing students' attempts, the questions and answers are displayed correctly except for the multiple-choice ones. For those, the following message appears: "This choice was deleted after the attempt was started," even though the choice was neither deleted nor regraded previously.
After some testing, I've noticed this pattern:
If I restore the same backup into a new and empty course, the exam displays correctly, and the message "This choice was deleted after the attempt was started" doesn't appear. However, if I restore a different exam from the same course, that message appears again. Before the restoration success message, I'm seeing the following logs:
Attempting to recover the grades of a user who already has grades. Skipping recover.
line 1089 of /lib/gradelib.php: call to debugging()
line 2157 of /lib/enrollib.php: call to grade_recover_history_grades()
line 443 of /enrol/manual/lib.php: call to enrol_plugin->enrol_user()
line 2409 of /backup/moodle2/restore_stepslib.php: call to enrol_manual_plugin->restore_user_enrolment()
line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_enrolments_structure_step->process_enrolment()
line 123 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
line 178 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
line 111 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
line 190 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
line 278 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
line ? of unknownfile: call to progressive_parser->end_tag()
line 179 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
line 110 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
line 181 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
line 191 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
line 168 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
line 408 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
line 219 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
line 146 of /backup/restore.php: call to restore_ui->execute()