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

Quiz statistics fail after changing matching question

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.1
    • Fix Version/s: 2.8.9, 2.9.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a new quiz.
      2. Add a matching question A -> a, B -> b, C -> c, D -> d
      3. Add a second matching question 1 -> i, 2 -> ii, 3 -> iii, 4 -> iv
      4. Attempt the quiz as a student and get both questions right.
      5. Attempt the quiz as a second student and answer A -> c, B -> b, C -> a, D -> d for the first question, and any answer you like for the second question.
      6. As teacher/admin, go to Results -> statistics in the Quiz administration.
      7. Click on the name of the matching question, and check the Response analysis table contains the right counts.
      8. Go to the Edit quiz page. Edit the question, and delete the subquestion C -> c. (Note, this is a really bad thing to do to a question in a quiz that has been attempted. Never do this for real.)
      9. Edit the second question and add an extra choice 5 -> v.
      10. Go back to quiz statistics.
      11. Click the recalculate now button.
      12. Check that the response analysis shows some numbers, however meaningless, without any fatal errors or warnings or notices.
      Show
      Create a new quiz. Add a matching question A -> a, B -> b, C -> c, D -> d Add a second matching question 1 -> i, 2 -> ii, 3 -> iii, 4 -> iv Attempt the quiz as a student and get both questions right. Attempt the quiz as a second student and answer A -> c, B -> b, C -> a, D -> d for the first question, and any answer you like for the second question. As teacher/admin, go to Results -> statistics in the Quiz administration. Click on the name of the matching question, and check the Response analysis table contains the right counts. Go to the Edit quiz page. Edit the question, and delete the subquestion C -> c. (Note, this is a really bad thing to do to a question in a quiz that has been attempted. Never do this for real.) Edit the second question and add an extra choice 5 -> v. Go back to quiz statistics. Click the recalculate now button. Check that the response analysis shows some numbers, however meaningless, without any fatal errors or warnings or notices.
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      1. create a quiz
      2. add a matching question with 3 questions and 4 answers
      3. attempt the quiz as a student
      4. delete the third question text
      5. go to Results -> Statistics

      The calculation of the statistics will stop with the following error:

      Notice: Undefined offset: 21115 in question/classes/statistics/responses/analysis_for_question.php on line 131
      Fatal error: Call to a member function count_response() on a non-object in question/classes/statistics/responses/analysis_for_question.php on line 189

      get_possible_responses from the matching question returns two subquestions after removing the third question. The problem is classify_response still returns the classification for the removed subquestion.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              mgauk Martin Gauk
              Peer reviewer:
              Jun Pataleta
              Integrator:
              David Monllaó
              Tester:
              Simey Lameze
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Nov/15