Enrolment Method by Profile Fields

Re: Enrolment Method by Profile Fields

by MAG II -
Number of replies: 15

Hello - 

Did anyone ever figure out a solution for this? I downloaded the Enrol by User Profile Field plugin in the hopes that I can distinguish students who are to be auto-enrolled into a course. 

I installed the latest version of the plugin, and the configurations are nowhere to be found. I have searched all through enrollment methods within a course and can't find anything relating to this plugin anywhere. It appears in the list of installed plugins in Site Administration.

Does anyone have any suggestions?

In reply to MAG II

Re: Enrolment Method by Profile Fields

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

After installing the plugin you must do the following.

  1. Enable the plugin on the Enrolment methods page (e.g. http://localhost/m35/admin/settings.php?section=manageenrols).
  2. Create custom profile fields in the User profile fields page (e.g. http://localhost/m35/user/profile/index.php), because the plugin doesn't work with the built-in profile fields.
  3. Configure the plugin to select all the custom profile fields that you want to enrol based on (see http://localhost/m35/admin/settings.php?section=enrolsettingsattributes).
  4. When you go to the enrolment methods page for a course (e.g. http://localhost/m35/enrol/instances.php?id=3), and click on the Add method drop-down field, then you will see the method "Enrol by user profile field" available in the list.

In reply to Eoin Campbell

Re: Enrolment Method by Profile Fields

by altan ahmet -
Hi Eoin

Im using the enrolment by user profile fields plugin. Ive got as far as enabling the plugin, and I'm stuck on creating custom profile fields. Your url links dont seem to be working ? Are you able to help with the url links you have posted please ? Some examples would be great in helping me understand what I need to do.

I'm looking to set up an enrolment for a specific course based on an email address ending ( .gov.uk ) using the enrolment by user profle fields. will I be able to set up a user profile field using an email address ending ?
In reply to altan ahmet

Re: Enrolment Method by Profile Fields

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Ahmet, the links I included were examples, for a local test Moodle 3.5 installation. The enrol by Profile field method won't help with what you want. Firstly, it works only with custom profile fields, and email address is a built-in field. Secondly, it doesn't support regular expressions such as *.gov.uk, so you can't use it to specify generic email addresses.

I don't know of any method which would automatically enrol a user on a specific course based only on their email address domain.

Average of ratings: Useful (1)
In reply to Eoin Campbell

Re: Enrolment Method by Profile Fields

by altan ahmet -

Thanks Eoin

I suppose I'll have to stick to manual enrolments 


Cheers

In reply to MAG II

Re: Enrolment Method by Profile Fields

by Jaswant Tak -

In the plugin setting you need to select atleast one field to make it visible under Course Enrollment Dropdown.

Cheers

Jaswant

In reply to Jaswant Tak

Re: Enrolment Method by Profile Fields

by Aaron Cauchi -
not sure if appropriate forum

I created a custom profile field which is registration date. I want to use this profile field to enrol users to a specific course but they must be already registered for more than two years from present month and year (today's date) to be able to do course. Can you assist as what to language or formula to use? I tried using Now()) > 24 and also TODAY() - 730 > date but to no success.

Appreciate any help
In reply to Aaron Cauchi

Re: Enrolment Method by Profile Fields

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Profile field won't do this, but an approach using the Moodle course completion feature and the custom plugins AutoEnrol and  Course completed enrolment should work.
  1. Automatically enrol new students in a special 'duration' course "Year 1 complete" using AutoEnrol.
  2. Set a course completion rule for the 'duration' course that students complete it after they have been enrolled for 1 year.
  3. After 1 year, students who have completed that course are automatically enrolled on the 'duration' course "Year 2 complete" (using custom  "Course completed enrolment" plugin).
  4. Set another course completion rule for the year 2 course that students complete it after they have been enrolled for 1 year.
  5. After a student has been enrolled in the Year 2 course for 1 year, they meet the criteria for enrolling them on the target course, and you can use the same custom plugin " Course completed enrolment" to enrol them in the target course.

Average of ratings: Useful (2)
In reply to Eoin Campbell

Re: Enrolment Method by Profile Fields

by Aaron Cauchi -
Hi Eoin,
thanks for the solution but actually it is not the solution I am looking for as it does not work that way. Following is the whole scenario:

Hospital setup, Nursing eLearning Platform, nurses register to access platform but Administrator (me) activates the account after double checking user fields correctly filled in (cross check student profile with our HR Database). Also an extra custom field is filled in by the Administrator which indicates day employee started working in Hospital. There is a probation period of 2yrs before he/she can apply to participate in specific courses.

There is a gatekeeper course which one has to register and participate in consisting in a Quiz. Successful candidates can then access the other courses (the after two year ones). This gatekeeper course can be accessed only if the employment date = 2yrs from today. So I need something to calculate and filter student credentials if they satisfy the two years period based on the specific date of this custom field, be it today or in a year's time.

Your solution will not work in our case as a nurse might decide to enrol today while another one who graduated on same date might decide to enrol in a year's time and therefore the year of one will start on their enrolment date and not on their official employment date.

Hope am clearer as what solution I am looking for
In reply to Aaron Cauchi

Re: Enrolment Method by Profile Fields

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

In this case, you can manually enrol a new student into the "Year 1 complete" course, and then set their enrolment start date to be the date of the start of their employment afterwards. When first enrolling a student on a course, Moodle won't let you specify an arbitrary start date, but after you enrol them, you can go to the course participant page and override their default enrolment date to set any date you like in the past or future. Click on the gear icon in the status column of the enrolled student row, and change the date (see screenshot). 

I assume that the course completion rule will abide by the override date you set, rather than the real date of enrolment, when calculating how long the student has been enrolled on the course, but I haven't tested this.


Average of ratings: Useful (1)
In reply to Eoin Campbell

Re: Enrolment Method by Profile Fields

by Aaron Cauchi -
Dear Eoin,

seems what I needed is getting out of the box. Your approach worked perfectly. Have setup a category where all courses in it (different specialised courses) are bound to one intro course. Such course is available only from the enrolment date I setup for such individual. As I have to manually activate each and every account that registers on the platform (pre-vetting) and I have access to the employment date I  can do the settings for each individual on registration approval. Yes it might be a bit painstaking especially if you have a group of around 30 registering at one go but it is manageable. 

It would have been a cherry on the cake if I can bulk upload employees in the pre-course (which i do) but also upload the enrolment date too. Seems this is not possible, correct?

Thanks for the method and effort in assistance.

Keep Safe


Attachment registration.gif
In reply to Aaron Cauchi

Re: Enrolment Method by Profile Fields

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Aaron,

I believe you should be able to set the enrolment date in the "Upload users" CSV file you use for provisioning, see https://docs.moodle.org/39/en/Upload_users#Enrolment_fields for details, e.g.

course1,type1,role1,enroltimestart1
Year 1 Complete,student,2020-06-23

In reply to Eoin Campbell

Re: Enrolment Method by Profile Fields

by Aaron Cauchi -
Yes, in fact realised I can do that after I answered the post. Is this the flat file CSV enrolment method or I can use the normal Upload Users csv method?
In reply to Eoin Campbell

Re: Enrolment Method by Profile Fields

by Aaron Cauchi -
actually that is the enrolment date FOR A COURSE. I need to update the enrolment date of the individual
In reply to Aaron Cauchi

Re: Enrolment Method by Profile Fields

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
I left out the required fields for the Upload users CSV file format, I should have said:
username,firstname,lastname,email,course1,type1,role1,enroltimestart1
jbloggs,Joe,Bloggs,jbloggs@example.com,Year 1 Complete,student,2020-06-23

Note that the enroltimestart1 field can be in the past or the future. In your case, if you are updating an existing user rather than creating a new one, you can probably leave out the firstname, lastname and email columns.

Average of ratings: Useful (2)