Recreate quizzes from data stored in the mdl_quiz table

Re: Recreate quizzes from data stored in the mdl_quiz table

by Guillermo Madero -
Number of replies: 0

Hi Mark,

Well, all the information is definitely there, however, reconstructing the quizzes from it I'd say is almost next to impossible, as all the quiz elements (questions, options, feedbacks) are distributed among many tables (e.g. mdl_qtype_match_subquestions, mdl_question, mdl_question_answers), where some of them just contain numeric references (links from one table to another).

Instead, what I would try would be:

1. Do a full site backup (https://docs.moodle.org/27/en/Backup) and make sure it is valid and works.

2. Restore the old database.

3. Go to the courses that contain quizzes.

4. Confirm the state of the quizzes.

5. Backup only the quiz activities of each course (https://docs.moodle.org/27/en/Reusing_activities).

6. Maybe a bit of extra work, but given the situation and to improve my possibilities of restoring the quizzes (or at least ease the process) I guess I would also go the Question bank page and export each quiz (https://docs.moodle.org/27/en/Export_questions) in Moodle XML format.

Once all that, well, time to restore and pray smile

1. Restore your site from your full site backup.

2. Go the courses which are supposed to contain quizzes and restore the respective Quiz Activity backups.

3. If for some particular reason the question bank has problems, well, you have the XML question backups, so you can try and work with them.

Once you have all your quizzes back and working... do a new full site backup smile

Cheers!