Description

When viewing the gradebook the groups to filter the results by are determined by the default grouping id set in the course settings.

In the file lib/grouplib.php the function groups_print_course_menu which is responsible for printing the group menu selector calls the function groups_get_all_groups on line 349 and 365 which passes the course's default grouping id, resulting in only groups displaying that belong to that particular default grouping. I believe the default grouping id should not be considered when displaying groups to filter by.

Fix: Pass 0 as the grouping id.

Temporary Fix: To display all groups in the select box you must change the course's setting default grouping to none.

At the OU, we have staff, basically non-editing teachers in Moodle terms, but without the Access all groups capability. for data-protection reasons. It is an important requirement that such people can only see the grades for people in their tutor group. Some courses, have a tutor-group grouping, and other groupings.

So, it is essential that the gradebook uses the course grouping, at least for SEPARATE groups mode, and when the user does not have Access all groups.

Tim Hunt
added a comment - 12/Nov/10 5:46 PM This commit is really bad. Sorry, but I have to reopen this.
At the OU, we have staff, basically non-editing teachers in Moodle terms, but without the Access all groups capability. for data-protection reasons. It is an important requirement that such people can only see the grades for people in their tutor group. Some courses, have a tutor-group grouping, and other groupings.
So, it is essential that the gradebook uses the course grouping, at least for SEPARATE groups mode, and when the user does not have Access all groups.
In other words, looking at your patch ( http://cvs.moodle.org/moodle/lib/grouplib.php?r1=1.22.2.10&r2=1.22.2.11 ), the change to line 349 is probably good, but the change to line 365 must be reverted.
I hope that is OK. I am sure that the OU is not the only one who will want this.

Update: Ive spoken to Petr about this and this is more complicated that I thought. Because both students and activities can be in groupings the notion of selecting a grouping then showing only the students and activities in it is... complex. It can be done but it cannot be done right now.

For a user to be able to view all groups would require a capability check at the course level. Trying to do it at a lower level would make this even more difficult.

Andrew Davis
added a comment - 15/Nov/10 8:56 AM - edited Update: Ive spoken to Petr about this and this is more complicated that I thought. Because both students and activities can be in groupings the notion of selecting a grouping then showing only the students and activities in it is... complex. It can be done but it cannot be done right now.
For a user to be able to view all groups would require a capability check at the course level. Trying to do it at a lower level would make this even more difficult.

Hello. I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.

Andrew Davis
added a comment - 17/May/13 12:40 AM Hello. I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.
For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment
If you have any information about this issue or a possible fix please post it here