Moodle
  1. Moodle
  2. MDL-30704

Quiz grades report shows inconsistent averages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.3, 2.2, 2.3
    • Fix Version/s: 2.1.4, 2.2.1
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      1. As teacher, create a quiz
      2. As student 1 attempt it twice
      3. As student 2 attempt it once.
      4. As teacher, go to the quiz grades report.
      5. Verify that the average of the total quiz grades is the average score for all three attempts, like it is for the individual question grades.

      Also test the responses report with various combinations of options, to verify there are no regressions caused by the refactoring.

      Show
      1. As teacher, create a quiz 2. As student 1 attempt it twice 3. As student 2 attempt it once. 4. As teacher, go to the quiz grades report. 5. Verify that the average of the total quiz grades is the average score for all three attempts, like it is for the individual question grades. Also test the responses report with various combinations of options, to verify there are no regressions caused by the refactoring.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      33545

      Description

      1. As teacher, create a quiz
      2. As student 1 attempt it twice
      3. As student 2 attempt it once.
      4. As teacher, go to the quiz grades report.

      Observe that the average for the individual question grades averages all three grades shown, but the overall average only includes two grades (the first/last/best/average - whatever the quiz is set to).

      Since there is an option in this report to only show the first/last/best grade (if more than one attempt is allowed) then the average for the total quiz grade should include all the attempts shown, like it does for the question grades.

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          The first problem needs to be fixed in build_table.

          There is a second problem in load_average_question_grades. If you turn on "Only show / download attempts that are graded for each user ..." then the per-question averages still show the average of 3 marks, not 2.

          Both those places are in mod/quiz/report/overview/overview_table.php

          Show
          Tim Hunt added a comment - The first problem needs to be fixed in build_table. There is a second problem in load_average_question_grades. If you turn on "Only show / download attempts that are graded for each user ..." then the per-question averages still show the average of 3 marks, not 2. Both those places are in mod/quiz/report/overview/overview_table.php
          Hide
          Tim Hunt added a comment -

          Right, I think this patch is the correct implementation.

          However, the quiz reports are very complex and scary, so it would be really helpful if anyone could do some additional testing on these changes before I submit them for integration.

          Also, it would be useful to have some feedback about which branches these changes should go into. On the whole, I think this counts as a bug-fix, and so should go into 2.1, 2.2 and master.

          However, you could argue that this is a change of behaviour, and so should go into master only, or possibly just master and 2.2.

          Show
          Tim Hunt added a comment - Right, I think this patch is the correct implementation. However, the quiz reports are very complex and scary, so it would be really helpful if anyone could do some additional testing on these changes before I submit them for integration. Also, it would be useful to have some feedback about which branches these changes should go into. On the whole, I think this counts as a bug-fix, and so should go into 2.1, 2.2 and master. However, you could argue that this is a change of behaviour, and so should go into master only, or possibly just master and 2.2.
          Hide
          Tim Hunt added a comment -

          This fix has been re-based onto the latest integration branches, and re-tested.

          Ready for integration now. Phil at the OU tested the numbers carefully for me.

          Show
          Tim Hunt added a comment - This fix has been re-based onto the latest integration branches, and re-tested. Ready for integration now. Phil at the OU tested the numbers carefully for me.
          Hide
          Sam Hemelryk added a comment -

          Thanks Tim, this has been integrated now.

          Is there any documentation that needs to be updated Tim, and is this significant enough to include in an upgrade.txt?

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Thanks Tim, this has been integrated now. Is there any documentation that needs to be updated Tim, and is this significant enough to include in an upgrade.txt? Cheers Sam
          Hide
          Michael de Raadt added a comment -

          Test result: Sorry, the numbers did not average correctly for me. I will attach a screenshot of the result.

          Show
          Michael de Raadt added a comment - Test result: Sorry, the numbers did not average correctly for me. I will attach a screenshot of the result.
          Hide
          Tim Hunt added a comment -

          Bum! I forgot to correctly re-scale the total mark. (Your quiz is presumably 3 questions worth 1 mark each, with the final mark rescaled to be out of 10.) We tend not to set up quizzes like that at the OU, which is how we missed this.

          I will do a new commit to fix it.

          Show
          Tim Hunt added a comment - Bum! I forgot to correctly re-scale the total mark. (Your quiz is presumably 3 questions worth 1 mark each, with the final mark rescaled to be out of 10.) We tend not to set up quizzes like that at the OU, which is how we missed this. I will do a new commit to fix it.
          Hide
          Tim Hunt added a comment -

          Eloy, please cherry-pick this fix-up: https://github.com/timhunt/moodle/compare/master...MDL-30704_fixup onto all three branches.

          Show
          Tim Hunt added a comment - Eloy, please cherry-pick this fix-up: https://github.com/timhunt/moodle/compare/master...MDL-30704_fixup onto all three branches.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Extra commit added to 21, 22 and master, so re-integrated. Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Extra commit added to 21, 22 and master, so re-integrated. Thanks!
          Hide
          Sam Hemelryk added a comment -

          Removing Michael as tester as he is away today, I'll ask someone at HQ to test this today.

          Show
          Sam Hemelryk added a comment - Removing Michael as tester as he is away today, I'll ask someone at HQ to test this today.
          Hide
          Adrian Greeve added a comment -

          Figures are correct and I can't see any regressions. Test passed.
          Thanks.

          Show
          Adrian Greeve added a comment - Figures are correct and I can't see any regressions. Test passed. Thanks.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Whoever decided one week was worth 14 days had really one bad idea. Anyway, the nightmare is over, so thanks for your, once again, amazing contributions. Many, many thanks!

          Now... disconnect, relax and enjoy the next days, yay!

          Closing...ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Whoever decided one week was worth 14 days had really one bad idea. Anyway, the nightmare is over, so thanks for your, once again, amazing contributions. Many, many thanks! Now... disconnect, relax and enjoy the next days, yay! Closing...ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: