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

Restore issues with Multiple Choice Questions that don't have order & responses defined

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Backup
    • Labels:
      None
    • Environment:
      Linux,PSQL,2.0 RC1 (Build: 20101101)
    • Database:
      Any
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      My Multiple Choice questions aren't restoring in Moodle 2 from a backup on another instance. This is a dump of the question state :-

      stdClass Object ( [id] => 21 [question] => 466 [seq_number] => 0 [answer] => 227,228,229,230: [timestamp] => 1288650050 [event] => 0 [grade] => 0.0000000 [raw_grade] => 0.0000000 [penalty] => 0.0000000 [attempt] => 11 )

      The colon makes an empty array which is tried to be processed and fails to restore the blank responses when the ordering should be blank and responses those values.

      Debug info: ERROR: invalid input syntax for integer: ""
      SELECT * FROM mdl_backup_ids_temp WHERE backupid = $1 AND itemname = $2 AND itemid = $3
      [array (
      0 => 'a12dd3b18646aa6860dda58caf1c6adc',
      1 => 'question_answer',
      2 => '',
      )]
      Stack trace:
      line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 229 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 669 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 1243 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
      line 1215 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
      line 1195 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 1260 of /backup/util/dbops/restore_dbops.class.php: call to moodle_database->get_record()
      line 185 of /backup/util/plan/restore_structure_step.class.php: call to restore_dbops::get_backup_ids_record()
      line 177 of /backup/util/plan/restore_structure_step.class.php: call to restore_structure_step->get_mapping()
      line 127 of /backup/moodle2/restore_plugin.class.php: call to restore_structure_step->get_mappingid()
      line 111 of /question/type/multichoice/backup/moodle2/restore_qtype_multichoice_plugin.class.php: call to restore_plugin->get_mappingid()
      line 2410 of /backup/moodle2/restore_stepslib.php: call to restore_qtype_multichoice_plugin->recode_state_answer()
      line 2340 of /backup/moodle2/restore_stepslib.php: call to restore_questions_activity_structure_step->restore_recode_answer()
      line 119 of /backup/util/plan/restore_structure_step.class.php: call to restore_questions_activity_structure_step->process_question_state()

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10