Quiz Restore Fails to Copy All of the Questions

Quiz Restore Fails to Copy All of the Questions

David Somers-Harris གིས-
Number of replies: 9
Problem:

I Backup quizzes from one course and restore it into another, but I get an error when I attempt the quiz saying the question could not be found.

How I came across the problem:

Part I
  1. Clicked Backup in the Administration Block of source course "ANTH 101 FO SP08"
  2. Set only quizzes to be backed up. i.e.
    1. Un-check everything (including user data) except for Quizzes
    2. Set all drop down lists to "none" or "no"
    3. Click Continue
  3. I see the backup details page with some error output. See attached image "output1.PNG". I click continue
  4. I see the backup process output. Output is below, see "Output 2". I click continue.
  5. I see the output in the files repository. I download the zip file, which contains the moodle.xml file. See next post "Output 3" with attachment "backup-anth_101_fo_sp08-20081008-1555.zip"
  6. Course restore details displayed. See "Output 4" below. I click continue
  7. I leave everything as is, and click continue. See "Output 5" below
  8. I am warned that the process can take a long time. I click continue
  9. The restore process is displayed. See "Output 6" below
Part II
  1. I go to destination course "ANTH 101 FO FA08" and click Restore
  2. I click Upload a file and upload "backup-anth_101_fo_sp08-20081008-1555.zip"
  3. I click restore next to "backup-anth_101_fo_sp08-20081008-1555.zip"
  4. I am asked if I want to continue. No errors are given. I click Yes.
Part III
  1. I click on the first quiz "Midterm #1"
  2. I turn off the closing time so that I can preview the quiz
    1. click update this quiz
    2. check disable next to close the quiz
    3. click save and display
  3. I click preview quiz now
  4. I get an alert saying "This quiz has a time limit and is limited to 1 attempt(s). You are about to start a new attempt. Do you wish to proceed?" I click ok
  5. I get an error saying "Could not load question options". I click continue
The error in step 5 of part III sometimes happens right away, or other times happens 3 questions in etc.

I went back to the source course "ANTH 101 FO SP08" and double-checked quiz "Midterm #1" by previewing it and clicking through every question. They were all there; none were missing, and no errors were given.

-------Output 2--------

Course backup: ANTH 101 FO: Introduction Cultural Anthropology (ANTH 101 FO SP08)

Name: backup-anth_101_fo_sp08-20081008-1555.zip
  • Creating temporary structures
  • Deleting old data
  • Creating XML file
    • Writing header
    • Writing general info
    • Writing course data


      <p><img title="Image of orange FOCUS logo" height="56" alt="Image of orange FOCUS logo" hspace="0" src="https://courses.mytwu.ca/file.php?file=/3864/images/focus.jpg" width="200" align="middle" border="0" /></p><hr /><strong>Freshman Online Certificate University Studies</strong> <p></p>
      changed to
      <p><img title="Image of orange FOCUS logo" height="56" alt="Image of orange FOCUS logo" hspace="0" src="$@FILEPHP@$/images/focus.jpg" width="200" align="middle" border="0" /></p><hr /><strong>Freshman Online Certificate University Studies</strong> <p></p>

      • line 2371 of backup/backuplib.php: call to debugging()
      • line 443 of backup/backuplib.php: call to backup_encode_absolute_links()
      • line 1131 of backup/backuplib.php: call to full_tag()
      • line 2980 of backup/backuplib.php: call to backup_course_sections()
      • line 60 of backup/backup_execute.html: call to backup_execute()
      • line 135 of backup/backup.php: call to include_once()
  • Writing users info
  • Writing categories and questions. . . . . . . . . . . . . . . . . . .
  • Writing scales info
  • Writing groups info
  • Writing groupings info
  • Writing groupings-groups info
  • Writing events info
  • Writing gradebook info
  • Writing modules info
    • Quizzes
  • Course format data
Zipping backup Copying zip file Cleaning temp data
Backup completed successfully

--------Output 4--------

Course restore: backup-anth_101_fo_sp08-20081008-1555.zip

  • Creating temporary structures
  • Deleting old data
  • Copying zip file
  • Unzipping backup
  • Checking for BlackBoard export
  • Checking backup
  • Reading info from backup

Course:

Name: ANTH 101 FO: Introduction Cultural Anthropology (ANTH 101 FO SP08)
Summary: Course administration

Backup:

Backup Name: backup-anth_101_fo_sp08-20081008-1555.zip
Moodle Version: 1.9.2+ (Build: 20080717) (2007101520)
Backup Version: 1.9 (2008030300)
Backup Date: Wednesday, 8 October 2008, 03:55 PM

