Maintained by Eoin Campbell
This plugin allows administrators add the "Course meta link" and "Cohort sync" enrolment methods to a range of courses from a CSV file. They can also delete, enable or disable existing enrolment methods in a course.
55 sites
7 fans

This plugin is an enhanced version of the Upload Metacourse links block plugin on which it is based. It also provides a good work-around for a long-standing issue with the Course upload facility whereby enrolment methods are not fully supported.

Use the command Site administration > Plugins > Enrolments > Upload enrolment methods to upload a CSV file containing lines of the form:

operation, enrolment method, target course shortname, parent course shortname or cohort idnumber, disabled, group

e.g.

;operation,method,shortname,parent course shortname or cohort idnumber,disabled,groupadd,meta,CS101-2345,Computing-Year3,1,CS101upd,meta,CS101-2344,Computing-Year1,0,CS101

Lines beginning with a '#' or ';' character are comments, and skipped.
Each line of the file contains one record.
Each record is a series of data in a fixed order separated by commas.
All fields are required.
The allowed operations are add, del(ete), and upd(ate).
The allowed methods are 'meta' and 'cohort'.
The allowed disabled status values are 0 (enabled) and 1 (disabled).
The group field is the name of a group into which enrolled students should be placed. It will be created if it doesn't already exist.

This plugin enhances the original in that it is possible to disable existing enrolment methods in batch mode, and also that it can add an enrolment method to a course but leave it disabled.

### Awards

• Tue, Apr 17, 2018, 12:00 AM
Approval issue created: CONTRIB-7263
• Thu, Jul 12, 2018, 10:01 AM
Just what we've been looking for - many thanks!
• Fri, Jul 20, 2018, 8:51 PM
I have been asking for this many, many years. And if Moodle wants to be a LMS that operates in a landscape of other educational tools, they'd better fix there webservice to do this to (add cohorts to a course). Thanks!
• Tue, Oct 23, 2018, 9:11 PM
Improvement suggestion: I think the US uses comma delimited files (csv) where Europe uses ; to mark the difference in fields. Where csv upload in Moodle is possible, you can usually select which delimiter to use. In this plugin I can not choose so I always end up saving the file from Excel, opening it in a text editor en search replace ; for ,
• Thu, Oct 25, 2018, 4:13 AM
This is a nice idea, Moodle has a CSV library to allow this, and also make CSV files position independent by using a heading row. Might get to it sometime.
• Sat, Feb 9, 2019, 12:39 AM
Very nice plugin. Is it possible to add a field to define the course role like "student" or "teacher"?
• Thu, Feb 14, 2019, 5:33 PM
Hello,
When I try to deploy my csv, I always have this error (Note : I have 6 columns in my file) :
Ligne 1: Too few columns, expecting 6. Sauté.
Ligne 2: Too few columns, expecting 6. Sauté.
Have you an idea ?
Thanks
Alain
• Fri, Feb 15, 2019, 1:02 AM
You must use a comma as the separator, not a tab. You should only have 5 commas per line, and if there are any commas in fields such as a the course shortname, then the field must be enclosed in double quotes.
• Fri, Feb 15, 2019, 1:04 AM
To Mesut: thank you, I find it really useful for adding meta-courses to multiple courses in the same programme of study. Unfortunately it doesn't allow specification of the role, as I assume it's always students. Why would you want something different?
• Mon, Feb 25, 2019, 5:36 PM
Hello,
Thank you, it's ok with comma !
But I still have an error message ("Line 1 [operation enrolment method]: Invalid operation.") but however creation is ok.
Alain

• Wed, Feb 27, 2019, 6:38 AM
Note that if your first line contains field headings, you need to comment them out with a '#' or ';' character as the first character on the line.
• Sat, Apr 6, 2019, 1:48 AM
I was wondering if the Group field is now working. This would be extremely useful.
• Sat, Apr 6, 2019, 3:23 AM
The group field is supported, the documentation was out-of-date.
• Sat, Apr 6, 2019, 8:04 AM
Yes! it does work I just uploaded more than 2000 relationships and it worked like a charm. Thank you very much for the effort put into this!
• Thu, Apr 11, 2019, 10:42 AM
I was wondering, as @Mesut Aydemir asked, how would you do if you wanted to sync Teacher cohorts. Working with hundreds of courses, transferring teachers automatically would be way easier by cohort sync.