Moodle and Totara

Watershed can receive data from any xAPI conformant Activity Provider. Many Watershed cards are flexible and you can configure Watershed to display useful visualizations and metrics from almost any xAPI data set. To help you get the most out of your data, we’re working with a number of product vendors to ensure that the data they send is optimized to produce the best possible results in Watershed. We want to help you to configure Watershed cards in the best way possible to display that data.

This guide tells you how to correctly setup up xAPI tracking in Moodle, connect Moodle to Watershed and then configure Watershed to get the best results. As Totara is built on Moodle, this guide works for Totara too.

This guide has 3 sections:

Moodle xAPI plugins

Out of the box, Moodle LMS includes only basic functionality which is then extended by the installation of plugins. Moodle’s xAPI tracking is no exception to this modular approach and there’s three plugins that you should install on your Moodle in order to get started with xAPI in Moodle.

You should make sure that you keep up to date with the latest versions of each plugin. There are dependancies between the plugins, so you should install them all even if you do not plan to use them all. Also make sure that cron is running regularly on your Moodle. See https://docs.moodle.org/30/en/Cron.

You also need to ensure that your server is configured to allow the PHP functionality required for it to communicate with Watershed's API. For example fopen will need to be enabled using the allow_url_fopen setting in your php.ini file. 

Let’s look at those three plugins in detail.

xAPI Launch Link

The xAPI launch link offers a way to launch xAPI learning experiences such as those created in common authoring tools like Storyline. It supports launch of either content hosted anywhere on the internet, or zip packages uploaded to Moodle. The plugin will launch the content, telling the content to send data to Watershed.

You can download the latest version from the Moodle plugins directory. Be sure to keep the plugin updated regularly to ensure you have the latest features and updates. Ask us if you need any help with the installation and see below for instructions on how to populate the LRS settings.

The ability to launch xAPI content is a core feature of any LMS claiming xAPI support.

Logstore xAPI

The Logstore xAPI plugin enables tracking of activity within Moodle itself including page views, assignment submissions, quiz attempts and question answers. This means you can now report on this LMS activity alongside your other learning data.  

You can download the latest version from the Moodle plugins directory. Be sure to keep the plugin updated regularly to ensure you have the latest features and updates. Ask us if you need any help with the installation and see below for instructions on how to populate the LRS settings.

Watershed Plugin

The Watershed plugin contains integrations specific to Watershed LRS, including SSO, person association and Intelligent Card Creation. The SSO integration adds a link to Moodle's Reports menu for users that have the 'Watershed Report Link' capability (managers and admins by default). The person association feature adds a scheduled task that will associate personas (email accounts and Moodle accounts) with a single Watershed person so that individuals can be reported on as one even if xAPI data identifies them in different ways. Intelligent Card Creation is another schedules task that will create a collection of Watershed report cards for the most active X Moodle courses (X is configurable). These cards are created on a special 'Moodle' dashboard that's managed automatically by Moodle to keep them separate from the cards you create yourself. 

You can download the latest version from the Moodle plugins directoryInstalling Moodle plugins manually at the server for installation instructions. 

Connecting to Watershed

With the plugins installed, you now need to connect to Watershed. Each plugin has it’s own separate settings so will need to configure them separately. 

Before configuring the Logstore plugin, you’ll need to add an activity provider for each plugin to Watershed and make a note of the endpoint, key and secret. You should ensure that API Access is enabled for the Activity Provider you create for the Launch Link and the Watershed plugins; the Logstore plugin does not require API Access.

xAPI Launch Link

The settings for the launch plugin can be found at Site administration > Plugins > Activity Modules > Tin Can Launch Link

Enter the Endpoint (the LRS endpoint value from Watershed), Username (the ‘Key’ in Watershed) and Password (Watershed’s ‘Secret’).  Choose 'Watershed' as your LRS integration.

The remaining settings have clear help text and can normally be left as default if you are unsure. 

Once populated, these settings will be used for any xAPI activity you create unless you choose to override these defaults.

Logstore xAPI

The settings for the log plugin can be found at Site administration > Plugins > Logging > Logstore xAPI

Enter the Endpoint (the LRS endpoint value from Watershed), Username (the ‘Key’ in Watershed) and Password (Watershed’s ‘Secret’). 

For best performance, make sure that Send statements by scheduled task? is ticked. If this setting is unticked, individual statements will be sent every time a learner interacts with Moodle. If you have a lot of active learners, this will affect Moodle’s performance.

Watershed Plugin

The Watershed plugin is configured in two places:

  • A config.php file in the plugin folder contains the settings relating to SSO. An example config file named config-dist.php is included in the plugin. We recommend that you use this as a starting point and rename it config.php.
  • Plugin settings within Moodle that contain the settings relating to person association and Intelligent Card Creation. 

The table below outlines the settings you need to edit in the config.php file in the plugin folder. 

