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

Error restoring question matchs. Could not recode answer

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9, 1.9.1, 1.9.2, 1.9.3
    • 1.6.9, 1.7.7, 1.8.8, 1.9.4
    • Questions
    • None
    • Any
    • MOODLE_19_STABLE
    • MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • Easy

    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

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              colchambers Colin Chambers
              Safat Shahin, 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:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                28/Jan/09