Note: You are currently viewing documentation for Moodle 3.7. Up-to-date documentation for the latest stable version of Moodle may be available here: IMS Enterprise.

IMS Enterprise

From MoodleDocs
Revision as of 14:27, 20 May 2010 by Helen Foster (talk | contribs) (text copied from help file)

Location: IMS Enterprise file edit settings link in Administration > Courses > Enrolments


IMS Enterprise is an international standard XML file format which may be used to specify enrolments/unenrolments in courses, as well as course information and user information.

Format overview

Below is a simple guide to the basic structure of a typical IMS Enterprise data file. Much more information is available on the IMS Enterprise official website.

You may like to read the conformance summary which describes which IMS data elements this plugin can process.

Basic guide to IMS Enterprise file format

For any IMS-style enrolment you need a <group> tag which specifies the course, a <person> tag which specifies the user account, and a <membership> tag containing <member> tags which specify a person's role within a given course.

Remember that the numeric keys used in the Moodle databases are not the interoperable data - a student data system is never going to know in advance that Joe is the 20th user added to the Moodle database - so those aren't the keys exchanged in this type of data.

Typically a course would have a reference code as well as a name, so let's assume its code is MOODLE101. To define your course you could use

 <group>
   <sourcedid>
MyDataSystem
     <id>MOODLE101</id>
   </sourcedid>
   <description>
     <short>Moodle 101</short>
   </description>
 </group>

The enrolment script will look for a course with code MOODLE101, and (optionally) create it if it doesn't exist. Similarly for the person - let's assume it's "jmoodle":

<person>
   <sourcedid>
MyDataSystem
     <id>jmoodle</id>
   </sourcedid>
   <userid>jmoodle</userid>
   <name>
     <fn>Joe Moodle</fn>
     <n>
       <family>MOODLE</family>
       <given>JOE</given>
     </n>
   </name>
 </person>

If Joe doesn't already have an account, the script can (optionally) create an account for him.

Let's now look at the membership, adding the person to the course:

 <membership>
   <sourcedid>
MyDataSystem
     <id>MOODLE101</id>
   </sourcedid>
   <member>
     <sourcedid>
MyDataSystem
       <id>jmoodle</id>
     </sourcedid>
     <role roletype="01">
       <status>1</status>
       <extension><cohort>unit 2</cohort></extension>
     </role>
   </member>
 </membership>

The IMS Enterprise specification does offer a facility for specifying start/end dates for enrolments, so those can be included using the <timeframe> tag if needed.

If a person is already added to a group within the course, the script won't actually modify that. If they are not grouped, however, then the specified grouping will be applied.

See also