Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: Enrol Sync: Course creation file.

Enrol Sync: Course creation file

From MoodleDocs

Back to index

This file allows asking the "course deletion tool" to remove massively courses in Moodle.

A report file is generated after execution of the test in the special sync file cabinet at the following location:

sync/reports

This file can be retrieved using the embedded file manager.

File format

Course bulk creation allows creating several course in a single operation. This tool is highly inspired from the bulk course creation standard feature with some minor enhancements.

Expected file is a CSV file containing one course definition per row. All course attributes can be setup in the file. Missing attributes will receive default value from hard values or from "course default settings". First row must specify the column names.

A special new column 'template' can specifiy a course shortname where a restorable backup is available to serve as course model. In this case, the values of the course attributes will override the initial setup stored into the backup.


Column name Value
category [Forward]Slash-Delimited Category "Path" String (new categories are created as necessary) OR Integer Database Category ID
cost String(10)
enrolperiod Integer/Seconds
enrollable 0=FALSE,1=TRUE
enrolstartdate String Date Literal
enrolenddate String Date Literal
expirynotify 0=FALSE,1=TRUE
expirythreshold Integer Value Between 10-30
format String('social','topics','weeks')
fullname String(254)
groupmode 0=NOGROUPS,1=SEPARATEGROUPS,2=VISIBLEGROUPS
groupmodeforce 0=FALSE,1=TRUE
guest 0=NO,1=YES,2=WITHKEY
idnumber String(100)
lang String(10)
maxbytes Integer(Site Max)
metacourse 0=FALSE,1=TRUE
newsitems Integer(10)
notifystudents 0=FALSE,1=TRUE
numsections Integer(52)
password String(50)
shortname String(15)
showgrades* 0=FALSE,1=TRUE
showreports 0=FALSE,1=TRUE
sortorder Integer
startdate String Date Literal
student String(100)
students String(100)
summary Text
teacher String(100)
teachers String(100)
teacher[1,2,...]_account Search String that returns only one User Account (as used in <a href="user.php" target="_blank">Administration » Edit user accounts</a> OR Integer Database User ID
teacher[1,2,...]_role String(40)
template String
theme String(50)
timecreated String Date Literal
timemodified String Date Literal
topic0 [main heading], topic1 ... topic52 [topic/week headings] Text
visible 0=FALSE,1=TRUE


Quotes separating several information in a field should be encoded as &#44.

Boolean switches should always be expressed as 0/1 for true/false meaning.

File Sample

  fullname, shortname, category, summary, teacher, teachers, student, students, startdate, visible, groupmode, password, teacher1_account, teacher1_role
  Course 1, import01, /COURS/Unit1, Imported course, Lecturer, Lecturers, Drunkard, Drunkards, 1-Apr-09, 1, 0, , ,
  Course 2, import02, /COURS/Unit1, Imported with passord, Lecturer, Lecturers, Drunkard, Drunkards, 1-Apr-09, 1, 0, mdp, ,