How to recover grades after unenrol
How can I view or restore my users' grades after they have been unenrolled?
Problem
Sometimes learners may become unenrolled in a course they had previously completed or made progress in, and it may be important to restore these users' grades. There are different solutions depending on which enrolment method was used to enrol the learners.
Solution
Enrolment method
First it's a good idea to understand exactly why and how the user became unenrolled. Was this as result of a change made by a trainer/site administrator or did the learner unenrol themselves? Once you know which enrolment method these users were enrolled with before they were unenrolled you can then decide how to reinstate their enrolment.
Unenrolment commonly occurs when the audience sync enrolment method is used, as users can drop out of the course when their audience membership changes for another reason. Another possibility is that a user was manually enrolled or enrolled via a program.
For each of these methods there are settings to control what happens when users become unenrolled.
Recovering a user's grade after unenrolment
Below are instructions on how to recover users' grades. It is always worth testing in a non-production/test environment first to confirm that you're happy with the results.
To recover an individual user and grades:
- Go to [Course name] > Course administration > Users > Enrolled users and select Enrol users.
- Expand the Enrolment options dropdown and check the Recover user's old grades if possible checkbox.
- Select Course start under Starting from.
- Select the Enrol button next to the user.
- Go to [Course name] > Course administration > Grades and notice that the grades are showing.
- Go to [Course name] > Course administration > Users > Enrolled users and remove the manual enrolment for the user, leaving audience sync.
- Go back to [Course name] > Course administration > Grades and notice that the grades are still showing.
To recover a whole audience and grades:
- Go to [Course name] > Course administration > Edit settings and remove the audience from Enrolled audiences. This will remove all users and grades from the course.
- Go to Quick-access menu > Grades > General settings.
- Set Recover grades default to Yes.
- Go to [Course name] > Course administration > Users > Enrolled users.
- Select Enrol audience and select Enrol users next to the appropriate audience(s). This will enrol all applicable audience members as manual enrolments.
- Go to [Course name] > Course administration > Grades and check that the grades are showing.
- Go to [Course name] > Course administration > Edit settings and add all of the appropriate audiences to Enrolled audiences.
- Go to [Course name] > Course administration > Users > Enrolment methods.
- Select the enrol users icon next to Manual enrolments.
- Select all of the manually enrolled users and then select Remove.
- Go back to [Course name] > Course administration > Users > Enrolled users and check to ensure the users are still enrolled via audience sync and no longer manually enrolled.
- Go back to [Course name] > Course administration > Grades and notice that the grades are still showing.
External unenrol actions
For each enrolment type there are settings to control what happens when users are removed/unenrolled from courses. These are known as external unenrol actions or enrolment expiry actions.
In the audience sync/ manual enrolment global settings you'll find: External unenrol action (these settings are found in Quick-access menu > Plugins > Enrolments > Audience Sync/ Manual enrolments).
Below is a little more information about what these settings do:
Unenrol user from course - When the user disappears from the external source, the enrolment is completely removed and all the roles removed. This means some user data and settings are purged from course during course unenrolment (that usually include grades, activity attempts, etc.).
Keep user enrolled - When the user disappears from the external source, the enrolment is kept as is, and the user is still able to enter the course and perform activities, access resources, etc. It's a 'do nothing' option.
Disable course enrolment - When the user disappears from the external source, user enrolment is suspended (the user can't access the course, but user data and settings are kept), and roles are kept as is. You might use this because in some cases the user needs a role with some capability to be visible in the user interface, such as in the gradebook, assignments, etc.
Disable course enrolment and remove roles -When the user disappears from the external source, the enrolment is suspended and roles assigned by enrol instance are removed. Please note that the user may disappear from the gradebook and other areas.
The difference between the third and fourth options is that with the third option you still see users in the grade book and activities, but with the fourth one you don't. But if you un-suspend (re-enrol) the user, both the third and fourth options will restore things back to normal (while the first one won't).
To avoid removing a user's grades during unenrol in future you may want to consider changing the external unenrol action to:
Disable course enrolment and remove roles – this means the learner is not able to enrol themselves in the course. If the learner is re-enrolled through the audience their course grades, settings and record of learning is restored. This setting should be used when the learner’s previous course grades are required to be kept.