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

Matching question type does not support wrong-only response

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.9.8, 2.0
    • Fix Version/s: 2.0.1
    • Component/s: Lesson
    • Labels:
    • Database:
      MySQL
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      If you create a matching question and provide responses for both correct and wrong answers, everything works as expected.

      If you provide a response only for wrong answers, this response (that may e.g. give hints how to correct the answers) is unexpectedly shown when the question is answered correctly.

      The reason is the way responses are extracted from the answers list in continue.php. Although the first two entries are (according to the comment) reserved for the right and wrong answer, they are not simply used for the responses. Instead, there is a search for the first and the second entry in $answers where $answer->response is NULL and $answer->answer ist not NULL. The matching_answer->answer is used as response. Therefore, if you enter only one response in the form, this automatically becomes the response for the "correct" case, even if entered as response for the "wrong" case.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Dec/10