Much like this http://tracker.moodle.org/browse/MDL-15663 but for Moodle 2+. There is also now an ID Number field for groups so this can be implemented more nicely than before (as mentioned in
Many organisations already maintain a list of groups (e.g. class lists) in their external database. We should extend the database enrolment plugin to automatically create groups in courses and enrol/unenrol users in those groups when syncing with an external system.
There are a couple of ways this could be done... Should there be a separate group table in the external database or should we just add two new columns to the enrolment table (a group name column for creating a group if one doesn't exist and a group ID column for matching up on the new group id number field)?