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

Matching question type does not support wrong-only response

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.9.8, 2.0
    • 2.0.1
    • Lesson
    • MySQL
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Moderate

    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.

      Attachments

        Issue Links

          Activity

            People

              samhemelryk Sam Hemelryk
              mnlipp Michael Lipp
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                25/Dec/10