From Petr Skoda (skodak at centrum.cz) Friday, 26 May 2006, 12:05 AM:
could you send me by email some sample backup for testing?
From Joseph R?zeau (joseph.rezeau at uhb.fr) Friday, 26 May 2006, 09:30 PM:
I have fine-tuned analysis of reported bug. It happens only when these conditions are met:
- restoring a course from 1.5 to 1.6 beta 5
- course contains at least quiz containing at least one question of the Cloze question type
- backup includes a quiz (with at least one Cloze question) AND a list of users (who may have taken this quiz or not, could not verify)
I am attaching back-up file backup-am1se-20060526-1410.zip which includes the following:
Sauvegarde du cours: Anglais pour Master 1 TEF Sciences de l’Éducation (AM1SE)
Include Quizzes with user data
Include Course Users
and causes a restore error on 1.6 beta 5
Quiz Freedman Oral Comprehension audio
The cloze question xx is missing its options
My diagnostic is that this sort of backup will restore OK even when it includes a quiz with a Cloze type question, but will cause a restore ERROR if it also includes a list of Course users.
From Joseph R?zeau (joseph.rezeau at uhb.fr) Saturday, 29 July 2006, 05:56 AM:
Now using version 1.6 I am still having a problem with restoration of courses with a quiz including Cloze questions AND students' results.
On distant Moodle site (university): quiz contains cloze questions including MCQ and short answer, authored with Moodle 1.5 during the academic year. Distant site upgraded (smoothly) to 1.6 at the end of June.
Today (July 28th) I did a backup of one whole course on distant site. Downloaded the backup file to my local computer
On local Moodle site (Moodle 1.6.1): If I do a restore of the whole course, I get the following error messages when Moodle is trying to restore my Quiz.
a) lots of notify messages Could not recode multichoice answer id for state
b) one fatal error message Can't find the subquestion that is used as part in cloze question 62 which stops the restore process altogether... GRRRR...
SOLUTION is the same as in my previous post dated 25-May-2006: I simply comment out the error message - or I replace error() with notify() - in questiontypemultianswerquestiontype.php, at line 556:
error(Can't find the subquestion $wrappedquestionid that is used as part $seqnum in cloze question $state->question);
When I do this, in spite of the notify messages, the restore process can proceed to its end, and ... the quiz with its cloze questions is perfectly restored, as well as the student's attempts.
My question: why do we still have an ERROR message in that file which blocks things for good, when a simple notify message would be enough ???
From Tim Hunt (T.J.Hunt at open.ac.uk) Monday, 31 July 2006, 05:54 PM:
I think your 'solution' is not going to work in every case. The bit that fails is when it tries to get a record from the database to change some of the ids if necessary. That's what the restore process calls recoding.
Now, in your case, it seems that the recoding is not necessary, so everything works despite the error. But in other cases, it might not work.
Unforunately, at the moment, I don't understand how backup and restore works very well, and I don't understand how cloze questions work very well, so put the two together, and I am really out of my depth.
When might the recoding be necessary? What about when you try to restore the same file twice into the same installation of Moodle? Perhaps restore it in to a new course each time, and check they both work. Then delete the first restored course, and see if the second one still works.
If we can test this enough and are confident it works, I might check-in the fix. But I really hate checking in code I don't understand.