Backup Details:

Assignments: Not included
Forums: Not included
Labels: Not included
Quizzes: Included without user data
Midterm #1 Included without user data
Mid-term #2 Included without user data
FINAL EXAM Included without user data
Resources: Not included
Books: Not included
Metacourse: No
Users: None
Logs: No
User Files: No
Course files: No
Site files: No
Grade histories: No

------Output 5------------

Course restore: backup-anth_101_fo_sp08-20081008-1555.zip

Restore to Existing course, deleting it first Existing course, adding data to it

Include All/None All/None

Quizzes without user data

Midterm #1
Mid-term #2
FINAL EXAM

Metacourse No
Users None
Groups & groupingsHelp with Groups (new window) None Groups only Groupings only Groups & groupings
Logs No
User Files No
Course files No
Site files No
Grade histories No

Role mappings

Source role Target role
Teacher (editingteacher) new role Teacher (editingteacher) Non-editing teacher (teacher) Student (student) Guest (guest) Faculty Assistant (facultyassistant) Teaching Assistant (ta) Guest Instructor (guest_instructor)
Student (student) new role Teacher (editingteacher) Non-editing teacher (teacher) Student (student) Guest (guest) Faculty Assistant (facultyassistant) Teaching Assistant (ta) Guest Instructor (guest_instructor)

----Output 6----

Course restore: backup-anth_101_fo_sp08-20081008-1555.zip

  • Using existing course
    • From: ()
    • To: ANTH 101 FO: Introduction Cultural Anthropology (ANTH 101 FO FA08)
    • Adding data to existing
  • Creating groups
  • Creating groupings
  • Adding groups into groupings
  • Checking sections
  • Creating categories and questions
    • Category "Default"
      . . . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . .
    • Category "Default for Midterm #1"
    • Category "Default for Mid-term #2"
    • Category "Default for FINAL EXAM"
  • Creating scales
  • Creating events
  • Creating course modules
    • Quiz "Midterm #1" . .
    • Quiz "Mid-term #2" . . .
    • Quiz "FINAL EXAM" . . . . . . . . . . . . .
  • Checking instances
  • Refreshing events
  • Decoding internal links
    • From Course
    • From Sections
    • From Quizzes.
    • From Blocks
    • From Questions. . . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . . . .
      . . .
  • Creating gradebook
    • Grade items
  • Creating roles definitions
  • Creating course level role assignments and overrides
  • Creating module level role assignments and overrides
  • Creating user level role assignments and overrides
  • Checking course
  • Cleaning temp data
  • Closing the Restorelog.html file.
Restore completed successfully



Attachment output1.PNG
དཔྱ་སྙོམས་ཀྱི་སྐུགས་ཚུ།: -
In reply to David Somers-Harris

Re: Quiz Restore Fails to Copy All of the Questions

David Somers-Harris གིས-
In reply to David Somers-Harris

Re: Quiz Restore Fails to Copy All of the Questions

David Somers-Harris གིས-
hello? May I have some feedback? Was my post too large? I was hoping to be as detailed as possible so that my problem would be very clear. Even a little hello would cheer me up because Im getting a little lonely here in this discussion
In reply to David Somers-Harris

Re: Quiz Restore Fails to Copy All of the Questions

Jeff Forssell གིས-
"A little hello" approve

I would like to at least cheer you up. I sometimes have had the same forum-situation- put out a bunch of info and got no "bites".

I don't have the expertise to say what to do.blush (and was a bit overwhelmed by the size of the entry!mixed)

But it might be good to restate your problem very short and point out that you have LOTS of info in the thread.
In reply to Jeff Forssell

Re: Quiz Restore Fails to Copy All of the Questions

David Somers-Harris གིས-
thanks! I'll try that...
In reply to David Somers-Harris

Re: Quiz Restore Fails to Copy All of the Questions

Tim Hunt གིས-
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
I am now back from holiday, so I had better respond to this. (Jeff is right, long forum posts can be daunting, although you are right to err on the side of giving too much information.)

I don't understand what is going wrong. It would be interesting to know what is wrong with questions 2787, 2788 and 2789, which generate the initial error messages. Can you find them, and try previewing them or editing them.

Then, with the restored course, can you work out the id of the question that is leading to the error messages, and what is the id of the corresponding question from the original course?

Hopefully that extra information will give us some clues.
In reply to Tim Hunt

