mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-34190 Course: Role with student archtype should be selected as default in user list
This commit is contained in:
parent
ca48fe5f97
commit
b2da647202
1 changed files with 5 additions and 0 deletions
|
@ -107,6 +107,11 @@ class course_reset_form extends moodleform {
|
|||
|
||||
$defaults = array ('reset_events'=>1, 'reset_logs'=>1, 'reset_roles_local'=>1, 'reset_gradebook_grades'=>1, 'reset_notes'=>1);
|
||||
|
||||
// Set student as default in unenrol user list, if role with student archetype exist.
|
||||
if ($studentrole = get_archetype_roles('student')) {
|
||||
$defaults['unenrol_users'] = array_keys($studentrole);
|
||||
}
|
||||
|
||||
if ($allmods = $DB->get_records('modules') ) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue