The groups interface used to distinguish between teachers and students. This has been removed in the transfer to the role system. All users are now displayed the same, which makes it less usable. Our administrators have requested that we put this feature back so I have.
My implementation of the feature works as follows:
- Users are categorised by course role (i.e. their role directly on the course). Each role displays, in role sortorder, as an optgroup followed by the people in it.
- Users can also have 'no role' on the course (if they have a role at a higher level) or 'multiple roles' (if they have two or more roles on the course). These are shown under those headings. The expectation is that normal usage would see few cases of people in these categories, or that it would be clear which they correspond to (i.e. somebody with multiple roles is most probably the group leader).
- The lists displayed (members, potential members) are both intended to contain identical lists of users to before these changes - just in different order and with role headings.
- I have implemented this display in three list boxes: the list of members on the first groups screen, and both the 'members' and 'potential members' boxes on the add/remove users screen. I have implemented it when AJAX is on (which only seems to affect the first case) as well as off. I did this patch against Moodle HEAD, although I am happy to port to 1.9 if it is desired there.
- The 'business logic' is in several new functions in group/lib.php. (There are no changes to any behaviour or database aspects of any other part of the system, this is strictly group UI only.)
Is this useful? If so, can I get the go ahead to commit it?
I have attached 2 screenshots and the patch.