No role sync on course meta link enrolment

No role sync on course meta link enrolment

by Florian Schmitt -
Number of replies: 3

Hi there,

we face a problem regarding use of course meta link enrolment, with student roles not being synced to the meta course. Students are enrolled, but do not have any roles. 

Our scenario:

Students are enrolled into courses using category enrolment, which works perfectly fine. A student is manually enrolled to a category and gets automatically enrolled to all courses of that category.
We have several courses, that are shared between multliple categories, and thus we established the use of meta link courses.

So we have the course "Basic Maths" in category "Maths".
And we have the course "Basic Maths General" in the category "Shared Courses".
Students are only enrolled to category "Maths", bot NOT to the "Shared Courses" category.

What we get: students are successfully enrolled to the "Basic Maths General" course, but lose their student role.
I have uplaoded a screenshot of the meta link enrolment config, we didn't exclude any roles. The second screenshot shows the changes from the original course to the meta course, i.e. the loss of the role.

We are currently at a loss on how to fix this. Also we couldn't find any way to bulk update the roles for the current state, to at least create access to activities for the currently enrolled students. 

This situation is prevalent with about 150 students in 20 courses, or ca 1200 enrolments in total. So if anyone has encountered this or has any tipps on how to set the student role via bulk, this could be a life saver. 

Thanks and best reagrds,
Florian

Attachment 2021-01-13 17_23_09-Window.png
Attachment 2021-01-13 17_28_44-Window.png
Average of ratings: -
In reply to Florian Schmitt

Re: No role sync on course meta link enrolment

by Randy Thornton -
Florian,

This is working as designed.

Technically, enrolng a user in a course and assigning them a role are two distinct processes. Usually they happen at the same context level, but not in this case.

When you assign a user the role of Student at the category level, the role assignment is at that level. The Category enrolment sync enrols the user in the courses in the category, but it does not assign them a role in the course: there is no need to do so, because the user already has the role of Student at the category level and so has all the capabilities they need, inherited down from the category role. What you see in the Participants list of the first course above is a role for the user that is inherited down from the category level, similar to system roles like Manager or Course Creator.

So, the user has the role at the category level and the enrolment at the course level.

Therefore, when the Meta enrolment sync runs, it finds the user has an enrolment but no role assignment in the source course and therefore has no role to assign them in the target Meta course. It enrols them but does not assign a role, thus faithfully duplicating the situation in the source course. (Maybe what the meta sync should do in this case is handle this exception for category enrolments, but it doesn't. It only looks for course level roles and replicates them to the meta course.)

I don't have a simple solution for you. User upload can't assign roles like this. I'm sure you already tried that.

The only thing that I know which would work would be to add new role assignment entries to the role_assignments table, creating a new new role assignment for those students in the meta courses. If you or someone on your team have those skills to code that, then that is the place to look: find users in a meta course with an enrolment but no assignment and create an assignment for role student. Otherwise, I hope someone else may have a better suggestion.

Randy
Average of ratings: Useful (2)
In reply to Randy Thornton

Re: No role sync on course meta link enrolment

by Florian Schmitt -
Hello Randy,

thank you for your detailed answer, your remark on the inherited role from the category enrolment is of great help.
I guess we will have to operate directly on the database then. But at least the "disappearance" of the role assignment on the meta course makes sense now.

Thanks again,
Florian
In reply to Florian Schmitt

Re: No role sync on course meta link enrolment

by Randy Thornton -
Florian,

You are welcome. It is a very unusual situation. I remember long ago I used category enrolments on a site and when restoring a course with users, it had no roles on the restore. It took us a while to figure out why.

The good news is all the enrolments in the courses exist in the database. So, using those you should be able to find out which users now need to have role assignments created for them in those courses and add those.

Good luck,

Randy