0

I need to assign student role to all users by default who are registering our Moodle site through registration form from frontend. How we can assign student role by default.

Note : If admin is creating new account or uploading bulk users they can assign any roles manually.

stefun
  • 1,261
  • 3
  • 24
  • 54

2 Answers2

0

The student role is added when a user is enrolled on a course, so is at the course level rather than site level.

It sounds like you want to auto-enrol users on courses? There are a couple of enrolment plugins that will do that:

https://moodle.org/plugins/enrol_autoenrol

https://moodle.org/plugins/enrol_auto

Russell England
  • 9,436
  • 1
  • 27
  • 41
  • Only student can register from registration form. Once they log in we need to redirect to custom page depend on "student" role. – stefun Oct 04 '16 at 06:36
0

We need to change some settings in admin to achieve this.

In Administration > user' >Permissions>Define roles`

Edit student role :

change Role archetype to None.

For Context types where this role may be assigned enable system.

In Site administration > Plugins > Enrolments > Self enrolment

Change Default role assignment Invalid current value to student

More details here : https://moodle.org/mod/forum/discuss.php?d=170956

stefun
  • 1,261
  • 3
  • 24
  • 54
  • In [MDL-26805](https://tracker.moodle.org/browse/MDL-26805) issue, it said such approach is not recommended. – Raptor Nov 07 '22 at 09:14