IMS Enterprise

About IMS Enterprise

IMS Enterprise is an international standard XML file format which may be used to create and update user accounts, enroll and unenroll users from courses, assign roles, create courses and course categories, and update course full and short names.

Using this enrollment method

To use IMS Enterprise enrollment, it must be enabled in ‘Manage enroll plugins’ in the Site administration.

IMS Enterprise enrollment will import an XML file from on your LMS server. Set “File location” to the full path to your xml file (locally on the server, e.g. /home/user/imsenterprise/file.xml)

IMS Enterprise is not added to courses, but instead, you run the import directly from the “Site administration > Plugins > Enrollments > IMS Enterprise file” page. To do this, click the “perform an IMS Enterprise import right now” link or run cron.

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 enrollment, 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 LMS databases are not the interoperable data – a user data system is never going to know in advance that Joe is the 20th user added to the LMS 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 LMS101. If you require a new course to be placed in a category other than the default, you can specify that using the <orgunit> tag. To define your course you could use

 <group>
   <sourcedid>
     <source>MyDataSystem</source>
     <id>LMS101</id>
   </sourcedid>
   <description>
     <short>LMS 101</short>
     <long>LMS 101: Course Name</long>
   </description>
   <org>
     <orgunit>CATEGORY</orgunit>
   </org>
 </group>

The enrollment script will look for a course with code LMS101, and (optionally) create it if it doesn’t exist, the plugin also allows you to map between group tags and the course shortname, full name and summary fields. Similarly, for the person – let’s assume it’s “jlms”:

<person>
   <sourcedid>
     <source>MyDataSystem</source>
     <id>jlms</id>
   </sourcedid>
   <userid>jlms</userid>
   <name>
     <fn>Joe LMS</fn>
     <n>
       <family>LMS</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>
     <source>MyDataSystem</source>
     <id>LMS101</id>
   </sourcedid>
   <member>
     <sourcedid>
       <source>MyDataSystem</source>
       <id>jlms</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 enrollments, 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.

Automatic creation of new courses

If required, the IMS Enterprise enrollment plugin can create new courses for any it finds in the IMS data but not in LMS’s database.

Courses are first queried by their “idnumber” – an alphanumeric field in LMS’s course table, which can specify the code used to identify the course in the Student Information System (for example). If that is not found, the course table is searched for the “short description”, which in LMS is the short course identifier as displayed in the breadcrumbs etc. (In some systems these two fields may well be identical.) Only when that search has failed can the plugin optionally create new courses.

Any newly-generated courses are HIDDEN when created. This is to prevent the possibility of users wandering into completely empty courses that the instructor may be unaware of.

Unenrolling users/instructors

If required, the Enterprise data can add as well as remove course enrollments – for users and for instructors. If this setting is turned on, then LMS will carry out unenrollments when specified in the data. Note, as of LMS, you must use IMS Enterprise to remove members that have been added by the plugin. You cannot manually delete a member.

There are three ways of unenrolling users within the IMS data:

  • A <member> element which specifies the given user and course, and with the “recstatus” attribute of the <role> element set to 3 (which means “delete”). THIS IS NOT YET IMPLEMENTED IN THE LMS PLUGIN.
  • A <member> element which specifies the given user and course, and with the <status> element set to 0 (which means “inactive”).

The third method is slightly different. It does not require this config setting to be activated, and can be specified well in advance of the unenrollment date:

  • A <member> element which specifies a <timeframe> for the enrollment can specify the begin and/or end dates for enrollment of this particular user. These dates are loaded into LMS’s enrollment data table if present, and so after the end-date, a user will no longer be able to access that particular course.