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

Quiz statistics fail after changing matching question

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.8.9, 2.9.3
    • 2.9.1
    • Questions
    • MOODLE_29_STABLE
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • 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.

      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.

            timhunt Tim Hunt
            mgauk Martin Gauk
            Jun Pataleta Jun Pataleta
            David Monllaó David Monllaó
            Simey Lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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