Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Gradebook import

From MoodleDocs

Introduction

This document is for developers wanting to allow users to import Moodle grade information in a format that is not currently supported by Moodle. Here is another document if you are looking for an introduction to importing grades into Moodle

Moodle allows authorised users to import grade information. This can be used to transfer student grades from another piece of software into Moodle.

Since 1.9 the Moodle gradebook has provided support for the addition of plug-in import modules to allow Moodle to import grade information in new or custom formats. Moodle includes two default gradebook import modules, csv and xml.

This document describes how to implement a custom gradebook import plug-in.

Getting started

The gradebook import modules are located in the grade/import directory. To create a new gradebook import module complete the steps listed below.

Note: For the remainder of this topic when you see [newimport], replace it with the short name you chose for your export. Do not include the []. Moodle comes with the following import modules: csv and xml so you cannot use those names.

New Gradebook Import Creation Steps

  • Decide on a short name for this new import module. This name will be referred to as [newimport] in this document.
  • Create a new directory in Moodle's grade/import directory for your files.
  • Review the import formats that ship with Moodle and choose the import format most like the one you wish to develop. Refer to that import's files as needed.
  • Copy the files from the import format you selected into your newly created directory of grade/import/[newimport]
  • Alter each of the files listed below.
  • Click on Notifications link in the Site Administration menu to go through the upgrade process (if one didn't happen automatically) and set up the permissions for your import module.
  • Test, test, test - until your import module performs properly.

See also