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

Error restoring question matchs. Could not recode answer


    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.6.9, 1.7.7, 1.8.8, 1.9.4
    • 1.9, 1.9.1, 1.9.2, 1.9.3
    • Questions
    • None
    • Any
    • Easy

      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

            timhunt Tim Hunt
            colchambers Colin Chambers
            1 Vote for this issue
            2 Start watching this issue


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