Moodle 3.9.8+ (Build: 20210716)
A teacher trying to import from one course to the other is getting, 'Failed to find an answer matching "..." in the question_answers database table. This occurred while restoring the question with id 81890 in the backup file, which has been matched to the existing question with id 70191 in the database'.
The odd thing is, it happens even if the activities are not quizzes! The import breaks from about 5 courses. The target course is always the same. The teacher can import to other courses.
This sounds very much like Moodle 3.10 - Failed to find an answer matching "" in the question_answers database table.
Here is the ./admin/tool/health/:
And the two proposed solutions are:
Here are the debug trace at DEVELOPER level:
Did you remember to make the first column something unique in your call to get_records? Duplicate value 'EXAMPLE.COM+130218203516+5VXUft EXAMPLE.COM+140303115101+E8F0Wq' found in column 'concat(stamp, ' ', version)'.
About 60 identical blocks for different duplicate values, before the error:
- line 1282 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
- line 1548 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
- line 680 of /backup/util/dbops/restore_dbops.class.php: call to moodle_database->get_records_sql_menu()
- line 520 of /backup/util/dbops/restore_dbops.class.php: call to restore_dbops::prechek_precheck_qbanks_by_level()
- line 178 of /backup/util/helper/restore_prechecks_helper.class.php: call to restore_dbops::precheck_categories_and_questions()
- line 428 of /backup/controller/restore_controller.class.php: call to restore_prechecks_helper::execute_prechecks()
- line 173 of /backup/import.php: call to restore_controller->execute_precheck()N
Noticed that EXAMPLE.COM is the former domain of the site!
This is an old Moodle site, probable since rel. 2.4 successively upgraded. Anybody has an idea what sort of data inconsistency it is complaining about?
BTW, there are only two quiz related additional plugins:
- StudentQuiz (mod_studentquiz) v4.5.0 2021071300
- Kprime (ETH) (qtype_kprime) 2.3 for Moodle 3.4+ 2020042901
Otherwise, there is a healthy bunch of 30 additional plugins.