Moodle
  1. Moodle
  2. MDL-11837

Add option to conditionally aggregate hidden grades

    Details

    • Rank:
      1331

      Description

      The hidden grades are now always aggregated together with all other grades. The problem is that users might calculate the value of hidden grades from the totals.
      There is a workaround in 1.9, it should be fixed properly in 2.0 (needs db changes)

      1/ add field aggregatehidden into grade_items
      2/ add field unhideafter into grade_items and grade_grades
      3/ add hiding switching logic into regrading
      4/ tweak forms and patch the hiding logic

        Issue Links

          Activity

          Hide
          Andrew Davis added a comment -

          I believe this was dealt with some time again although I'm not able to track down the specific issue the changes were committed against.

          Show
          Andrew Davis added a comment - I believe this was dealt with some time again although I'm not able to track down the specific issue the changes were committed against.
          Hide
          Petr Škoda added a comment -

          this was not fixed, it is still as broken as in 1.9, sorry

          Show
          Petr Škoda added a comment - this was not fixed, it is still as broken as in 1.9, sorry
          Hide
          Elena Ivanova added a comment -

          Hi, I just want to make sure - will this fix for 2.0. still be "conditional"?
          In 1.9.8 we can choose either to include or exclude hidden grades.
          Settings > User report > Show Totals Including vs Excluding hidden items.

          Show
          Elena Ivanova added a comment - Hi, I just want to make sure - will this fix for 2.0. still be "conditional"? In 1.9.8 we can choose either to include or exclude hidden grades. Settings > User report > Show Totals Including vs Excluding hidden items.
          Hide
          Petr Škoda added a comment -

          I suppose there will not be any fix for 2.0.x because real solution would probably require relatively big internal changes including DB structure changes, code logic, new module integration, etc.

          Show
          Petr Škoda added a comment - I suppose there will not be any fix for 2.0.x because real solution would probably require relatively big internal changes including DB structure changes, code logic, new module integration, etc.
          Hide
          Andrew Davis added a comment -

          Hi Elena. Yes, the behavior in 2.0 is the same as in 1.9. You can choose to either hide totals containing hidden items, show totals containing hidden items (excluding hidden items) or or show totals containing hidden items (including hidden items).

          Petr, I'm not sure what you're talking about.

          Show
          Andrew Davis added a comment - Hi Elena. Yes, the behavior in 2.0 is the same as in 1.9. You can choose to either hide totals containing hidden items, show totals containing hidden items (excluding hidden items) or or show totals containing hidden items (including hidden items). Petr, I'm not sure what you're talking about.
          Hide
          Petr Škoda added a comment -

          Read the linked issues and code if you want to know why is the current hiding implementation horrible hack. I implemented it as a temporary workaround after the DB freeze in 1.9dev, it solved one problem for OU specific workflow but it created many other problems. It was a wrong decision and I was sorry for that.

          Show
          Petr Škoda added a comment - Read the linked issues and code if you want to know why is the current hiding implementation horrible hack. I implemented it as a temporary workaround after the DB freeze in 1.9dev, it solved one problem for OU specific workflow but it created many other problems. It was a wrong decision and I was sorry for that.
          Hide
          Elena Ivanova added a comment -

          I do not know what programming magic is going on there, but I can confirm that something is indeed wrong for the SUM in some scenarios.
          I believe SWM and WM are ok.

          SUM does not like having hidden items anymore if you:
          a) set User report to Show Totals Excluding Hidden Items (previous functionality was to include them always)
          b) Maximum Grades for your gradable items are different. If they are the same, you should be fine, as far as I can tell.

          I understand that the gradebook tries to do some silent conversion of the total because of that, but I cannot figure out any logic in calculation to point to the exact error.

          Scenario: Add two items with differentmaximum grade to a category with SUM
          A1 - out of 100 points, A2 out of 50 points. Hide A2. Our category total is 150 points.
          Give 100 points to a student for A1.

          User report will show 75.00 (50.00 %)
          Grader report will be OK, showing 100.00 (66.67 %)

          To "fix" temporarily:

          • Switch to SWM, or
          • Set User Report to "Include Hidden items" into the total. Kinda defeats the purpose, but if you do not show percentages to your students, they would not care at all.
          Show
          Elena Ivanova added a comment - I do not know what programming magic is going on there, but I can confirm that something is indeed wrong for the SUM in some scenarios. I believe SWM and WM are ok. SUM does not like having hidden items anymore if you: a) set User report to Show Totals Excluding Hidden Items (previous functionality was to include them always) b) Maximum Grades for your gradable items are different. If they are the same, you should be fine, as far as I can tell. I understand that the gradebook tries to do some silent conversion of the total because of that, but I cannot figure out any logic in calculation to point to the exact error. Scenario: Add two items with differentmaximum grade to a category with SUM A1 - out of 100 points, A2 out of 50 points. Hide A2. Our category total is 150 points. Give 100 points to a student for A1. User report will show 75.00 (50.00 %) Grader report will be OK, showing 100.00 (66.67 %) To "fix" temporarily: Switch to SWM, or Set User Report to "Include Hidden items" into the total. Kinda defeats the purpose, but if you do not show percentages to your students, they would not care at all.
          Hide
          Kathryn Fortin added a comment -

          Will this be fixed in 1.9? We have a few clients on Moodle having problems with this.

          Show
          Kathryn Fortin added a comment - Will this be fixed in 1.9? We have a few clients on Moodle having problems with this.
          Hide
          Petr Škoda added a comment -

          I am afraid this can not be fixed in 1.9.x or even 2.0.x because it would require internal database changes and significant code changes too.

          Show
          Petr Škoda added a comment - I am afraid this can not be fixed in 1.9.x or even 2.0.x because it would require internal database changes and significant code changes too.
          Hide
          Andrew Davis added a comment -

          Possibly need to add a aggregatehidden item to grade_item and maybe grade_grade as well. This indicates whether the grade item should be hidden and excluded from calculations or hidden but still included in calculations. Note sure how this would work with our category setting that specifies the handling of hidden grade items.

          Show
          Andrew Davis added a comment - Possibly need to add a aggregatehidden item to grade_item and maybe grade_grade as well. This indicates whether the grade item should be hidden and excluded from calculations or hidden but still included in calculations. Note sure how this would work with our category setting that specifies the handling of hidden grade items.
          Hide
          Andrew Davis added a comment -

          Its not committed yet but Im adding some new gradebook tests. Some of them in /lib/grade/simpletest/testgradecategory.php are likely to be commented out until this issue is resolved. Search for this issue number (MDL-11837) in the code to find them.

          Show
          Andrew Davis added a comment - Its not committed yet but Im adding some new gradebook tests. Some of them in /lib/grade/simpletest/testgradecategory.php are likely to be commented out until this issue is resolved. Search for this issue number ( MDL-11837 ) in the code to find them.
          Hide
          Andrew Davis added a comment -

          Vastly faster unit tests committed as part of another item. When hidden grades as revisited the relevant unit tests in /lib/grade/simpletest/testgradecategory.php need to be reviewed.

          Show
          Andrew Davis added a comment - Vastly faster unit tests committed as part of another item. When hidden grades as revisited the relevant unit tests in /lib/grade/simpletest/testgradecategory.php need to be reviewed.
          Hide
          Rod Spears added a comment -

          We encountered a problem today that is related to this. A formula was being used to calculate the grade for all categories in the course, including the course total. One category contained a hidden item. When we changed the course setting to from "Hide" to "Show totals EXCLUDING hidden items", Moodle would display a total grade of 100% for that category and a grade of 100% for the course. When the category or the category total grade item was locked, the grade displayed in the user report was closer but still not accurate. When the grade was unlocked it reverted back to 100%. The grader report was not affected - just the user report. When we changed the course setting to "Show totals including hidden items" the user report and grader report displayed the same grade. This setting is not perfect, but acceptable in this situation.

          Why did locking the grade display these results. The version is 1.9.9+

          Show
          Rod Spears added a comment - We encountered a problem today that is related to this. A formula was being used to calculate the grade for all categories in the course, including the course total. One category contained a hidden item. When we changed the course setting to from "Hide" to "Show totals EXCLUDING hidden items", Moodle would display a total grade of 100% for that category and a grade of 100% for the course. When the category or the category total grade item was locked, the grade displayed in the user report was closer but still not accurate. When the grade was unlocked it reverted back to 100%. The grader report was not affected - just the user report. When we changed the course setting to "Show totals including hidden items" the user report and grader report displayed the same grade. This setting is not perfect, but acceptable in this situation. Why did locking the grade display these results. The version is 1.9.9+
          Hide
          Andrew Davis added a comment -

          I'm shifting this into the dev backlog. Looks like it got left behind in 2.1.2

          Show
          Andrew Davis added a comment - I'm shifting this into the dev backlog. Looks like it got left behind in 2.1.2

            People

            • Votes:
              38 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

              • Created:
                Updated: