by Tim Schroeder.
This is a general problem with the assignment module which either wasn't considered when the module was designed or it was deferred as there do exist workarounds. But as Harald says we can't use these workarounds. In my opinion this is a bug and should be fixed in the core. Would anything speak against that?
The problem is this: For each group submission the groupid is stored. If the submissions are graded, then a student switches from one group to another and then his grade is changed again, Moodle checks which group he's currently in, who else is currently in his group and updates the grade for all of them. Instead we'd need to have separate DB tables like "assign_submission_groups" and "assign_submission_groups_members" where we would store group info and group membership at the time of submission. It could look like this:
assign_submission_groups
id | assignment | idnumber | name | description | descriptionformat | picture | hidepicture |
1 | 1 | g1 | Group 1 | | 1 | 0 | 0 |
2 | 1 | g2 | Group 2 | | 1 | 0 | 0 |
3 | 1 | g3 | Group 3 | | 1 | 0 | 0 |
4 | 2 | g1 | Group 1 | | 1 | 0 | 0 |
5 | 2 | g2 | Group 2 | | 1 | 0 | 0 |
assign_submission_groups_members
id | assignsubmissiongroupid | userid |
1 | 1 | 2 |
2 | 1 | 3 |
3 | 1 | 6 |
4 | 1 | 11 |
5 | 2 | 4 |
6 | 2 | 7 |
7 | 2 | 8 |
8 | 2 | 10 |
9 | 3 | 1 |
10 | 3 | 5 |
11 | 3 | 9 |
12 | 4 | 2 |
13 | 4 | 3 |
14 | 4 | 9 |
15 | 4 | 10 |
16 | 5 | 5 |
17 | 5 | 7 |
18 | 5 | 8 |
19 | 5 | 11 |
In this example you groups of (up to) four. For the first assignment you have 11 students (IDs 1 through 11) in 3 groups. After that assignment the group compositions change: Students 1, 4 and 6 drop out. The remaining two students of group 3 move to groups 1 and 2. Student 10 doesn't like it in group 1 so he asks group 2 if one of them wants to switch places with him. Student 11 agrees and they switch places. Later they hand in their submissions for the second assignment.
The DB table "assign_submission" would then no longer have a column "groupid" which refers to the "groups" table but an "assignsubmissiongroupid" column that refers to the new "assign_submission_groups" table.
I haven't looked at the PHP code yet, so can't say how much would need to be changed there to make it work.
Would something like this be an okay solution? Am I missing something?
Edit: The group info (name etc.) stored in the new table wouldn't be updated if you change the group info after the assignment. This might cause confusion, possibly. But a) I'm not sure most people would even want the group names in old submissions "updated" and b) even so it's still better than unintentionally changing student's grades (and not noticing it!).