Setting Details
moodleurl The full URL of your Moodle site
moodlepath The path to your Moodle directory. For example if your Moodle is hosted at https://www.example.com/moodle then the path your be 'moodle'. If your Moodle is hosted at https://moodle.example.com then the path is ''. 
watershedurl The URL of the Watershed instance you are using. Normally this is either https://sandbox.watershedlrs.com or https://watershedlrs.com
orgname The short name of your organizartion in Watershed. You will need to ask us to provide this. 
orgid The id of your organization in Watershed. The organization id is included within the Watershed LRS Endpoint URL. For example if the endpoint URL ishttps://watershedlrs.com/api/organizations/1234/lrs/ then the organization id is 1234. 
apiuser The username of the Moodle API User you created when setting up the xAPI Launch Plugin.  
apipass  The password of the Moodle API User you created when setting up the xAPI Launch Plugin.  

The settings for the Watershed plugin can be found at Site administration > Plugins > Reports > Watershed Report Link. The table below explains each of the settings. 

Setting Details
Server Whether you are using Watershed sandbox or production servers. 
Organization id The id of your organization in Watershed. The organization id is included within the Watershed LRS Endpoint URL. For example if the endpoint URL ishttps://watershedlrs.com/api/organizations/1234/lrs/ then the organization id is 1234. 
Key The Watershed Activity Provider key.
Secret The Watershed Activity Provider secret.
Number of courses

Moodle will create report cards for the most active X courses based on data from the last month. Configure the number of courses Moodle will create cards for here. 

Until

This field is used for debugging and demo Moodle sites where there is no new data after a certain date. Leave this field blank on production Moodle sites. 

There are some SSO settings in Watershed that need to be completed too. These settings are only accessible to the Watershed team, so you will need to work with us to set this part up.

As part of this process you will need to obtain or create a key and certificate for SSO. An example key and certificate are included in the plugin simplesamlphp/cert folder. These will work, but for security reasons it is strongly recommended that you do not use these.

Moodle quiz settings

To get the most out of Moodle quiz tracking, it’s important to ensure that the quiz is configured correctly. In particular you should ensure that the following settings are complete and correct:

  • ‘Grade to pass’ in the ‘Grade’ section of the quiz settings.
  • ‘Maximum Grade’ in the top right corner when editing the quiz.
  • Grades of each question (these default to 1).

Make sure that the total of all the question grades is equal to the maximum grade and that the grade to pass is equal to or lower than that. Don’t make your quiz impossible to pass or score 100%!

Please note: Moodle supports a large and extensible number of question types, not all of which work well with the xAPI Logstore plugin. If you’re going beyond simple multichoice and true-false questions, be sure to test data from your quiz carefully before going live. Grading of questions that are not automatically graded will not be reported by the plugin.

Moodle assignment settings

If using Moodle assignments, be sure to populate the Grade settings section, especially the Maximum points and Grade to pass fields.

Configuring cards for Moodle data

Once you have connected Moodle to Watershed and data is flowing in, you can start to create report cards in Watershed. The launch plugin could be used to launch any type of content so we can’t provide specific guidance around the data it will output here. This section offers guidance on reports you can create to explore data from the Logstore plugin, in addition to those automatically created via Intelligent Card Creation. 

Quizzes and Assignments

Data from Moodle quizzes and graded assignments is best represented using the the Activity Card. Simply create a new Activity Card, searching for the quiz or assignment name in the Activities filter.

Key questions answered: How did learners and groups do on a quiz or assignment? How effective are particular quiz questions?

 

Please note: data about assignments is not sent to watershed until the assignment is graded. Data about quizzes is sent as soon as the quiz is submitted (or whenever cron runs next).

 

Other activity

Other Moodle activity is not tracked with the same level of detail as quizzes and assignments and the data is restricted to measuring level of activity in Moodle. Here cards that use measures (such as the Leaderboard) are most useful. Using simple configuration, you can use the Statement Count, Unique Activity Count and Timeline measures organized by person, activity or time frame.

Using Advanced configuration you can create custom measures specific to different Moodle events.

Measure

JSON

View count

The number of times things were viewed on the Moodle.


Use Unique Activity Count with a verbIds filter to count the number of things viewed.

{
  "name": "View Count",
  "valueProducer": {
    "statementProperty": "verb.id",
    "type": "SIMPLE_IF",
    "match": "http://id.tincanapi.com/verb/viewed"
  },
  "aggregation": {
    "type": "COUNT"
  }
}

Launch count

The number of times SCORM and xAPI learning experiences were launched.


Use Unique Activity Count with a verbIds filter to count the number of things launched.

{
  "name": "Launch Count",
  "valueProducer": {
    "statementProperty": "verb.id",
    "type": "SIMPLE_IF",
    "match": "http://adlnet.gov/expapi/verbs/launched"
  },
  "aggregation": {
    "type": "COUNT"
  }
}
Key questions answered: Which parts of Moodle are most popular? Which learners are most active? How does usage change over time?
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

If you can't find what you need or you want to ask a real person a question, please contact customer support.