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

Restore of old 2.0 course backup failing with questions stuff

XMLWordPrintable

    • MOODLE_27_STABLE
    • MOODLE_27_STABLE
    • Hide
      1. Make a quiz on a Moodle 2.0 site (but without any randomsamatch questions).
      2. Attempt the quiz as a student.
      3. Back up the course with user data
      4. Restore it into a master install.
      5. Verify there are no errors during restore.
      6. Verify that the restored quiz and attempts are an accurate copy.
      Show
      Make a quiz on a Moodle 2.0 site (but without any randomsamatch questions). Attempt the quiz as a student. Back up the course with user data Restore it into a master install. Verify there are no errors during restore. Verify that the restored quiz and attempts are an accurate copy.

      This is apparently a regression of MDL-43670, where some quiz_question_instances columns were renamed.

      Trying to restore the attached course backup (2.0 one), the process dies with error:

      Error reading from database
       
      More information about this error
       
      Debug info: Unknown column 'qqi.grade' in 'field list'
       
      SELECT q.*, qqi.grade AS maxmark
      FROM mdl_question q
      JOIN mdl_quiz_question_instances qqi ON qqi.question = q.id
      WHERE q.id = 1 AND qqi.quiz = 1
      [array (
      )]
      Error code: dmlreadexception
      Stack trace:
      line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 1014 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1476 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      line 471 of /question/engine/upgrade/upgradelib.php: call to moodle_database->get_record_sql()
      line 507 of /question/engine/upgrade/upgradelib.php: call to question_engine_upgrade_question_loader->load_question()
      line 308 of /question/engine/upgrade/upgradelib.php: call to question_engine_upgrade_question_loader->get_question()
      line 4264 of /backup/moodle2/restore_stepslib.php: call to question_engine_attempt_upgrader->load_question()
      line 345 of /mod/quiz/backup/moodle2/restore_quiz_stepslib.php: call to restore_questions_activity_structure_step->process_legacy_quiz_attempt_data()
      line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_quiz_activity_structure_step->process_quiz_attempt_legacy()
      ...
      ...
      

      It's seems that some ocurrence of the old names is still there.

      Reproduction note: In order to reproduce the error, the attached backup file must be restored skipping the "One Quiz" activity completely (it contains some qtypes not present in 2.7 leading to error, unrelated with this issue).

        1. backup_test-2.0.mbz
          1.14 MB
          Eloy Lafuente (stronk7)

            timhunt Tim Hunt
            stronk7 Eloy Lafuente (stronk7)
            Jean-Michel Vedrine Jean-Michel Vedrine
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.