Restrict User Access based on confirming custom user profile fields

Restrict User Access based on confirming custom user profile fields

by Varun Prabhu -
Number of replies: 3

We have a custom user profile field called permit number. I want to use the restrict access plugin to confirm that a student enters the permit number unique to them before they can access a course. How do I make this happen? For example:

User Cathy has a permit number 12345. User Adam has a permit number 67891. Before entering a course, Cathy should enter 12345 in some text field before gaining access to the course. If she enters any other number, she wouldn't be allowed to enter the course. Same for the user Adam.

Can this be achieved via the plugin or is there any custom code I need to write for this?

Average of ratings: -
In reply to Varun Prabhu

Re: Restrict User Access based on confirming custom user profile fields

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
Could you not just use their permit number as their password?
In reply to Jon Bolton

Re: Restrict User Access based on confirming custom user profile fields

by Varun Prabhu -
Unfortunately no. The client requirement is to specifically have this restriction before they can access the course. They can login with their userid and password and access other courses just fine but for a specific course, this restriction is required.
In reply to Varun Prabhu

Re: Restrict User Access based on confirming custom user profile fields

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers
I have a feeling there is something out of the box that can do this... but this plugin seems to do what you ask:
https://moodle.org/plugins/enrol_attributes

/*rethink*/ actually not quite. Because you want the user to enter the code. 
You might have to write a custom plugin for that.