Looking for up-to-date Help documentation? Documentation for the latest releases of Totara is now available at totara.help!

Visit the new Help site

On this page

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space THM and version 13

...

The text file to upload courses must be a CSV file. It accepts When creating your file you can use the following columns which are divided in two categories, the course information and the course actions.

Course

...

properties

Most of these settings are available on in the settings page of a course, therefore please refer to Course settings for more information.You'll notice course settings. Note that some of the these settings in the table below can be enabled or disabled using either 1 either 1 (enabled) or 0 (disabled). This is useful if you want a certain setting enabled for some of the courses you are uploading but not all of them. If you do not want to change the default setting for any of the courses you are uploading then you would simply not include the field in the file, as none of the fields controlled in this way are mandatory to include in the file. 

Note

Field names must be

...

lowercase

newsitems The maximum upload size of the course in bytes. Use 0 for  Use the following: 0 for no groups, 1 for separate groups, 2 for visible If you wish use 1 otherwise enter 0Course audience visibility can be set using the following: 0 for only visible to enrolled users, 1 for visible to enrolled users and members of selected audiences (audiences will need to be set manually), 2 for visible to all, and 3 for not visible can be set using the following: and face to face/seminar.

By default, the value for coursetype is E-learning. This is only for the scenario where the coursetype field is missing from the CSV file or the field is empty.

Field nameDescription
shortname 

fullname

The

short name of the course which must be unique. This field is mandatory.
fullname The full name of the course, this field is mandatory

course full name.

shortname

The course short name.

idnumber

The course ID number

of the course, this must be unique

.

category 

category

The ID of the category

to place the course in

in the Totara database. This takes precedence

over 

over category_

idnumber and 

idnumber and category_path.

category_

idnumber 

idnumber

The

ID number

idnumber of the category to

place

add the course

in. This takes precedence over 

to.

category_path

.

category_path 

The full path of the category to

place

which the course

in

will be added. If you

want to place the course in a category named 'Science-Fiction' which is located under the category 'Movies', the value to provide is: Movies / Science-Fiction. Note that the separator must be [space]/[space]. If you want to place the course in the top-level category 'Movies, the value to provide is: Movies.
visibleIf you want the course to be visible, set this as 1 or 0 if you want the course to be hidden.
startdateThe time that the course starts. Please note that this value is passed to the PHP function strtotime to generate a timestamp.
summaryThe summary of the course

have a top-level category with the shortname 'Engineering' and a subcategory called 'Machine Learning' to which you want to add the course, then you would set category_path to 'Engineering / Machine Learning'.

visible

If using traditional visibility, set this to 1 to make the course visible, and 0 to make it hidden.

audiencevisible

If using audience-based visibility, the following values apply: 0 for enrolled users, 1 for enrolled users and selected audiences, 2 for all users, and 3 for no users.

startdate

The date on which the course starts, e.g. dd/mm/yyyy.

enddate

The date on which the course ends, e.g. dd/mm/yyyy.

summary

The course summary.

format

The course format

to use, this

. This must be a valid

course format plugin name. E.g. weeks, topics.

format that has been enabled on your site.

theme

The name of the theme the course will be forced to use.

lang 

lang

The default language

to use

for the course.

newsitems

The number of news items to display in the news block when used.

showgrades

If you wish to show the gradebook to learners use 1 or to hide it use 0.
showreports To show the activity report use or to hide is use 0.
legacyfilesTo enable the legacy course files use or to not use these use 0.
maxbytes

Set to 1 to enable learners to view the gradebook, and 0 to hide the gradebook.

showreports

Set to 1 to enable activity reports, and 0 to hide them.

legacyfiles

Set to 1 to enable legacy course files, and 0 to leave it disabled (recommended).

maxbytes

Set the maximum upload size (in bytes) for files within the course. Set to 0 to use the site limit.

groupmode

Set the group mode for the course. Use 0 for no groups, 1 for separate groups, and 2 for visible groups.

groupmodeforce

Set to 1 to force the group mode

,

and to 0 to allow activities to choose the group mode.

enablecompletion

To enable the activity completion use 1 or if you do not wish to use this use 0.audiencevisible

Set to 1 to enable completion tracking for trackable roles, and 0 to disable completion tracking.

completionstartonenrol

Set to 1 to start tracking completion when a user is first enrolled, or set to 0 to only start tracking completion when required by a trackable event.

coursetype

The course type

. Set to 0 for e-learning, 1 for blended,

2 for

...

seminar.

tags

A comma-separated list of tags to add to the course.

Import options

These settings take precedence over the Course process parameters, which relate to what happens to the course such as renaming, templates, and resets.

