Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-28037

Error restoring simple quiz backup from 2.0 to 2.1

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.1
    • 2.1
    • Quiz

    Description

      Restoring a very simple quiz backup generated in 2.0 to 2.1 ends with error.

      To reproduce:

      • Restore into existing course, adding, the backup file created by MDL-28035 in one Moodle 2.1 site (I'm attaching also one copy here from my own tests.

      Expected:

      • Course should restore ok and the quiz and its attempts should be shown ok.

      Current:

      Debug info: Duplicate entry '0' for key 'mdl_quizatte_uni_uix'
       
      INSERT INTO mdl_quiz_attempts (uniqueid,userid,sumgrades,timestart,timefinish,timemodified,layout,preview,quiz,attempt) VALUES(?,?,?,?,?,?,?,?,?,?)
      [array (
      0 => 0,
      1 => '5',
      2 => '1.00000',
      3 => 1287061174,
      4 => 1287061181,
      5 => 1287061181,
      6 => '1,0',
      7 => '0',
      8 => 66,
      9 => '1',
      )]
      Stack trace:
      line 396 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 878 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 920 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 291 of /mod/quiz/backup/moodle2/restore_quiz_stepslib.php: call to mysqli_native_moodle_database->insert_record()
      line 300 of /mod/quiz/backup/moodle2/restore_quiz_stepslib.php: call to restore_quiz_activity_structure_step->process_quiz_attempt()
      line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_quiz_activity_structure_step->process_quiz_attempt_legacy()
      ...
      ...

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              stronk7 Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Glenn Ansley Glenn Ansley
              Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Sabina Abellan, Sara Arjona (@sarjona), Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                1/Jul/11