Note: You are currently viewing documentation for Moodle 2.9. Up-to-date documentation for the latest stable version of Moodle may be available here: Unenrolment.
Unenrolment is the process of removing users from a course. It is controlled by one or more of the following:
- The enrolment duration, which suspends students after the specified time has elapsed. Some plugins include the option to unenrol users after enrolment expiration
- For self enrolment, the 'Unenrol inactive after' setting in Administration > Course administration > Users > Enrolment methods > Self enrolment can be set to specify a time after which a student is automatically unenrolled from a course if they haven't accessed it in that time
- An enrolment plugin may decide that the enrolment has expired, for example, if a user for a course is not present in an LDAP database, or if a Flat file is processed by Cron.
In addition, users with the appropriate permission can unenrol themself from a course.
The default enrolment duration for manual enrolment can be set in Administration > Course administration > Users > Enrolment methods > Manual enrolment. It can be amended from the default value when enrolling users manually in Administration > Course administration > Users > Enrolled users.
The enrolment duration for self enrolment can be set in Administration > Course administration > Users > Enrolment methods > Self enrolment.
Users who were previously manually enrolled may be unenrolled in bulk via Administration > Course administraton > Users > Enrolment methods then clicking on the 'Enrol' users icon.
Unenrolment and grade history
When a user is unenrolled, their grade history is not deleted. If a user is unenrolled accidentally, their grades can be restored by going to Administration > Course administration > Users > Enrolled users, clicking 'Enrol users' and making sure that the 'Recover user's old grades if possible' checkbox is ticked in the enrolment options before re-enrolling the user.
Users enrolled with methods other than manual will have their grades restored depending on the value of "recovergradesdefault" in Administration > Site administration > Grades > General settings.
Suspended or Unenrolled?
Suspended users are not longer able to access any of their courses on Moodle but their data is preserved, so it is possible for them to return to their course at a later time. This might be useful for example, for keeping safe the work of students who have left the establishment but whose data might be needed for inspection in future years. Suspended users currently still appear in the gradebook but a teacher can select in their Grader report preferences to show only active users or all users (including suspended users). See Grade settings for more details.
Note: A single user may be suspended by an admin user or manager by editing the user's profile and selecting "Suspended account". Groups of users may be suspended from "Users > Enrolled users". With the manual enrolments selected, choose "Edit user enrolments" and "Alter status > Suspended".
It is also possible to suspend users from courses via csv/text file from Site administration > Users > Accounts > Upload users using the enrolstatus field, where 1 against a user means they are suspended (and leaving blank means they are still enrolled.)
Unenrolled users do not normally retain any data and will not appear in the gradebook. However, see #Unenrolment and grade history Unenrolment is typically more final than suspension.