studentquiz / moodle-mod_studentquiz

Moodle-Plugin
GNU General Public License v3.0
38 stars 37 forks source link

Error restoring a StudentQuiz backup #444

Closed timhunt closed 1 year ago

timhunt commented 1 year ago

Over in https://tracker.moodle.org/browse/MDL-76849, the testing involved restoring a particular SQ backup, and that gave an error.

This is the file (Extra .zip added just to stop GitHub complaining, you will have to remove it.) quiz_examples.mbz.zip

When you try to restore that, apparenly, you get error

Debug info: ERROR: column q.category does not exist
--
LINE 5: JOIN mdl_question q ON q.category = qc.id
^
SELECT q.id
FROM mdl_studentquiz sq
JOIN mdl_context con ON con.instanceid = sq.coursemodule
JOIN mdl_question_categories qc ON qc.contextid = con.id
JOIN mdl_question q ON q.category = qc.id
WHERE q.hidden = 0
AND q.parent = 0
AND sq.coursemodule = $1
AND qc.id = $2
AND q.id NOT IN (SELECT questionid FROM mdl_studentquiz_question WHERE state != 0)
[array (
0 => '1597',
1 => '46',
)]
Error code: dmlreadexception
timhunt commented 1 year ago

This error comes if you try to restore a backup using the Moodle 3.11 version of StudentQuiz with Moodle 4.0. So, not a real issue. Closing