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

Quiz statistics: error if a random question has zero max mark in a quiz

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-77626_401
    • Hide

      If it was me, I would say that the new unit test case is sufficent. If you really want to test manually, then you need to follow the steps to reproduce:

      1. As teacher, in a test course.
      2. Create category in the quetion bank called 'Variants of Q1'.
      3. In that category, create 2 different true-false questions.
      4. Create a quiz.
      5. On the 'Questions' page where you build the quiz, Add a Random question, picking from the 'Variants of Q1'
      6. Set the maximium mark for this random question to be 0.
      7. Then, add a second question to the quiz. This should be a new question, which can also be true-false.
      8. Now, you need to log in with a number of different student accounts.
      9. With each student, attempt the quiz, and answer all the questions. Try to get a mixture of right and wrong answers.
      10. You need to keep making quiz attempts with different students until for each of the two possible questions that can be selected randomly as Q1 of the quiz, two different students have seen each question.
      11. Then, log in again as teacher.
      12. Go to Quiz -> Results -> Statistics.
      13. Verify there is no Divide by zero error.
      Show
      If it was me, I would say that the new unit test case is sufficent. If you really want to test manually, then you need to follow the steps to reproduce: As teacher, in a test course. Create category in the quetion bank called 'Variants of Q1'. In that category, create 2 different true-false questions. Create a quiz. On the 'Questions' page where you build the quiz, Add a Random question, picking from the 'Variants of Q1' Set the maximium mark for this random question to be 0. Then, add a second question to the quiz. This should be a new question, which can also be true-false. Now, you need to log in with a number of different student accounts. With each student, attempt the quiz, and answer all the questions. Try to get a mixture of right and wrong answers. You need to keep making quiz attempts with different students until for each of the two possible questions that can be selected randomly as Q1 of the quiz, two different students have seen each question. Then, log in again as teacher. Go to Quiz -> Results -> Statistics. Verify there is no Divide by zero error.

      Steps to reproduce:

      1. As teacher, in a test course.
      2. Create category in the quetion bank called 'Variants of Q1'.
      3. In that category, create 2 different true-false questions.
      4. Create a quiz.
      5. On the 'Questions' page where you build the quiz, Add a Random question, picking from the 'Variants of Q1'
      6. Then, add a second question to the quiz. This should be a new question, which can also be true-false.
      7. Now, you need to log in with a number of different student accounts.
      8. With each student, attempt the quiz, and answer all the questions. Try to get a mixture of right and wrong answers.
      9. You need to keep making quiz attempts with different students until for each of the two possible questions that can be selected randomly as Q1 of the quiz, two different students have seen each question.
      10. Then, log in again as teacher.
      11. Go to Quiz -> Results -> Statistics.
      12. Verify that the report displayes. For Q1, there should be a row saying something like '
        Range of statistics for these questions' with some sensible numbers in the Standard deviation column.
      13. Now go to the Quiz -> Questions page.
      14. Set the Mark for Q1 to 0.
      15. Go back to Quiz -> Results -> Statistics.
      16. (If necessary, click 'Recalculate'.)

      Expected result: the resport displays without errors. Stats for Q1 will probably now display a lot of '-' or similar.

      Actual result: Fatal error: Divide by Zero.

      • line 118 of /question/classes/statistics/questions/calculated_question_summary.php: DivisionByZeroError thrown
      • line 84 of /question/classes/statistics/questions/calculated_question_summary.php: call to core_question\\statistics\\questions
        calculated_question_summary->get_min_max_of_sd()
      • line 342 of /mod/quiz/report/statistics/statistics_table.php: call to core_question\\statistics\\questions
        calculated_question_summary->get_min_max_of()
      • line 832 of /lib/tablelib.php: call to quiz_statistics_table->col_sd()
      • line 477 of /mod/quiz/report/statistics/report.php: call to flexible_table->format_row()
      • line 275 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report->output_quiz_structure_analysis_table()
      • line 97 of /mod/quiz/report.php: call to quiz_statistics_report->display()

        1. 400.gif
          400.gif
          1.35 MB
        2. 401.gif
          401.gif
          2.01 MB
        3. master.gif
          master.gif
          1.58 MB

            timhunt Tim Hunt
            timhunt Tim Hunt
            Anupama Sarjoshi Anupama Sarjoshi
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 8 minutes
                3h 8m

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