Permalink
Browse files

MDL-34190 Course: Role with student archtype should be selected as de…

…fault in user list
  • Loading branch information...
1 parent ca48fe5 commit b2da6472029cee9bb8952dd3760136a7944c9c64 Rajesh Taneja committed Jan 18, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 course/reset_form.php
View
@@ -107,6 +107,11 @@ function load_defaults() {
$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;

0 comments on commit b2da647

Please sign in to comment.