Moodle
  1. Moodle
  2. MDL-23858

Percentage is not calculating correctly when "Show totals excluding hidden items" is selected

    Details

    • Rank:
      157

      Description

      We have a site having the following issues with the gradebook:

      We are looking to calculate categories and totals that contain hidden items. Our default is currently to hide totals that contain hidden items. When we select "Show totals excluding hidden items" we run into calculation errors.

      The attached image is a screen shot of a test student's grades from the student's view.

      In the second category titled, "Homework", we have five grade items. All worth 10 points each. The fifth item is hidden and students have no grades for the grade item. The student has accumulated 27 points so far out of 40. However, the category total is still displaying the range out of 50 and is calculating the 27 out of 50 to get a category percent of 54%. With the grade item hidden, the category should show the range out of 40 and the percentage 67.5% (27/40).

      In addition, once choosing "Show totals excluding hidden items" in the gradebook settings, the course total is now being weighted instead of being the sum of grades like it says in the Categories and items page. The course total should have a range of 0-340 and should add the 257 from the "Test" category and the 27 from the "Homework" category to get a total of 284. 284 points out of 340 equals a 83.5% course total. Instead it is taking the 85.67% earned in "Tests" category and the 54% earned in "Homework" category, adding them together to get 139.67 and then dividing by 2 to get 69.83%. This means that it is weighting each category evenly. However, it should not be weighting at all because sum of grades is selected.

      To conclude, when we selected "Show totals excluding hidden items", it is not excluding the hidden items from the totals and it is weighting categories instead of sum of grades.

        Issue Links

          Activity

          Hide
          Andrew Davis added a comment -

          Hi Kathryn. The category range is determined by the category minimum and maximum settings in the category configuration. These, and thus the range, are manually set and do not go up and down depending on what is visible or hidden. The homework category will always be out of 50 as your min grade is presumably 0 and your max grade is 50.

          When you hide items rather than the category maximum grade coming down the grade is scaled up. In your example if there is only 40 marks worth of homework available due to hiding, to scale the grade up to a maximum grade of 50 the mark of 27/40 is multiplied by 1.25 to get 33.75/50.

          However, this scaling up isn't happening for you. This is most likely because of another category setting. "Aggregate only non-empty grades". If this is NOT turned on empty grades will be included meaning hidden and non-submitted activities will be counted as 0's. With that not checked and homework 5 hidden the effective homework marks for Anna are as below:

          homework 1: 9/10
          homework 2: 9/10
          homework 3: 6/10
          homework 4: 3/10
          homework 5: 0/10
          total: 27/50

          With a category max of 50 and the students score already being out of 50 no scaling of the grade needs to be done. Can you check that "aggregate only non-empty grades" is ticked in your homework category?

          Show
          Andrew Davis added a comment - Hi Kathryn. The category range is determined by the category minimum and maximum settings in the category configuration. These, and thus the range, are manually set and do not go up and down depending on what is visible or hidden. The homework category will always be out of 50 as your min grade is presumably 0 and your max grade is 50. When you hide items rather than the category maximum grade coming down the grade is scaled up. In your example if there is only 40 marks worth of homework available due to hiding, to scale the grade up to a maximum grade of 50 the mark of 27/40 is multiplied by 1.25 to get 33.75/50. However, this scaling up isn't happening for you. This is most likely because of another category setting. "Aggregate only non-empty grades". If this is NOT turned on empty grades will be included meaning hidden and non-submitted activities will be counted as 0's. With that not checked and homework 5 hidden the effective homework marks for Anna are as below: homework 1: 9/10 homework 2: 9/10 homework 3: 6/10 homework 4: 3/10 homework 5: 0/10 total: 27/50 With a category max of 50 and the students score already being out of 50 no scaling of the grade needs to be done. Can you check that "aggregate only non-empty grades" is ticked in your homework category?
          Hide
          Kathryn Fortin added a comment -

          Is there an update on this issue? We have a couple sites inquiring about this problem.

          Thank you, K.

          Show
          Kathryn Fortin added a comment - Is there an update on this issue? We have a couple sites inquiring about this problem. Thank you, K.
          Hide
          Martin Soupcoff added a comment - - edited

          See new attachment for visual explanation. Example of gradebook with Aggregate only non-empty grades enabled for both categories. First category is set to Simple weighted mean of grades. Second category set to Weighted mean of grades. Both categories have two grade items. Each worth 100 points. With it only aggregating only empty grades, students who did not turn in/receieve a grade for the assignment would benefit from having the empty cell. It takes the grades that they do have and scales it to the category total (200). Only the first user has grades for all grade items.

          @Andrew - You are correct about the Aggregate only non-empty grades not being selected but that is a tricky and potentially a dangerous setting to use. If a teacher has the Aggregate only non-empty grades enabled, then students who did not receive a grade for the grade item would benefit as their grade would be scaled to the category total. This may be separate issue than the exclude hidden items but it is the same reasoning; the scaling effect to the category total.

          Show
          Martin Soupcoff added a comment - - edited See new attachment for visual explanation. Example of gradebook with Aggregate only non-empty grades enabled for both categories. First category is set to Simple weighted mean of grades. Second category set to Weighted mean of grades. Both categories have two grade items. Each worth 100 points. With it only aggregating only empty grades, students who did not turn in/receieve a grade for the assignment would benefit from having the empty cell. It takes the grades that they do have and scales it to the category total (200). Only the first user has grades for all grade items. @Andrew - You are correct about the Aggregate only non-empty grades not being selected but that is a tricky and potentially a dangerous setting to use. If a teacher has the Aggregate only non-empty grades enabled, then students who did not receive a grade for the grade item would benefit as their grade would be scaled to the category total. This may be separate issue than the exclude hidden items but it is the same reasoning; the scaling effect to the category total.
          Hide
          Michael Blake added a comment -

          This issue is reported as causing problems on a MP site. Please give it priority.

          Show
          Michael Blake added a comment - This issue is reported as causing problems on a MP site. Please give it priority.
          Hide
          Andrew Davis added a comment -

          Martin, I agree that turning on "aggregate only non-empty grades" produces some odd results if you have students missing grades. I'm not sure what to recommend here...

          This seems a suitable time to point out the ongoing reworking of gradebook to try and correct these kinds of scenarios. http://docs.moodle.org/dev/Gradebook_2.x_architecture
          However that is a huge task that isn't going to be completed any time soon and its incredibly unlikely that we will attempt to back port it to 1.9.

          I see two options in the short term.

          1) Turn on "aggregate only non-empty grades". That will lead to an odd situation where students don't complete all assessments.

          2) Leave "aggregate only non-empty grades" off, hide the grade items that you want hidden then manually adjust the category maximum grade down by subtracting the hidden item maximum grade from the category total. Then when you unhide the grade item you need to put up the category total by adding the previously hidden item's maximum grade.

          Neither of those is really ideal but hopefully that's workable.

          Show
          Andrew Davis added a comment - Martin, I agree that turning on "aggregate only non-empty grades" produces some odd results if you have students missing grades. I'm not sure what to recommend here... This seems a suitable time to point out the ongoing reworking of gradebook to try and correct these kinds of scenarios. http://docs.moodle.org/dev/Gradebook_2.x_architecture However that is a huge task that isn't going to be completed any time soon and its incredibly unlikely that we will attempt to back port it to 1.9. I see two options in the short term. 1) Turn on "aggregate only non-empty grades". That will lead to an odd situation where students don't complete all assessments. 2) Leave "aggregate only non-empty grades" off, hide the grade items that you want hidden then manually adjust the category maximum grade down by subtracting the hidden item maximum grade from the category total. Then when you unhide the grade item you need to put up the category total by adding the previously hidden item's maximum grade. Neither of those is really ideal but hopefully that's workable.
          Hide
          Andrew Davis added a comment -

          I'm not sure Im able to take this issue much further without undertaking major development. See MDL-11837 for previous steps that have been made in that direction.

          I'm now seeking guidance from others at HQ what should be done to get this resolved.

          Show
          Andrew Davis added a comment - I'm not sure Im able to take this issue much further without undertaking major development. See MDL-11837 for previous steps that have been made in that direction. I'm now seeking guidance from others at HQ what should be done to get this resolved.
          Hide
          Michael de Raadt added a comment -

          It looks like resolving this task will require more effort than a trivial bug-fix.

          In order to resolve this problem new database tables will need to be created and there is a need for an overhaul of the Gradebook UI, which is on the cards already.

          I'm recommending that we shift this task to the DEV backlog to reflect the nature of the work that will be involved. Under that guise, it is not likely to get immediate attention while higher priority tasks are being worked on.

          Show
          Michael de Raadt added a comment - It looks like resolving this task will require more effort than a trivial bug-fix. In order to resolve this problem new database tables will need to be created and there is a need for an overhaul of the Gradebook UI, which is on the cards already. I'm recommending that we shift this task to the DEV backlog to reflect the nature of the work that will be involved. Under that guise, it is not likely to get immediate attention while higher priority tasks are being worked on.
          Hide
          Andrew Davis added a comment -

          I'm shifting both this issue and MDL-11837 into the dev backlog so a development project to get this resolved properly can be undertaken.

          Show
          Andrew Davis added a comment - I'm shifting both this issue and MDL-11837 into the dev backlog so a development project to get this resolved properly can be undertaken.
          Hide
          Andrew Davis added a comment -

          This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.

          For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

          Show
          Andrew Davis added a comment - This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

            People

            • Votes:
              12 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated: