grade for checklist

grade for checklist

by Shufeng Bai -
Number of replies: 6

I have been relying on the grades for checklists to report the student's progress to their parents. However, I recently found the grade behaves very strangely. For example, I have one checklist with 3 required items and 5 options items. One student completed 2 required items and 1 options items. So the progress is 66% for quired and 37% for all as shown below.

However, the grade for this item is 33.33%. I can't figure out how the grade is calculated. Can anybody help? Or anybody has seen similar behavior?

We are running the latest moodle with MoodleCloud.com. Thanks

image.png


image.png

Average of ratings: -
In reply to Shufeng Bai

Re: grade for checklist

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I cannot see your images here.

The way the grades should be working, is as follows:
* Get all the items in the checklist that are not user-specific, not optional and not hidden
* For those items and for each student, check to see if they are in the same grouping as the student (or if no groupings at all are used, then the item is available for the student)
* For all the items found above, count how many are checked by the student (student-only checklist) or by the teacher (teacher-only or student and teacher checklist)
* Calculate the grade for the student as total number of relevant items checked, multiplied by the maximum grade for the checklist, divided by the total number of relevant items in the list

The code is available here: https://github.com/davosmith/moodle-checklist/blob/master/lib.php#L228 if you want to read through it yourself.

I've not had any reports of problems with this (and the code is mostly 5-10 years old, with one minor variable rename a couple of years ago), so I'd be surprised if there was something fundamentally wrong with it now.

Can I suggest you carefully re-check the data, just in case you've missed something in the configuration?
In reply to Davo Smith

Re: grade for checklist

by Shufeng Bai -
Davo,
Thank you for your prompt reply. I am sorry that you can't see my images here. But what I posted in the image is that in the progress page of the checklist, it clearly shows the required items for this user is 66% and all items is 37%. So unless the grade calculation and this percentage calculation are using a different metric, I can't see why this discrepancy can happen. For the three required activiies, two are pages and one is quiz. The quiz is set to "visuable group" and there is no group or user override. If you kindly let me know what else I need to check, it would be really helpful. Thanks again.
In reply to Davo Smith

Re: grade for checklist

by Shufeng Bai -
Davo,
I was able to reproduce the problem with the following steps:
1) create three pages (A, B and C) under a course topic
2) add a checklist for the section and configure to update automatically. set max score to 100
3) In the checklist set A and B as required and C as optional
4) A student login, click B, and C. This time it shows 50% of the required items and 67% all items are done in the progress bar and 50 in grade. All good
5) now in the teacher's account, make page C a required item. Now student's checklist still have B, and C complete and progress bar shows 67% of required items are done. But the grade still remains at 50, while it should be 67 now!

I suspect the grade is not updated when the teacher modifies the required items.

If the student view page A now, the grade will update to 100 which is correct.

@Davo,
Is this behavior by design or it is an oversight? Is there any way I can trigger a recalculation of the checklist grade so the grade can get updated? Thanks a lot.
In reply to Shufeng Bai

Re: grade for checklist

by Shufeng Bai -
Looking at the code. It appears that only when max is changed or the completion is changed or the completion type is changed the grade got updated. I am not sure what is completion type is here but when I changed on an item from not required to required, this update was not triggered.  I can confirm that when I change the max grade, it did get updated.

In reply to Shufeng Bai

Re: grade for checklist

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The completion type is whether the activity is marked as complete manually (by the student ticking the standard manual completion box) or via completion rules (such as the student ticking off x% of the items in the checklist).

However, neither of these are directly relevant, as it's not the editing of the checklist settings which is the issue, but the editing of the items within the checklist.

I've pushed an update into github which should fix the issue whereby switching an item between optional and required (or adding / deleting an item) did not update the student grades for the checklist (even though this action does affect the calculated percentage and, hence, the grade).

I didn't want the grade recalculation to run for every change to the checklist items (on a course with a lot of students, this could noticeably slow the process down), so, instead, I'm queuing up a background cron task to do the recalculation (triggered by a relevant change to the checklist items - I don't trigger it if the checklist has just been rearranged, without adding/removing items).

Are you able to test the code published at https://github.com/davosmith/moodle-checklist to see if it solves your problem?

(This update will be published to the plugins directory in time for the Moodle 4.0 release - I'm not going to do an extra release, with that being so close at hand).
In reply to Davo Smith

Re: grade for checklist

by Shufeng Bai -
Davo,
Thank you very much for the quick fix. The code looks good to me. However, we are currently running on MoodleCloud, so I can't upload your latest code to test. I have to wait.

Recently, I noticed a strange behavior. In a student's grade report, I noticed two checklist grade is "-" (empty). For most cases, if a student has completed any activity, the grade should be 0 instead of empty. Do know what might cause these empty grades? Thanks a lot.