Skip to content

Configuration

David Pesce edited this page Mar 4, 2026 · 1 revision

Configuration

After Installation, you need to configure the plugin to connect to your Learning Record Store (LRS). Access the settings at Site Administration > Plugins > Logging > Logstore xAPI > Settings or navigate directly to http://your.moodle/admin/settings.php?section=logsettingxapi.

LRS Connection

These settings connect the plugin to your LRS using xAPI Basic Authentication.

Setting Description Default
Endpoint Your LRS xAPI endpoint URL (e.g. https://your.lrs/xAPI/) https://example.com/endpoint/location/
Username LRS basic auth key or username (empty)
Password LRS basic auth secret or password (empty)

Processing and Batches

Controls how and when events are sent to the LRS.

Setting Description Default
Background mode When enabled, events are queued and sent via the Moodle cron task rather than in real-time. This avoids blocking page responses and is strongly recommended. Enabled
Maximum batch size Number of events to process per cron run. 30
Maximum batch size for failed Number of previously failed events to retry per cron run. 15
Maximum batch size for historical Number of historical events to process per cron run. 30
Resend failed batches Automatically retry sending batches that previously failed. Disabled

Tip: If you have a large backlog of events, you can increase the batch sizes to process them more quickly. Keep in mind that larger batches use more memory and may cause timeouts if your LRS is slow to respond.

Actor Identification

Controls how Moodle users are identified in xAPI statements.

Setting Description Default
Identify by email (mbox) Use the user's email as the actor identifier using the mbox format. When disabled, the account format is used instead. Disabled
Send full name Include the user's full name in the actor field. Enabled
Send username Include the Moodle username in the actor field. Disabled
Account homepage The homepage URL used with the account identifier format. Your Moodle site URL

Statement Content

Fine-tune the content of the generated xAPI statements.

Setting Description Default
Use short course ID Use the short course name (idnumber) instead of the full course URL as the activity ID. Disabled
Send ID number Include the course/activity ID number in the statement. Disabled
Context platform The platform value sent in the statement's context field. Moodle
Send response choices Include answer choices in quiz/question response statements. Disabled

Notifications

Configure alerts when errors occur during statement delivery.

Setting Description Default
Enable notifications Send notification emails when errors accumulate. Enabled
Error notification trigger Number of errors that must accumulate before a notification is sent. 10
Cohorts Moodle cohorts whose members will receive error notifications. (none)
Additional email addresses Extra email addresses to notify (comma-separated). (empty)

Filters

Control which events and users generate xAPI statements.

Setting Description Default
Log guest access Include guest user actions in xAPI statements. Disabled
Event routes Select which Moodle events should be processed and sent as xAPI statements. All supported events are enabled by default. See Supported Events for the full list. All enabled

Reports

The plugin provides two built-in report pages, accessible from Site Administration > Plugins > Logging > Logstore xAPI:

  • Error log — View events that failed to send to the LRS, with details about the error.
  • Historical events — Manage and monitor the processing of historical events (events that occurred before the plugin was installed).

Processing Historical Events

If you want to send events that occurred before the plugin was installed, you can insert them into the plugin's processing queue. The plugin uses a mdl_logstore_xapi_log table to queue events for background processing.

To queue historical events, run an SQL query like:

INSERT INTO mdl_logstore_xapi_log
SELECT * FROM mdl_logstore_standard_log

You can add a WHERE clause to limit the date range. For example, to process events from January 1–2, 2024:

INSERT INTO mdl_logstore_xapi_log
SELECT * FROM mdl_logstore_standard_log
WHERE timecreated BETWEEN 1704067200 AND 1704153600

The queued events will be processed the next time the Moodle cron runs. You can also trigger cron manually and adjust the Maximum batch size for historical setting to control throughput.

Clone this wiki locally