moodle-mod_attendance icon indicating copy to clipboard operation
moodle-mod_attendance copied to clipboard

Grade inconsistency when stundent change from one group to other

Open antonio-c-mariani opened this issue 8 years ago • 5 comments

The course has two groups G1 and G2 and "Student 1" is in group G1. Working with "visible groups", add two group sessions for G1 and G2. Take attendance for G1 (and other sessions). The result is shown above. The grade book is consistent with the attendance report data.

g1

g2

Move "Student 1" from G1 to G2. Now the G1 session data is not shown anymore, and the grade book and the attendance report show inconsistent data.

g2_1

g2_2

Take attendance for the G2 session and the data go back to a consistent state.

g3_1

g3_2

Change the attendance "Group mode" to "No groups" and again the data go to an inconsistent state. Now both the G1 and G2 sessions data are shown in the attendance report.

g4_1

g4_2

In addition to the inconsistencies, this behaviour seems to be a little confused.

How about always show all the data of the taken sessions, regardless of the "group mode"? If there is some data that should not appear in the report, then it probably should be explicitly removed instead of trying it "guess" what to do with it.

antonio-c-mariani avatar Apr 14 '16 18:04 antonio-c-mariani

Student is in group 1 - attendance is taken which generates a grade and pushes that grade to gradebook. Student is moved to group 2 (but they have already achieved a grading based on prior attendance so their old grade still shows) I think that is correct behaviour. Student attendance is taken again and they are in group 2 so the grade pushes through a new update - again I think this is correct behaviour.

If the course is set to No groups after previous group based sessions were created we could hide all group sessions but I think that would likely cause more confusion - I think I'd prefer displaying them and requiring the teacher clean up and remove the old group sessions if they are no longer used. I don't want to automatically delete "attendance related data" when groups are deleted or group settings are changed within a course.

danmarsden avatar Apr 14 '16 21:04 danmarsden

When student is moved from G1 to G2 currently we can still see the old grade (based on G1 sessions data) at the gradebook. But after the teacher take attendance for any other session, the grade will be recalculated totally ignoring the points from G1 sessions. If the data fom G1 sessions will be ignored at some point ahead why then keep showing the old grade (at gradebook) even for a short period of time just after the student is moved from G1 to G2?

As a principle, I think the data must be always consistent which means the grades at gradebook must always reflect what is seen in attendance report.

The second question concerns what to do with the data from G1 sessions for the student that was moved/removed from this group. The current behaviour is to hide the data. But sooner or later a teacher probably wants to see these hidden sessions data. I have seen similar things in other contexts. Then what you said seems to be a good approach: "displaying them and requiring the teacher clean up and remove the old group sessions if they are no longer used".

antonio-c-mariani avatar Apr 16 '16 00:04 antonio-c-mariani

@danmarsden - while working on a sitewide report for a single user, I've seen that get_user_filtered_sessions_log_extended (and probably get_user_filtered_sessions_log as well) in classes/structure.php is not actually correct - it does not give all taken sessions as it claims. Since I was looking to base code for the report I'm working on on that, I haven't fixed it directly, but what I have ended up with might be useful in fixing this. Should be able to show you soon.

nwp90 avatar Jun 10 '19 00:06 nwp90

This appears this particular problem has only just cropped up for me, and may turn in to a bigger issue once i've gone through previous years reports that may also have been subject to this bug.

If a student moves group part way through the year, surely you'd want the attendance report and gradebook to show the percentage score across all sessions taken that they were included in, rather than just the ones for the group they are now in, no?

With this issue having been open for 6 years, is there any insight to a possible solution to achieve the above @danmarsden ?

cbrherms avatar Feb 08 '22 14:02 cbrherms

To be clear - I don't see this as a "bug" but expected behaviour, but I do see how it would be useful for some people to control or override it.

There's probably a decent chunk of work to make this work in the way you would like it to (retain attendance for users old groups) and make this clear within the UI - Moodle doesn't store a "history" of group membership, so you'd need to rely on making sure that attendance was taken for all historical sessions - you'd run into other edge cases where you have a group attendance session but that specific user didn't attend and so didn't have attendance marked but still needs that session included in calculations.

Feel free to reach out if you want to fund some development on this, but unless you have a massive number of users that are regularly affected by this I suspect the cost of the investment required is going to be much higher than having a manual process to deal with them on an ad-hoc basis.

thanks!

danmarsden avatar Feb 08 '22 21:02 danmarsden