MDL-46524: Auto-create groups from existing group or grouping membership

This commit is contained in:
Gregory Faller 2014-08-06 10:50:14 +09:30
parent 40f0ad21a3
commit e4ebf7ef0f
6 changed files with 165 additions and 11 deletions

View file

@ -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') {