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

PHP notices if a matching or mutichoice question is edited after it has been attempted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.8.7, 2.9.1
    • 2.7.5
    • Questions
    • MOODLE_27_STABLE
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • Hide

      Match subquestions

      1. Create a matching question Dog -> Puppy, Cat -> Kitten, Pony -> Foal, Frog -> Tadpole.
      2. Preview the question in the question bank using Deferred feedback, and make sure all the display options are turned on.
      3. Answer all parts of the question and click Submit all and finish.
      4. Leave the question preview window open.
      5. In the question bank, edit the question, and remove the Frog -> Tadpole pair of options.
      6. Reload the question preview window. Verify that the missing part of the question displays as "This part of the question was deleted after the attempt was started."

      Match choices

      1. Create a matching question Dog -> Puppy, Cat -> Kitten, Pony -> Foal, [BLANK] -> Tadpole.
      2. Preview the question in the question bank using Deferred feedback, and make sure all the display options are turned on.
      3. Answer all parts of the question, selecting Tadpole in at least one place and click Submit all and finish.
      4. Leave the question preview window open.
      5. In the question bank, edit the question, and remove the [BLANK] -> Tadpole pair of options.
      6. Reload the question preview window. Verify that the missing part of the question displays as "[Deleted choice]"

      Multiple choice

      1. Create a multliple choice question with choices Dog, Cat, Pony.
      2. Preview the question in the question bank using Deferred feedback, and make sure all the display options are turned on.
      3. Put in an answer and click Submit all and finish.
      4. Leave the question preview window open.
      5. In the question bank, edit the question, and remove the Pony choice.
      6. Reload the question preview window. Verify that the missing part of the question displays as "This choice was deleted after the attempt was started."

      Note: there is no point testing what happens if you delete a matching question choice other than the last one. That would work in a very strange way due to MDL-5560, which is a separate issue.

      Show
      Match subquestions Create a matching question Dog -> Puppy, Cat -> Kitten, Pony -> Foal, Frog -> Tadpole. Preview the question in the question bank using Deferred feedback, and make sure all the display options are turned on. Answer all parts of the question and click Submit all and finish. Leave the question preview window open. In the question bank, edit the question, and remove the Frog -> Tadpole pair of options. Reload the question preview window. Verify that the missing part of the question displays as "This part of the question was deleted after the attempt was started." Match choices Create a matching question Dog -> Puppy, Cat -> Kitten, Pony -> Foal, [BLANK] -> Tadpole. Preview the question in the question bank using Deferred feedback, and make sure all the display options are turned on. Answer all parts of the question, selecting Tadpole in at least one place and click Submit all and finish. Leave the question preview window open. In the question bank, edit the question, and remove the [BLANK] -> Tadpole pair of options. Reload the question preview window. Verify that the missing part of the question displays as " [Deleted choice] " Multiple choice Create a multliple choice question with choices Dog, Cat, Pony. Preview the question in the question bank using Deferred feedback, and make sure all the display options are turned on. Put in an answer and click Submit all and finish. Leave the question preview window open. In the question bank, edit the question, and remove the Pony choice. Reload the question preview window. Verify that the missing part of the question displays as "This choice was deleted after the attempt was started." Note: there is no point testing what happens if you delete a matching question choice other than the last one. That would work in a very strange way due to MDL-5560 , which is a separate issue.

      Steps to reproduce:

      1. Create a quiz.
      2. Add a matching question with three subquestions Dog -> puppy, Cat -> kitten, Pony -> foal.
      3. Attempt the quiz as a student.
      4. At teacher, edit the question, and delete the Dog -> puppy subquestion.
      5. Review the student's attempt.

      Desired result: The teacher was shot before they did something silly like that.

      Expected result: the question is displayed with something like "Deleted sub-question" in place of the missing thing. (A bit like how multichoice handles it.)

      Actual result: PHP Notice: Undefined offset: 125938 in /vle/www_root/question/type/match/renderer.php on line 127

            timhunt Tim Hunt
            timhunt Tim Hunt
            Mahmoud Kassaei Mahmoud Kassaei
            Dan Poltawski Dan Poltawski
            Ankit Agarwal Ankit Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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