Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

By default, a regular instructor can't upload courses. To upload courses, you need to have Administrator or Course Creator permissions. If you do not have those permissions yourself, ask your administrator to upload the courses on your behalf and then make you the instructor for the courses.

The learning environment allows you to upload courses using a CSV file. This is particularly useful during the implementation phase, when you need to migrate courses from your old system to the the Dual Code learning environment. In addition to creating new courses, the Upload Courses functionality may also be used to update or delete courses, or import content from another course.

To upload one or more courses:

  1. Go to Site Administration > Courses > Upload courses
  2. Either drag and drop the CSV file or click the 'Choose a file' button and select the file in the file picker

  3. Select appropriate import options carefully, then click the preview button.

NOTE: It is recommended that you use the "Preview" option to see if any errors were detected in the previewed rows. If you proceed with the upload and there were something wrong detected with a course, it will be ignored.

Valid Upload File for Testing

The text file to upload courses must be a CSV file. Here is an example of a simple valid upload file:

shortname,fullname,category,summary
WHMIS,Workplace Hazardous Materials Information System,Online,This is my summary
Workplace Violence,Preventing Violence in the Workplace,Online,"This is my summary, with a comma"

Notice there are no spaces between the items. It is also very important to notice the last example (Workplace Violence) where the summary text is placed in quotation marks ("This is my summary, with a comma"). This is essential to ensure that the commas in the summary are not interpreted by the course upload tools as the end of a field. Be aware that quotation marks can be used to enclose some fields (such as fullname) but not others (such as shortname).

Creating the File for Import

The CSV file accepts the following columns which are divided in two categories, the course information, and the course actions.

Course Information Fields

Most of those settings are available on the settings page of a course. Please refer to course settings for more information. Field names must be lower-case.

  • 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.
  • 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.

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

Mandatory Fields

  • shortname: This field is mandatory for every operation, with the only exception of creating new courses.
  • fullname: Required when creating a new course.
  • category, category_idnumber, category_path: One of these is required when creating a course. category (with the idnumber of the category in the field) is required when renaming a course.

Import options

To prevent unexpected behaviour, you have to specify what you want the tool to be able to do.

  • Upload mode: This allows you to specify if courses can be created and/or updated.
  • Update mode: If you allow courses to be updated, you also have to tell the tool what to update the courses with.
  • Allow deletes: Whether the delete field is accepted or not
  • Allow renames: Whether the rename field is accepted or not
  • Allow resets: Whether the reset field is accepted or not

Course process

This allows you to specify actions to be taken for every course uploaded.

  • Shortname template: If you are creating courses without a shortname, you can use this field to automatically generate a shortname. This field accepts two placeholders: %i for the ID number, %f for the summary.
  • Restore file: A backup file (.mbz) to import in the course after create/update.
  • Restore from course: The shortname of a course to import content from after create/update.
  • Reset after upload: Whether to reset the course after creating/updating it.

Default Course Values

Those are values that can be set in the web interface for all the fields that are not specified in the CSV file. Note that they are always used when creating a course, but only when specified during update (see Update mode).

Increasing Speed

When importing the content of a backup file, or another course, you are advised to enable the setting keeptempdirectoriesonbackup. This will considerably speed up the process of the upload if you are importing multiple times from the same source.

  • No labels