>Petr said :
>I agree the usability of group/cohort UI could be improved a lot,
And also this requires the teacher to make two operations :
1) add a new enrolment method (Cohort sync) and let it runs
2) go to groups, create groups automatically and fill in the fields (some of them being confusing)
and repeat step 2 at every modification of the associated cohort ... quite difficult if cohorts are synched nightly against an LDAP server.
The attached patch modify the plugin enrol/cohort to allow automagic creation of group, and eventually grouping with the same name( or idnumber) of the associated cohort.
1) admin defines the default values in settings.php
2) teacher keeps or not these default values in addinstance_form.php/addinstance.php
3) automagic creation/synching is done in locallib.php enrol_cohort_sync function, so it is done either manually where the teacher add a new cohort enrolment method or during the enrol_cohort cron() operation.
Tested here with cohorts from 2 to 789 members .