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

Error restoring question matchs. Could not recode answer

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9, 1.9.1, 1.9.2, 1.9.3
    • Fix Version/s: 1.6.9, 1.7.7, 1.8.8, 1.9.4
    • Component/s: Questions
    • Labels:
      None
    • Database:
      Any
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      I have fixed this issue in our moodle install so thought I'd post it here.

      getting error 'Could not recode answer in question_match_sub' in file question/type/match/questiontype.php method restore_recode_answer. The issue is that the $match_answer_id that's being used actually refers to the 'code' field in the 'question_match_sub' table. I added a line to get the correct id using the code value and assigned it to match_answer_id.

      There were also some other non fatal errors that I fixed. Just related to the variable $match_ans not being instantiated when called.

      I also found in the backup method of the match questiontype that the details of the 'question_match' table aren't written to the backup file at all. Instead
      details from 'question_match_sub' are added as 'MATCH' items when in fact they should be 'MATCH_SUB'.

      If we just corrected the name we'd break from the standard moodle backup api that has this bug in it. So for now I just added the details in the element
      'MATCH_DEFINITIONS' for want of a better name.

      The bug is important because it may make a backup fail if it includes a match questiontype

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    28/Jan/09