Configure xAPI with Totara
  • 05 Jul 2023
  • 3 minutes to read

Configure xAPI with Totara


Article Summary

It is possible to add plugins to Totara so that you can use any xAPI/Tin Can-compliant content you have in a course. This content could be available via a URL or as a package in a zip file, it can then be both integrated into the course and have any actions taken in the activity recorded in an external Learning Record Store (LRS). To achieve this you would also need to add a logstore plugin to Totara that works with an external LRS. Below we will explore how to do both of these things.

xAPI currently requires third-party plugins to work, and is not supported by Totara. These instructions are intended as guidance for those who are happy to proceed with the understanding that the xAPI plugins are not supported by Totara and cannot be guaranteed to work.

Logstore plugin

To set up xAPI with Totara you will need a Totara site and a LRS (Learning Record Store), this is a standalone application which can either be installed locally (for example using the open source tool Learning Locker) or you can pay for one (if you're not comfortable setting this up yourself). Additionally, you will also need two plugins: the Logstore xAPI (Moodle plugin) and the xAPI Launch Link (Moodle plugin).

There are two parts of this setup: the Logstore plugin and then the Launch Link plugin. 

First, you will need to configure the Logstore xAPI plugin as this can transfer events in your LRS. This can only happen once you have installed the plugin on your Totara site (guidance on plugin installation can be found within the plugin). 

  1. Configure your chosen LRS. You should be able to find guidance on this from your chosen provider.
  2. You will need to set up a Client within your LRS. Again, instructions on this should be available from your LRS provider. You may have a client supplied for you when you create the LRS, or you might need to create one.
  3. On your Totara site, go to Quick-access menu > Plugins > Logging > Manage Logstores.
  4. Configure this for your LRS using the Client details from step 2.
  5. Finally, click Save changes.

Tin Can Launcher

You have now configured the Logstore xAPI plugin. If you start performing actions in your Totara site (such as setting up courses and logging in or out), then go into your LRS you'll notice the statements of events will be transferred into your logstore. In the documentation for the Logstore xAPI plugin, you will find a list of all the supported events that will be transferred. 

The second stage is to configure the xAPI Launch Link plugin. This will let you launch compatible xAPI learning from Totara. The steps below take place after the xAPI Launch Link plugin has been installed; instructions on how to do this can be found within the plugin. 

  1. To configure the plugin, go to Quick-access menu > Plugins > Activity modules > Tin Can Launch Link.
  2. Add the Client information (as in the Logstore configuration above).
  3. Click Save changes

You can then go to a course and follow these steps:

  1. On the course, click Turn editing on.
  2. Click Add an activity and select Tin Can Launch Link.
  3. Fill in the details as required (mandatory fields marked with an asterisk).
  4. Click Save changes.

Now you can go to the course and launch the Tin Can/xAPI content you have linked via a package or URL. The details of events carried out in the content (such as launching, attempts made, and completion) will be transferred to your LRS. 

It is highly recommended that you use HTTPS for secure transfer of information when using logstore.

In config

It is possible to allow NGINX and other webservers to log usernames in access logs. When you allow logging by a webserver in the access logs they can send the username as a custom header, which can be logged and stripped out if needed.

To configure this just add the variable $CFG->headerloguser to the config.php file. You can read more about this and possible values in config-dist.php.

© Copyright 2024 Totara Learning Solutions. All rights reserved.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.