mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-46524: Auto-create groups from existing group or grouping membership
This commit is contained in:
parent
40f0ad21a3
commit
e4ebf7ef0f
6 changed files with 165 additions and 11 deletions
|
@ -85,7 +85,17 @@ if ($editform->is_cancelled()) {
|
|||
default:
|
||||
print_error('unknoworder');
|
||||
}
|
||||
$users = groups_get_potential_members($data->courseid, $data->roleid, $data->cohortid, $orderby, !empty($data->notingroup));
|
||||
$source = array();
|
||||
if ($data->cohortid) {
|
||||
$source['cohortid'] = $data->cohortid;
|
||||
}
|
||||
if ($data->groupingid) {
|
||||
$source['groupingid'] = $data->groupingid;
|
||||
}
|
||||
if ($data->groupid) {
|
||||
$source['groupid'] = $data->groupid;
|
||||
}
|
||||
$users = groups_get_potential_members($data->courseid, $data->roleid, $source, $orderby, !empty($data->notingroup));
|
||||
$usercnt = count($users);
|
||||
|
||||
if ($data->allocateby == 'random') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue