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

Match question throws PHP error if one or more options have not been selected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.6, 2.4, 2.5
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Lesson
    • Labels:
      None
    • Testing Instructions:
      Hide
      1. Create lesson activity
      2. Add matching question
      3. Preview the question
      4. Do not answer any question.
      5. Click submit
      6. Make sure there's no error display and the following message is displayed "One or more questions have no answer given. Please go back and submit an answer."
      Show
      Create lesson activity Add matching question Preview the question Do not answer any question. Click submit Make sure there's no error display and the following message is displayed "One or more questions have no answer given. Please go back and submit an answer."
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      In Moodle 2, with debug mode ON, a Match question throws PHP error if one or more options have not been selected:
      Notice: Undefined index: in moodle\mod\lesson\pagetypes\matching.php on line 188

      Plus: if NO options selected at all, the "No answer given. Please go back and submit an answer." never gets displayed.

      I will submit an easy fix on my github.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/May/13