Course creator doesn't get Teacher role in created courses

Course creator doesn't get Teacher role in created courses

by moodle backup -
Number of replies: 13

We have moodle 3.7 linked to ldap server and we automatically map school teachers to course creator role. We had the same in 2.9 and the courses created by teachers were automatically owned by them with teacher role and now we can't get that, the couse creator account has no role in the newly created course.

How do we have to configure moodle course creator role to automatically set the course creator account as teacher in the courses they create?

Average of ratings: -
In reply to moodle backup

Re: Course creator doesn't get Teacher role in created courses

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,

I suggest that you start by checking that the setting "Creators' role in new courses" (creatornewroleid) in Site administration / Users / Permissions / User policies is set to teacher.

In reply to Helen Foster

Re: Course creator doesn't get Teacher role in created courses

by Christian Bocquet -
Picture of Particularly helpful Moodlers
Hello,

I have the same problem. And yet, after checking in mdl_config, I have:


Christian
with Moodle 3.7.2
In reply to Helen Foster

Re: Course creator doesn't get Teacher role in created courses

by moodle backup -
We have those parameters correctly set I think:

Creators' role in new courses
creatornewroleid
Default: Teacher (editingteacher)
If the user does not already have the permission to manage the new course, the user is automatically enrolled using this role.

Restorers' role in courses
restorernewroleid
Default: Teacher (editingteacher)

Any other ideas? The teachers are automatically mapped on first login from OpenLDAP to the course creator role.
In reply to moodle backup

Re: Course creator doesn't get Teacher role in created courses

by moodle backup -
It worked on 3.7.1 fresh install. The only thing we have done is upgrade it to 3.7.2
In reply to moodle backup

Re: Course creator doesn't get Teacher role in created courses

by Christian Bocquet -
Picture of Particularly helpful Moodlers

I think the problem comes from a code change in the file course/edit.php and perhaps the function user_can_assign on the line 169.
See here the change :


If I replace it with the old code, it works the same as before.

Christian

In reply to Christian Bocquet

Re: Course creator doesn't get Teacher role in created courses

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

I just tried the following steps on https://sandbox.moodledemo.net/

  1. Log in as an admin
  2. Assign a user the role of course creator
  3. Log out then log in as the course creator
  4. Create a course

I checked and found that the course creator was correctly assigned the role of teacher in the course that they created.

As it seems things are working correctly on a plain, non-customised site, we just need to figure what's different in your sites to cause the problem?

In reply to Helen Foster

Re: Course creator doesn't get Teacher role in created courses

by Christian Bocquet -
Picture of Particularly helpful Moodlers

Hello Helen,

I just installed on my computer "Moodle installer package for Windows" for 3.7.2 (MoodleWindowsInstaller-latest-37). The course creator only has the role course creator in the created course and  he doesn't have the role editingteacher :


Actually the version of sandbox.moodledemo.net is 3.7.1 and not 3.7.2 :



Christian


In reply to Christian Bocquet

Re: Course creator doesn't get Teacher role in created courses

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Just popping in to say that I confirm this in a new 3.7.2 site and I am wondering if this is related to a minor security issue MDL-66181?
Average of ratings: Useful (1)
In reply to Christian Bocquet

Re: Course creator doesn't get Teacher role in created courses

by moodle backup -
Thanks a lot! That fix (https://github.com/moodle/moodle/commit/ed080a580ffd0eea70ad3eaa9214234cf2463034) that you pointed at is the problem. I tried to allow course creators the ability to assign teacher role but didn't work.

We rolled back that and now the course creator gets correctly assigned the teacher role on his created courses in 3.7.2
In reply to moodle backup

Re: Course creator doesn't get Teacher role in created courses

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi all,

We fixed a bug with course creation whereby the default course role was given regardless of whether it should be.

Essentially, in order to assign a role, you need two things:
1) The moodle/role:assign capability; and
2) The ability to assign the specified role (Site administration -> Users -> Define role -> Allow role assignments)

Unfortunately the default "Course creator" role has neither of these.

There are a few other parts to this but they should not normally be fixed by an upgrade script. We do not change either the capability assignments, nor the role configuration of an installed site (normally).

I've created MDL-66683 to address this for 3.8. We may need to consider adding this to stables in an upgrade step, but this is unusual for stables. I suspect we should accept such a change in our next minor release and grant the assign to the coursecreator archetype for the current default role only.
In reply to Andrew Lyons

Re: Course creator doesn't get Teacher role in created courses

by Peter Ruthven-Stuart -
Picture of Plugin developers
Hello,

I can also confirm that, having just upgraded to 3.7.2 from 3.6.3, course creators are no longer automatically assigned the role of teacher in the courses they create. I hope this bug (MDL-66683?) can be fixed soon.
In reply to moodle backup

Re: Course creator doesn't get Teacher role in created courses

by Gus Hagelberg -

I have the same issue on my system.

I am running Moodle 3.5.8 and the problem, I think, just came up.

Thanks

In reply to Gus Hagelberg

Re: Course creator doesn't get Teacher role in created courses

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
If you are able to upgrade then this has now been fixed - see MDL-66683