Re: Quiz Restore Fails to Copy All of the Questions

David Somers-Harris གིས-
Hi Tim,

Thanks for your reply. I wasn't sure when you were getting back, though I was aware you were on a holiday involving a moot of some sort =P.

Here are the results for your requests. P.S. nice profile picture =)

Attempt to Preview:
I went to the question bank of the source course, ANTH 101 FO SP08 and found the questions you mentioned: 2787, 2788, & 2789. Attempting to preview any of them gives an error, as described by Output 1. I tried previewing the rest of the questions without a problem.

I did the same thing for the destination course, ANTH 101 FO FA08. Those 3 questions gave the same error described by Output 1, as did most of the rest of the questions. The only questions which didn't give the error were 2760, 2761, 2762 and 2763. (These 4 question numbers are according to the xml file previously posted)

Attempt to Edit:
Source course, ANTH 101 FO SP08: When trying to edit question 2787, 2788 and 2789 I got an error and warning at the top of the edit page as described by Output 2. The other questions I checked didn't give any such error at the top of the edit page.

Destination course, ANTH 101 FO FA08: The same 3 questions gave errors as well, which were different and a little longer, as described by Output 3. Other questions (probably the same ones which gave errors when I attempted to preview, i.e. all except 2760, 2761, 2762 and 2763 - I didn't check all of them) gave errors as well. Multiple choice questions had error output as described by Output 4.

Note that previewing questions didn't let me see the preview at all - only the error - while attempting to edit the questions let me see the question in the edit form but with the errors at the top of the page.

Crosslisting Question id's:
The id's of the questions giving errors in the source course were 2787, 2788, and 2789. Their corresponding id's in the destination/restored course are 15662, 15663, and 15664. I didn't check the corresponding id's for all the questions giving errors in the restored course, because there are a lot of them. If you were wanting those too, let me know, and I can check.

----------------------Output 1----------------------
Error: Missing question options!

Error: Could not start a new attempt at the quiz

More information about this error

Stack trace:
  • line 5756 of lib/weblib.php: call to debugging()
  • line 101 of question/preview.php: call to print_error()
----------------------Output 2----------------------
Error: Missing question answers for shortanswer question 2789!

Warning: Invalid argument supplied for foreach() in /var/www/html/courses.mytwu.ca/question/type/shortanswer/edit_shortanswer_form.php on line 60

----------------------Output 3----------------------

Error: Missing question options!

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/shortanswer/edit_shortanswer_form.php on line 38

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/shortanswer/edit_shortanswer_form.php on line 57

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/shortanswer/edit_shortanswer_form.php on line 67

----------------------Output 4----------------------
Error: Missing question options for multichoice question15673!

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/multichoice/edit_multichoice_form.php on line 53

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/multichoice/edit_multichoice_form.php on line 85

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/multichoice/edit_multichoice_form.php on line 95

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/multichoice/edit_multichoice_form.php on line 96

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/multichoice/edit_multichoice_form.php on line 97

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/multichoice/edit_multichoice_form.php on line 98

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/multichoice/edit_multichoice_form.php on line 99

Notice: Trying to get property of non-object in /var/www/html/courses.mytwu.ca/question/type/multichoice/edit_multichoice_form.php on line 100


-------
Note that there is no space between the word "question" and the question number in Output 4 (compare with Output 2). Little aesthetic detail in the moodle error output =P.
In reply to David Somers-Harris

Re: Quiz Restore Fails to Copy All of the Questions

Tim Hunt གིས-
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
So the problem is with the question in the original course. They are broken in some way. Once they are broken, all bets are off.

Well, possibly Moodle should be more robust in the case of broken questions.

Anyway, I think you either need to try to fix the broken questions in the database, or delete them.
In reply to Tim Hunt

Re: Quiz Restore Fails to Copy All of the Questions

David Somers-Harris གིས-
I just learned that these questions were imported from Hot Potatoes. So would they have been broken in the Hot Potatoes->Moodle import process? If so, would this be a bug worth looking into on Moodle's part?
In reply to David Somers-Harris

Re: Quiz Restore Fails to Copy All of the Questions

Tim Hunt གིས-
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
It would be worth looking into (fixing even མིག་ཁྱབ་) given reliable steps to reproduce. That is, if you can get a Hot potatoes file that just contains one or two questions which, when imported to the question bank, exhibit this problem, then please file a new issue in the tracker (http://tracker.moodle.org/ - you will need to sign up there with a separate username and password), and attached the file that demonstrates the problem. Thanks.