Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.6.4, 3.4.5, 3.5.2, 3.5.5, 3.6, 3.7
-
MOODLE_26_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
MDL-46803-greedy-roles-reset2 -
Description
Steps to reproduce:
- In a course, go to Users > Enrolled users
- Enrol user1 with Teacher role
- Enrol user2 with Teacher and Student role
- In course administration, go to Reset
- In Reset course screen under Roles, select Unenrol users: Student
- click on "Reset course"
- back in Users > Enrolled users, notice how user2 has vanished.
Course reset obviously unenrols users matching the role chosen in the Reset course screen from all roles in the course.
This is problematic with users having more than one role.
We have seen cases of teachers locking themselves out of their own course after doing a course reset. It turned out they were enrolled with both Teacher and Student role.
It would perhaps be more intuitive to remove only the selected role but leave the enrolment and other roles intact if there are any.
In the database, unenrol users removes all role assignments for matching users from table mdl_role_assignments and deletes the row from table mdl_user_enrolments.