Trying to restore courses, we get "Error writing to database" Debug led me to the backup forum. They sent me to /health report which reported below and then suggested I ask here about insight on how to handle the non-zero category names./contexts. I am a total newbie in this area:
All question categories are linked to a context id, and, the context they are linked to must exist. The following categories belong to a non-existant category:
Cat id | Category name | Context id | Num Questions |
---|---|---|---|
87 | Default for Week 1 Quiz | 2232 | 22 |
166 | Default for Week 4 Quiz | 3294 | 20 |
408 | Default for Module 7 Quiz | 6632 | 10 |
546 | Default for Module 4 Quiz 1-Supine to Sit | 8705 | 5 |
554 | Default for Module 4 Quiz 1-Supine to Sit | 8708 | 5 |
407 | Default for Module 6 Quiz | 6628 | 5 |
104 | Default for 2nd trial quiz | 2392 | 0 |
222 | Default for Exam 1 | 4081 | 0 |
262 | Default for Final exam | 4813 | 0 |
404 | Default for Module 2 Quiz | 6610 | 0 |
405 | Default for Module 3 Quiz | 6616 | 0 |
406 | Default for Module 4 Quiz | 6620 | 0 |
547 | Default for Module 4 Quiz 1-Supine to Sit | 8706 | 0 |
403 | Default for Module 5 Quiz | 6624 | 0 |
237 | Default for Module 6 Quiz | 4253 | 0 |
244 | Default for Neuro Screening - Exam 2 | 4490 | 0 |
221 | Default for Outcome Measures Post-test | 4042 | 0 |
234 | Default for Outcome Measures Pre-test | 4205 | 0 |
254 | Default for Pressure Ulcer Module and Quiz | 3537 | 0 |
288 | Default for Quiz | 5412 | 0 |
402 | Default for Quiz | 6637 | 0 |
412 | Default for Quiz | 3754 | 0 |
263 | Default for Quiz over NRS material | 4844 | 0 |
424 | Default for Quiz template 1 | 6691 | 0 |
425 | Default for Quiz template 1 | 6692 | 0 |
261 | Default for Quiz Week 3 | 4812 | 0 |
170 | Default for Replacement Quiz 3 | 3279 | 0 |
272 | Default for test quiz | 5046 | 0 |
283 | Default for test quiz | 5285 | 0 |
102 | Default for Trial quiz | 2390 | 0 |
105 | Default for Trial Quiz 2 | 2402 | 0 |
154 | Default for Week 1 Quiz | 3105 | 0 |
162 | Default for Week 1 Quiz | 3252 | 0 |
179 | Default for Week 1 Quiz | 3465 | 0 |
266 | Default for Week 2 Quiz | 3618 | 0 |
111 | Default for Week 2 Quiz | 2526 | 0 |
156 | Default for Week 2 Quiz | 3133 | 0 |
164 | Default for Week 2 Quiz | 3264 | 0 |
355 | Default for Week 3 Quiz | 4118 | 0 |
113 | Default for Week 3 Quiz | 2493 | 0 |
158 | Default for Week 3 Quiz | 3155 | 0 |
165 | Default for Week 3 Quiz | 3277 | 0 |
159 | Default for Week 4 Quiz | 3180 | 0 |
114 | Default for Week 5 Quiz | 2592 | 0 |
160 | Default for Week 5 Quiz | 3197 | 0 |
167 | Default for Week 5 Quiz | 3309 | 0 |
172 | Default for Week 6 - Brainstem & Cranial Nerves | 3323 | 0 |
69 | Default for Week 6 Quiz | 1756 | 0 |
115 | Default for Week 6 Quiz | 2615 | 0 |
157 | Default for Week 6 Quiz | 3219 | 0 |
235 | Outcome Measures Post-Test | 4205 | 0 |
Any of these categories that contain no questions can just be deleted form the database. Other categories will require more thought.
DEBUG:
Debug info: Duplicate entry '6467' for key 'mdl_qtypmultopti_que_uix'
INSERT INTO mdl_qtype_multichoice_options (layout,single,shuffleanswers,correctfeedback,correctfeedbackformat,partiallycorrectfeedback,partiallycorrectfeedbackformat,incorrectfeedback,incorrectfeedbackformat,answernumbering,shownumcorrect,questionid)
VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => '0',
1 => '1',
2 => '1',
3 => '',
4 => '1',
5 => '',
6 => '1',
7 => '',
8 => '1',
9 => 'abc',
10 => '0',
11 => 6467,
)]
Error code: dmlwriteexception
Stack trace:
- line 446 of /lib/dml/moodle_database.php: dml_write_exception thrown
- line 1164 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
- line 1210 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
- line 76 of /question/type/multichoice/backup/moodle2/restore_qtype_multichoice_plugin.class.php: call to mysqli_native_moodle_database->insert_record()
- line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_qtype_multichoice_plugin->process_multichoice()
- line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
- line 151 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
- line 91 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 177 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
- line 167 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
- line 333 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
- line 184 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()