enrolment_N_cohortname not working?

enrolment_N_cohortname not working?

Aditya Dubay發表於
Number of replies: 7

Hi,

I am using Moodle 4.4+

First I upload bulk cohorts.

Then I upload bulk courses with column "enrolment_N_cohortname" but it wont reflect on moodle instance.

Dont know why...

shortname fullname category_idnumber enrolment_N_cohortname
vcdddat BVoc I Diploma in Accounts and Taxation vcd BVoc I Diploma in Accounts and Taxation (Demo)

 

Please help.

附件 Screenshot 2024-05-04 160038.png
評比平均分數: -
In reply to Aditya Dubay

Re: enrolment_N_cohortname not working?

Mohammad Nabil發表於
Site administration > plugin > Enrolments >Manage enrol plugins
check if Cohort sync enabled
then add it from enrollment method in your course
in the csv file , use the cohort id as descroped her
https://docs.moodle.org/310/en/Upload_users#Cohort_membership_assignment
In reply to Mohammad Nabil

Re: enrolment_N_cohortname not working?

Aditya Dubay發表於
Thats a manual process I feel enrolment_N_cohortname must be like cohort sync at the time of course creation.
In reply to Aditya Dubay

Re: enrolment_N_cohortname not working?

Leon Stringer發表於
Core developers的相片 Particularly helpful Moodlers的相片

To use enrolment_N_cohortname you must have column enrolment_N set to "cohort".

However, it looks like there's a bug in Moodle 4.4 preventing enrolment_N_cohortname from working (MDL-81792).

In reply to Leon Stringer

Re: enrolment_N_cohortname not working?

Aditya Dubay發表於
I didnt get what you want to say
In reply to Aditya Dubay

Re: enrolment_N_cohortname not working?

Leon Stringer發表於
Core developers的相片 Particularly helpful Moodlers的相片

Well, my reply was wrong. In fact this functionality has changed in Moodle 4.4.

To add cohort enrolment in Moodle 4.4 you must have the following fields in your CSV:

  1. enrolment_1: set to "cohort".
  2. enrolment_1_cohortidnumber: set to the ID for your cohort. This is the value of the Cohort ID field and may not be a number (but must be unique).
  3. enrolment_1_role: set to "student".

So if you set the Cohort ID for BVoc I Diploma in Accounts and Taxation (Demo) to "BVoc 1":

Screenshot of edit cohort page with Cohort ID = "BVoc 1"

Then prepare a CSV file:

shortname,fullname,category_idnumber,enrolment_1,enrolment_1_cohortidnumber,enrolment_1_role
vcdddat,BVoc I Diploma in Accounts and Taxation,vcd,cohort,BVoc 1,student

When you upload this the course will be created with enrolment for the cohort:

Screenshot of course's enrolment methods page showing enrol_cohort instance

評比平均分數:Useful (1)