...
- shortname: The shortname for the course
- fullname: The full name for the course
- idnumber: The ID number for the course
- category: The ID of the category to place the course in. This takes precedence over category_idnumber and category_path.
- category_idnumber: The ID number of the category to place the course in. This takes precedence over category_path.
- category_path: The path of the category to place the course in. If you want to place the course in a category named "Clinical" which is located under the category "Classroom", the value to provide is: Classroom / Clinical. Note that the separator must be [space]/[space]. Also note that the category MUST exist, it will not be created. If you want to place the course in the top-level category "Clinical", the value to provide is: Clinical
- visible: Use the value 1 if the course is visible, 0 if hidden
- startdate: The time at which the course starts. The format should be DD.MM.YYYY. For example, to set a start time of December 1st 2014, use 01.12.2014
- summary: The summary of the course
- format: The course format to use, this must be a valid course format plugin name. E.g. topicsadvanced,singleactivityadv.
- duration: The duration of the course in hours. The format should be hh:mm. For example, to set a duration of 2 hours and 30 minutes, use 2:30 (New in 3.5.8.2)
- showgrades: Use the value 1 to show the gradebook to students, 0 to hide it.
- showreports: Use the value 1 to show the activity reports, 0 to hide it.
- maxbytes: The maximum upload size of the course in bytes. Use 0 for the site limit.
- groupmode: Use the value 0 for No groups, 1 for Separate groups and 2 for Visible groups.
- groupmodeforce: Use the value 1 to force the group mode, otherwise enter 0.
- enablecompletion: Use the value 1 to enable the activity completion, 0 not to.
Enrolment fields
Some fields can be constructed to enable and configure enrolment methods. The fields must be named enrolment_[number] for the enrolment method name, and enrolment_[number]_property for its properties.
- enrolment_[number]: The name of the enrolment method (e.g. manual)
- enrolment_[number]_delete: 1 to delete this enrolment method from the course. If set to 1 all the other properties will be ignored.
- enrolment_[number]_disable: 1 to disable this enrolment method from the course. If set to 1 all the other properties will be ignored.
- enrolment_[number]_startdate: The enrolment start date. This value is passed to the PHP function strtotime().
- enrolment_[number]_enddate: The enrolment end date. This value is passed to the PHP function strtotime().
- enrolment_[number]_enrolperiod: Number of seconds, or if not a value understood by strtotime() such as "4 days".
- enrolment_[number]_role: The role short name
- enrolment_[number]_[property]: Where property is understood by the specified enrolment method
- enrolment_[number]_password: The course enrolment key (if understood by the specified enrolment method)
Note: The "Upload courses" is not compatible with all enrolment methods.
The following is a sample excerpt from a file where you would want to enable "manual" registration but disable "self" registration.
shortname,enrolment_1,enrolment_1_role,enrolment_1_enrolperiod,enrolment_2,enrolment_2_disable
WHMIS,manual,student,1 month,self,1
Role renaming
To rename some roles for a specific course, you can use the following pattern:
- role_[shortname]: The new name of the role [shortname]
The following is a sample excerpt from a file where you would want to rename the student and teacher roles.
shortname,role_student,role_teacher
WHMIS,Apprentice,Master
NOTE: The short name for the teacher role is editingteacher and the short name for the non-editing teacher is teacher.
Course Action Fields
- delete: Use the value 1 to delete the course
- rename: The shortname to rename the course to
- templatecourse: The short name of a course to import the content from
- reset: Use the value 1 to reset the course
...