An Moodle extentions - Automate system roles assignment on account creation?

An Moodle extentions - Automate system roles assignment on account creation?

by Kitti Lai -
Number of replies: 4

Hi all,

I have a specific use-case where automatic account creation based on roles would be really nice.

In our case, we have multiple groups of different people who wish to create their own Moodle account, I was thinking of creating some sort of extension in Moodle that could do that automatically but unsure on the approach. I don't think it would be the best practice to altering anything on the Moodle core so I was thinking if a plugin or anything that will be possible to do such things. 

Would that be feastable and does anyone have a recommendation on best approach for such a use-case like this?


Thanks in advance!

Kitti

Average of ratings: -
In reply to Kitti Lai

Re: An Moodle extentions - Automate system roles assignment on account creation?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I really don't understand what you want to do. Perhaps an example?

In reply to Howard Miller

Re: An Moodle extentions - Automate system roles assignment on account creation?

by Kitti Lai -
Taking the Moodle's login page as an example.

My idea was to have multiple "create account options", e.g: 

"Create a new teacher account"

"Create a new student account"

"Create an administrator account" etc.


And that Moodle will be able to assign them on one of these following roles automatically based on their choice upon the registration, after when their account has been confirmed by the administrators (on email). 


Did that help?

In reply to Kitti Lai

Re: An Moodle extentions - Automate system roles assignment on account creation?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I think (in the nicest way) that you don't fully understand roles. 

A user isn't assigned a role - they are assigned a role *somewhere*. This is a really important distinction. 

Example...

- 'User A' is assigned the role 'teacher' in 'Course 1'

- 'User A' (the same user) is assigned the role 'student' in 'Course 2'

- 'User B' is assigned the Manager role for the site. 

What you don't want to do is to assign site-wide 'course' roles (teacher, student etc) as that won't work properly. 

Average of ratings: Useful (1)