CMI5 integration


Introduction

CMI5 is the new generation of SCORM. It defines:

  • A packaging format to deploy CMI5 contents into an LMS
  • A launch mechanism which is used when a learner tries to open an elearning content on the LMS
  • A set of statements that elearning contents must send to the LRS

So CMI5 involves 3 components which need to communicate with each other during all the launching process. A soon as a learner tries to open an elearning content on the LMS:

  1. The LMS records some information into the LRS and create a secured token.
  2. The LMS opens the elearning content and gives it some useful information as well as the secured token.
  3. The elearning content communicated with the LRS thanks to the secured token.

If you are in the processes of developing a CMI5 compliant LMS, you have a few options to implement the launch mechanism:

  • Developing an internal LRS for your LMS
  • Using an external LRS and developing a LRS proxy on your LMS
  • Making a custom integration with an external LRS

All these options have their own benefits and drawbacks which we are not going to detail here. This documentation page focuses on the 3rd option, showing how you can make a custom integration between your LMS and TRAX LRS to support CMI5. Indeed, TRAX LRS provides all you need for make this kind of integration:

Token delivery API

In order to allow the LMS to communicate with TRAX LRS, you must create a client in TRAX LRS and give it the xapi/all and cmi5/tokens permissions. Then, the LMS can use the CMI5 Token Delivery API to request a CMI5 token.

Managing tokens lifetime

CMI5 tokens should be automatically deleted at the end of CMI5 sessions. However, this would suppose that elearning contents always send a terminated statement at the end of their session, which is clearly not a reliable assumption as terminated statements are frequently blocked by browsers.

So in order to remove expired tokens, you must configure a CMI5 Tokens Deletion job in TRAX LRS:

  1. Open the Access > API Consumers > CMI5 Tokens Deletion page.
  2. Click on the [+Job] button.
  3. Choose the desired option for Tokens created until (e.g. One hour ago).
  4. Choose the desired option for Scheduling (e.g. Every minute).
  5. Click on the [Save] button.

Be sure that a CRON job is configured for your LRS in order to run the scheduled tasks. Check-out the installation page if you don't know how to to configure it.

Secured endpoint

TRAX LRS provides CMI5 specific endpoints with a set of additional security rules.

Statement API

  • Trying to post a voiding statement will return a 403 error.
  • Trying to post statements with an actor that does not match with the learner agent will return a 403 error.
  • When getting statements, the agent filter will be ignored and only statements with an actor that matches with the learner agent will be returned.

State API

  • Trying to get a state from an agent that does not match with the learner agent will return a 403 error.
  • Trying to get a state from an activity that does not match with the CMI5 activity id will return a 403 error.

Activity Profile API

  • There is no restriction on this API.

Agent Profile API

  • Trying to get an agent profile from an agent that does not match with the learner agent will return a 403 error.

Activity API

  • There is no restriction on this API.

Agent API

  • This API is not available to the CMI5 contents. Trying to get an agent will return a 403 error.

Getting back CMI5 data to the LMS

Single session

At any time, your LMS may need to know the status for a given learner and CMI5 content. You can achieve this with a GET request on the standard Statements API and the following parameters:

Parameter Description
agent The agent having launched the CMI5 activity (JSON encoded).
activity The ID of the CMI5 activity (IRI).
registration The registration ID (UUID).

All recent sessions

If you want to build some reporting features in your LMS, you need to get CMI5 data in a more efficient way. For example, you could get all the statements of the last CMI5 sessions on a regular basis in order to maintain a CMI5 status on the LMS database. You can achieve this with a GET request on the standard Statements API and the following parameters:

Parameter Description
activity Use https://w3id.org/xapi/cmi5/context/categories/cmi5 to target the CMI5 statements.
related_activities Use true because the above activity is in the context of the statements.
ascending Use true to get statements from the older to the newer.
limit To limit the number of returned statements.

The LRS response will include a more property which can be used to get more paginated statements.