I am trying to customize moodle. I have installed moodle on my xampp server. I have added some new fields to the registration form using user profile fields. Now I want to add a role, for example 'student' to the user on registration.I don't want to assign the role manually using 'Assign system roles'.Instead all the user will be assigned the role 'student' or a role selection drop down will be there on the registration form. How to do it in either case? Please help.
Asked
Active
Viewed 652 times
0
-
A user in Moodle can have several roles, even in the same course. There is no 1 to 1 relationship between users and roles. You want to define a sort of default role for a new user and automatically give them this role as soon as they'll be enrolled into a course? – Aldo Paradiso Jul 04 '16 at 12:04
-
@AldoParadiso Yes. Actually I want registration for students only. Other users will be directly added by admin. – Akhilesh Jul 05 '16 at 03:53
-
So, you want to add a field in the form http://your_moodle_site/user/editadvanced.php?id=-1 in which you define a kind of "default role" for the new user? And every time the user will be enrolled into a course, they will be automatically enrolled with the role defined in the "default role"? Try to specify a concrete use case, it will help to find an answer. – Aldo Paradiso Jul 06 '16 at 07:24
-
@AldoParadiso I want to add the field in the form http://localhost/moodle/login/signup.php. So every newly registered user will have that role. – Akhilesh Jul 07 '16 at 06:45