User shows enrolled 2 ways - database and manual - how to fix?

User shows enrolled 2 ways - database and manual - how to fix?

by Jerry Lau -
Number of replies: 6

Hello folks.

using moodle 3.6.9 on rhel 7.7 64-bit enterprise; php 7.2.8 and MySQL 5.7

Saw something strange as we use database enrolment and now I see some users are enrolled as database and manual for that same user!  See attached photo.. it shows 2 "active" icons for that user. mouse over them and I get database enrolment and the other manual enrolment.

What we use to do is to database enrol these users and then reclassify them as "manual" enrolment so instructors can remove or unenrol them manually as they choose to. Worked great for years.

I was told that some instructors may have manually enrolled them first before our database enrolment process (built in moodle cron function) and thus, there are 2 enrolment types.

Is this true and how can we correct the ones using database enrolment and change it to manual enrolment for that course without affecting their enrolment in their course (s)?

Thanks


dual enrolment type





Average of ratings: -
In reply to Jerry Lau

Re: User shows enrolled 2 ways - database and manual - how to fix?

by Jerry Lau -
I have another question.. in the user_enrolments table, there is a field called modifierid.. where can I find who this modifierid is? I have values that is a "0" there and on other records they have values.

What is/are the table(s) and field(s) that links to courses + roles + user enrolments called?

thanks
In reply to Jerry Lau

Re: User shows enrolled 2 ways - database and manual - how to fix?

by Randy Thornton -
Picture of Documentation writers
The id is the userid of the user as listed in the database in the table mdl_user.

0 means an anonymous user or Guest or the system, depending on the situation. In this case it will refer to the system, to the external enrolment method that the system is calling via the database enrollment you are using. So, external database enrolment should have user 0 and all other ids are the ids of the person who did the manual enrolment (admin or teacher, etc.)
In reply to Jerry Lau

Re: User shows enrolled 2 ways - database and manual - how to fix?

by Randy Thornton -
Picture of Documentation writers
As long as at least one method remains for the user, they are still enroled in the course properly. So you can safely remove either of the methods and as long as you leave the user with one, they will not lose any data. So, keep the method they should have and remove the method they should not have or no longer need.
In reply to Randy Thornton

Re: User shows enrolled 2 ways - database and manual - how to fix?

by Jerry Lau -

That’s the catch.. how can I safely remove it via sql.


Also, we noticed that if instructors adds them first manually before dB enrolment, they can be referred as both as shown in my pic. 

Seems like a bug. Should it not check for dupes?

In reply to Randy Thornton

Re: User shows enrolled 2 ways - database and manual - how to fix?

by Jerry Lau -

the documentation is bad and needs a lot of work.. they don't tell users what contextid,  context, component, itemid means, etc means and in the big picture and how it relates to other tables, etc.

In reply to Jerry Lau

Re: User shows enrolled 2 ways - database and manual - how to fix?

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
It would be helpful to know which Docs page/s you’re referring to so that they can maybe be improved. And the Docs are a wiki that anyone can edit - it’s part of your community contribution 😉