Category unenrolment unenrols ALL?!

Category unenrolment unenrols ALL?!

by B. M. -
Number of replies: 4

Hello,

We have been using category enrolments for a specific user type on our site. We want to stop doing that and use course enrolments instead. My problem is as follows:

When I remove the user's category enrolment, it also removes ALL other course enrolments for that particular user. It simply unenrols the user from the course despite the fact the user has one or more course enrolments. I want to keep the course enrolment(s) but get rid of the user’s category enrolment.

How do I do that?

Average of ratings: -
In reply to B. M.

Re: Category unenrolment unenrols ALL?!

by B. M. -
So, it seems that if you enrol a user on category level to begin with, he/she is enrolled in the course by "category enrolments". If I add another role to that user, it remains "category enrolments" and all the roles get removed, if you remove the initial category level enrolment. So can you "transfer" the latter roles to a manual enrolment or what to do here?
In reply to B. M.

Re: Category unenrolment unenrols ALL?!

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello,

You can manually enrol users (as described in the documentation Manual enrolment), selecting the required role, then if you remove the category enrolment, the users will remain enrolled.

In reply to Helen Foster

Re: Category unenrolment unenrols ALL?!

by B. M. -
Hi Helen, thank you for your reply. The problem is, that we're talking hundreds of instances (or even thousands), so that makes it difficult. I think we have found a way to go about it, by doing a SQL-seach giving us all instances of the category enrolment per user. Then running a script enrolling all the same users manually back again.