How to hide globally suspended students from courses with cohort sync?

How to hide globally suspended students from courses with cohort sync?

by Florian Leupold -
Number of replies: 3

I have added students to my courses via cohort sync. Then it does not seem possible to suspend them from a course they are enrolled in. Even when a student is suspended globally, he shows up in the course as an active participant.

Is it possible to hide globally suspended students from courses such that they do not show up in activities and the grade book?

Average of ratings: -
In reply to Florian Leupold

Re: How to hide globally suspended students from courses with cohort sync?

by Randy Thornton -
Picture of Documentation writers
Florian,

Suspending a user account has no effect on the enrolments in courses, which remain active, as you have seen. Suspending a user account and suspending a user enrolment in a course are not directly related.

So, no, it is not possible to hide them in the courses because their account is suspended. In order to do that, you must suspend them at the course level to hide them from the gradebook or other reports. For Cohorts, that means that you must remove the user from the Cohort: however, there are two workarounds that will save the student enrolment data if you plan to make them active again:


Change the user course enrolment to Manual

1) in the course, enroll the same user in the cohort again using a Manual enrollment method. They will now have two entries in the participants list for their Status both saying "Active" (see attached screenshot.)
2) Remove the student from the Cohort, which will unenroll them from the course but only for the Cohort method: they will still be enroled with the Manual method. They will now have only one entry in the participants list saying Active, the manual enrolment.
3) Edit the manual enrolment for this user with the gear/edit icon and set their Status to Suspended.

This works fine if you only need to suspend a few users manually, from time to time.


Setting the Global default for Cohort unenrolment

it is possible to change the system setting for Cohorts so that when you take a user out of a Cohort, that they are suspended from ALL their courses instead of unenroled. This is set in Site admin > Plugins > Enrolments > Cohort sync > External unenrol action. If you set this to "Disable course enrolment and remove roles." then any student that you take out of a cohort will not be unenroled from their courses, but only suspended and their role taken away (that it is will say No role instead of Student.) In this case, they do not appear in the gradebook, though they will be on the Particpants list. If you add the user back to the Cohort, then the will be assigned back to the Student role and their status set back to Active once again.

This works, however, it will affect ALL enrolments for all Cohorts in all courses. It is a global setting. It means all users taken out of any Cohorts will be suspended and never unenrolled but always left in courses, suspended. This may be what you want, but it may not. So, consider carefully how this may affect your courses and enrolments before setting this.


Attachment screenshot_9483.jpg
Average of ratings: Useful (3)
In reply to Randy Thornton

Re: How to hide globally suspended students from courses with cohort sync?

by Florian Leupold -
Thanks a ton, Randy! Your detailed response and solutions are immensely helpful!
In reply to Florian Leupold

Re: How to hide globally suspended students from courses with cohort sync?

by Randy Thornton -
Picture of Documentation writers
Florian,

You are welcome. I have folks who work with Cohort a lot and this issue always comes up.

Note also that if you choose the first method to swap the user enrolment method in courses, then you can also do this using the Upload users tool if you have to do this to a lot of users.: https://docs.moodle.org/39/en/Upload_users#Enrolment_fields
Average of ratings: Useful (1)