Field nameDescription

delete

If set to 1 (and the course exists), it will be deleted.

rename

If set to 1 (and the course exists), its shortname will be updated from the CSV file.

backupfile

An absolute path to a backup file to import into the course.

templatecourse

The shortname of a course to import content from.

reset

If set to 1 (and the course exists), it will be reset during this process.

Role renaming

During the course upload, you can rename some roles by using the format role_[shortname] for the column heading, and then the new course short name in the course row. For example:

role_student,role_editingteacher,role_teacher
padawan,master,jedi

This would rename the Learner role (role_student) to padawan, the Editing Trainer role (role_editingteacher) to master, and the Trainer role (role_teacher) to jedi.

Field nameDescription

role_*

For renaming roles in the course, * is the role shortname from the defined role in the database.

Course format options

Field nameDescription

numsections

The number of course sections (for the demo, topics, and weeks formats).

hiddensections

For the demo, topics, weeks formats only.

coursedisplay

For the demo, topics, weeks formats only.

numdiscussions

For the social format only.

activitytype

The type of activity for a course using the single activity format.

Enrolment options

Some fields can be constructed to enable and configure enrolment methods. The fields must be named in the format enrolment_[number] for the enrolment method name, followed by the format enrolment_[number]_property for its properties. 

Field nameDescription

enrolment_

[number]The name of the enrolment method, e.g. manual.enrolment_[number]_deleteIf you wish to delete this enrolment method from the course use 1. If this field is set to 1 then all the other properties will be ignored.enrolment_[number]_disableTo disable this enrolment method from the course set this field to 1. If this field is set to 1, all the other properties will be ignored.enrolment_[number]_startdateThe enrolment start date. This value is passed to the PHP function strtotime().enrolment_[number]_enddateThe enrolment end date. This value is passed to the PHP function strtotime().enrolment_[number]_enrolperiodNumber of seconds, or if not a value understood by strtotime() such as '4 days'.enrolment_[number]_roleThe role short name, e.g. learner.enrolment_[number]_passwordThe course enrolment key.

...

*_*

To set enrolment options, the first wildcard (*) is a digit representing the enrolment instance, and the second wildcard is the name of the setting to set. The following settings can be used: delete, disable, startdate, enddate, enrolperiod, role, and other options presented by the enrolment instance type.

For example, you might have:

enrolment_1,enrolment_1_role,enrolment_2,enrolement_2_startdate
manual,learner,self,20170629

Where In this example, the file is setting enrolment_1 as the manual enrolment method, and the default role as learner. In this exampleThen, enrolment_2 is then set to the self-enrolment method, with a course start date of 2017-06-29 (or the 29th June 2017). 

This information would all come after the mandatory course shortname, fullname, and category, meaning a full example might be:

shortname,fullname,category,enrolment_1,enrolment_1_role,enrolment_2,enrolement_2_startdate
courserestored,Course restored,1,manual,learner,self,20170629
courserestored2,Course restored 2,1,manual,learner,manual,20170530
courserestored3,Course restored 3,1,self,editingtrainer,self,20181212
courserestored4,Course restored 4,1,self,learner,manual,20180107

Note

Upload courses is not yet compatible with all enrolment methods.

Role renaming

During the course upload you can rename some roles by using the format role_[shortname] for the column heading and then the new course short name in the course row. For example:

role_student,role_editingteacher,role_teacher
padawan,master,jedi

This would rename to Learner role (role_student) to padawan, the Editing Trainer (role_editingteacher) to master, and the Trainer role (role_teacher) to jedi.

Course action fields

These settings take precedence over the Course process parameters, which relate to what happens to the course such as renaming, templates, and resets.

...

Field

...

Description

...

Notes about behaviour

The course upload tool uses the restore functionality when you provide it with a backup file, and it does not turn on the Overwrite course configuration option. Settings such as completionprogressonview and numsections are not carried from the backup to the course for this reason. The course upload tool does not force Overwrite course configuration, because half of the settings come from the uploaded CSV file already. It does not take the course settings from the backup unless you check the Overwrite course configuration option.

When providing a backup to use as a template for uploaded courses, the course settings are not taken. They must be provided by the CSV file through the permitted parameters.

If you are using a course backup file and restore it as a new course, you will find that it restores as you expect it to. If however, you navigate to an existing course and select Restore into this course, it will then use the default settings for the restore. You will find when complete that the existing course has retained its settings (completionprogressonview for instance), and not taken those from the backup.

Upload settings

The settings below will appear after you click the Preview button, they allow you to configure the desired settings for the course upload. 

...