Sum of grades has wrong total if items are hidden?

Sum of grades has wrong total if items are hidden?

by Malcolm Abel -
Number of replies: 10
I do Moodle support at a university and some time ago noticed that when using the Sum of grades, if an item was hidden the total was no longer the sum of either the items left visible or all items. To avoid this items can be removed or put in a category instead of being hidden.

So I've tested this in Moodle 2.3 (as well as 2.1 and 2.0) and found that if you are using the Sum of grades and hide an item the total shown is no longer the sum.

In the example screenshot the total for Range is 100, When an item is hidden I would expect the total in this example to show 70 but it's still 100.

The sum of the student marks is 49 so when the item worth 15 is hidden this should be 34 but is showing 36.88 - which is the number you get if you change the Aggregation to Mean of grades.

Doesn't matter how the item is hidden, what the item is or how the marks are entered or what other settings I've tested.

I reported this in the tracker assuming it was a bug, but some other opinions would be appreciated. Am I missing something?

http://tracker.moodle.org/browse/MDL-35984

Thanks

Mal.

Attachment Grades_Sum_User_report.jpg
In reply to Malcolm Abel

Re: Sum of grades has wrong total if items are hidden?

by Paula Clough -

Malcolm,

Have you tried the Course grade settings? Located in the Settings block when you are in the gradebook.  This will allow you to tell the system whether to show hidden items and whether to add them into the total.  There is a section for the User Report which is the one you are using above.  Changes may also need to be made to the Overview report so that the student can see their grade there.  I am using 2.2.


I hope that helps.  I just getting familiar with some of the features of this gradebook.

Paula Clough cool

Attachment course grade settings.png
In reply to Paula Clough

Re: Sum of grades has wrong total if items are hidden?

by Malcolm Abel -
Hi Paula,

Thanks, yes that setting shows or hides the totals, what I've found is that the total which is shown if hidden items are excluded is wrong.

When 'Show totals excluding hidden items' is selected with 'Sum of grades' what it shows is not the sum but the average as generated by 'Mean of grades' which in some cases is similar and doesn't look out of place.

Are you (or anyone else) able to test that and confirm what I am seeing?

Mal.
In reply to Malcolm Abel

Re: Sum of grades has wrong total if items are hidden?

by Jason Maur -

Hi Malcolm,

I'm using Moodle 2.3.3, and I have the same issue you're having. Hidden assignments in the gradebook when using Sum of grades is a nightmare, and the only workaround I know of is deleting all the hidden assignments. Originally, I tried to put all hidden assignments in their own "Hidden" category, but it seemed pretty finnicky: to get it to behave as I wanted, I had to flag the category as hidden and extra credit and set the "drop the lowest" so that all grades were dropped. That workaround is far from graceful, and I don't expect teachers to do nor to understand it.

In reply to Jason Maur

Re: Sum of grades has wrong total if items are hidden?

by Gary Sutcliff -

I gave up on Sum Of Grades long ago as it never seemed to match any grade
logic that I could see.

I can only imagine that there are several reasons to hide assignments
but why is there so much collateral damage when one does?

For me, I question why grades disappear when the only thing I want to do is
shorten the list of assignemtns in the list so that the student does not have
to scroll so much towards the end of the course.

The option to show-this-block-only is not very helpful. That logic chould be
reversed and to hide-this-block.

Is it different from the student side?
Are there options or switched that I missed?
Is this just the way it is? (IE: Get over it...)

P.S.  Why am I always getting this messae from Paul Cook? If I "go to messages"
or "Ignore" I cannot seem to put it to rest.

 

In reply to Jason Maur

Re: Sum of grades has wrong total if items are hidden?

by Bob Puffer -

Steve is right, Sum of grades IMO is useless.  I've never had anyone explain a valid use-case for it.  That is, taking into account that we use the LAE Grader report which automatically displays the accurate point totals (configurable) which, when used with Simple weighted mean of grades accomplishes the very same thing only correctly.

In reply to Malcolm Abel

Re: Sum of grades has wrong total if items are hidden?

by Theo Hughes -

Hi,

I came across a related issue... which makes me nervous that the logic in Grades is potentially spagehetti code under the hood.

I have three Categories (there are some sub-categories under these two) where the 3rd Category was to collate hidden items that I didn't want to delete, as I might use them later, and also allocated a total of 0 to those items.

I used Sum of Grades to total up the two visible Categories. Turns out it works correctly "under-the-hood" e.g. when downloading the Grades it totalled it correctly, but in the User Report it appeared incorrectly. In the settings I had "Show Totals Excluding Hidden Items" selected. When I changed this to "Show Totals Including Hidden Items" it showed correctly in the User Report.

Looks like there might be a variety of "bugs" in this area.

Theo

In reply to Theo Hughes

Re: Sum of grades has wrong total if items are hidden?

by Bob Puffer -

I've spent a lot of time under the hood and can verify that the code is not spaghetti but IMO, unnecessarily complex.  Simplification has always been at the top of my guiding principles when coding in the gradebook.  Additionally I can verify that calculations for SWM and WM have always been accurate in all cases I've observed, even when we were convinced there was an error.  

Until recently I spent almost no time looking at Sum of grades but spent quite a bit of time seeing if I could get it to aggregate only non-empty grades (which would make it act pretty much like SWM but more easily understood by instructors). I could not discern an easy path to travel in that quest and abandoned it.  I would not be surprised if Sum makes calculation errors, not accurately taking into account limiting factors such as hiding, etc.

In reply to Theo Hughes

Re: Sum of grades has wrong total if items are hidden?

by Tim Allen -

Thanks, about 9 months later and now using Moodle 2.5.2, your report helped me isolate the bugs related to this too.  I either have to un-hide all categories, or with hidden categories set it to "Show Totals Including Hidden Items"  and make them to be worth no marks.

The problem seems to be resolved by changing from "Sum of Grades" aggregation to "Simple Weighted Mean".

In reply to Tim Allen

Re: Sum of grades has wrong total if items are hidden?

by Sam Mudle -

Thanks, about 9 months later and now using Moodle 2.5.2, your report helped me isolate the bugs related to this too.  I either have to un-hide all categories, or with hidden categories set it to "Show Totals Including Hidden Items"  and make them to be worth no marks.

The problem seems to be resolved by changing from "Sum of Grades" aggregation to "Simple Weighted Mean".

Yeah, but the problem is that Sum of Grades will not exclude grades -- though Moodle 2.4.x will remind you of this if you try.