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

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.6, 2.4, 2.5
    • 2.3.7, 2.4.4
    • Lesson
    • None
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • 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."

    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

              rwijaya Rossiani Wijaya
              rezeau Joseph Rézeau
              Ankit Agarwal Ankit Agarwal
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Sam Hemelryk Sam Hemelryk
              Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/May/13