Sending Moodle activity to an LRS with xAPI

Stream Moodle course views, quiz attempts, submissions and forum posts to a Learning Record Store as xAPI statements using the Logstore xAPI plugin, planned around batching, LRS choice and privacy review.

On this page

Why send Moodle activity to an LRS with xAPI

Teams that want Moodle learning activity in a Learning Record Store they control, rather than only in Moodle's own reports, can do it with the community Logstore xAPI plugin (logstore_xapi). The plugin sends events such as course views, quiz attempts, assignment submissions and forum posts to the LRS as xAPI statements, and it batches them through a scheduled task. Its listed support covers Moodle 4.1 to 5.2, so confirm that your target release appears in that range before you commit to a version.

An LRS is a store built to receive and query statements that describe who did what, in which activity, and when, in a format that other systems can read. Moodle's own logs record events inside the Moodle database and are tuned for administrators working within Moodle. Once activity is in an LRS, the same record can feed reporting, analytics or other learning tools without each of them querying Moodle directly. The trade-off is that the LRS becomes a second system holding learner activity, so its hosting, retention and access rules need the same review as Moodle itself.

Before you enable anything, decide which events leave Moodle, who can read the statements in the LRS, and how long they are kept. Ask the plugin's maintainer and your LRS vendor which statement profiles and verbs are supported, and confirm that the scheduled task runs reliably on your Moodle cron setup. Treat the first paragraph of decisions as the scope for the privacy review described later, because every event type you send is a data flow that needs a documented purpose.

What you need before connecting Moodle to an LRS

The Logstore xAPI plugin sits between Moodle's log store and your Learning Record Store, so the work depends on the Moodle release, the cron host, the LRS endpoint and the people who sign off on learner data. Clear these five items before installing anything, because each one decides whether statements arrive reliably and whether the data can be defended later.

Confirm the exact Moodle release

The plugin's directory listing states support for Moodle 4.1 to 5.2. Check the plugin version against the precise Moodle build in use, not just the major release, and confirm it against the plugin's listing before you plan the upgrade path. Moodle 5.1 and 5.3 also raise server requirements (PHP, database and web server layout), so an upgrade may change compatibility. Confirm support for your exact release and any planned upgrade.

Logstore xAPI listing

LRS endpoint and credentials

Obtain the statement endpoint URL, the authentication method and a dedicated credential for Moodle from the LRS owner. Ask whether the LRS requires a specific xAPI version, whether it accepts batched posts and what rate limits apply. Store the credential in Moodle's configuration or your secrets manager, scoped to write statements only, and record who can rotate it.

Network path and TLS from cron

Statements are sent from the host that runs Moodle's cron, not from learners' browsers, so that host needs outbound HTTPS access to the LRS. Test the route from the cron host itself, including proxies, firewall rules and DNS. Confirm the LRS certificate chain is trusted by that host's operating system or PHP configuration, since a failed TLS handshake will otherwise look like a silent backlog.

Working Moodle cron

Batched delivery depends on the scheduled task running on time. Confirm that cron runs every minute on the production site, that it completes without errors and that no other task is blocking the queue. Check the task log for the Logstore xAPI task after a test event, so you know the batch is sent and not just queued. Cron failures will affect the whole site, not only xAPI.

Named data protection owner

Statements can contain learner identifiers, names, course titles, grades and timestamps, so someone must own the data protection review before go-live. Name that owner, define which events and fields leave the institution, and agree the lawful basis, retention period and LRS location with your privacy and legal contacts. Record the decision so it can be shown to auditors or data protection authorities later.

How to configure the Logstore xAPI plugin step by step

This sequence takes a Moodle site from no learning record stream to a verified feed of xAPI statements arriving in a Learning Record Store. Each step ends with a check so the team can confirm the previous step worked before moving on.

  1. Confirm the Moodle version and plugin support

    Before installing anything, the Moodle administrator confirms that the site runs a version the plugin lists as supported. The Logstore xAPI listing in the Moodle plugins directory states support for Moodle 4.1 to 5.2, so check the exact version on the site under site administration and match the plugin release to it. Also confirm with the plugin's listing which release line to download. Done means the version and the matching plugin release are written down in the change record.

  2. Install the plugin from the plugins directory

    A site administrator downloads the Logstore xAPI plugin from the Moodle plugins directory and installs it through the site administration plugin installer, or by placing the plugin code in the store plugin folder and running the upgrade process. Test the install on a staging copy of the site first, since installation runs database upgrade steps. Done means the plugin appears in the list of installed plugins with no errors on the notifications page, and the upgrade completes.

  3. Enable the xAPI store in logging settings

    In site administration, the administrator opens the logging settings and enables the xAPI log store alongside the standard logging stores, keeping the standard store on so Moodle's own reports still work. The store's own settings page then becomes available. Done means the store is listed as enabled in the logging configuration and the settings page opens without error.

  4. Enter the LRS endpoint and credentials

    The administrator enters the LRS endpoint URL, the xAPI version the LRS expects, and the key and secret issued for this Moodle site from the LRS. Store these credentials in a password-protected field and limit who can view site configuration. Ask the LRS operator which xAPI version and authentication method it uses, because the plugin settings must match. Done means the plugin's connection test reports a successful response from the LRS, or the settings save with no authentication errors in the Moodle log.

  5. Choose which events to send

    Before enabling broad event capture, the course design or learning analytics owner agrees on the list of events that will become statements, such as course views, quiz attempts, assignment submissions and forum posts. Turn on only the events that have a documented use in the LRS, and leave the rest off to limit the personal data leaving the site. Record the decision alongside the privacy review. Done means the event selection is saved in the plugin settings and matches the signed-off list.

  6. Run the scheduled task and check batching

    The plugin sends statements in batches through a Moodle scheduled task, so the administrator confirms that the relevant task is enabled and that cron runs on the site. Trigger the task manually once from the scheduled tasks page, then wait for the next normal run and check the task log for successful batches. Done means the task log shows completed runs with no repeated failures, and the number of queued events falls after each run.

  7. Verify test statements in the LRS

    Create a test course in a non-production environment, open it as a test student, view the course and submit a test assignment or forum post. Wait for a scheduled run, then search the LRS for statements from the test user and check the verb, object and timestamp. Done means a test course view appears as a statement in the LRS with the expected actor and activity, and the team has documented the check so it can be repeated after upgrades.

Which Moodle events to send and which to leave out

Course and navigation events record that a learner viewed a course, a page or an activity, and often when they did it. They are the highest volume events in most sites and produce statements that are simple in shape: an actor, a verb such as viewed, an object identifying the Moodle course or activity, and a timestamp. Because they tie a named user to the places they visited, they are personal data even when they carry no grade or content. Ask whether the reporting questions need every view or only engagement with key activities, since sending all views multiplies storage and makes privacy review harder.

  • Per-user identifiers: Each statement names the learner, so the LRS receives a user identifier that must be mapped to your privacy notice.
  • Object identifiers: Course and activity IRIs reveal course structure, which is usually low risk but should still be documented.
  • Volume: Page views are the most frequent events, so they drive storage and batch size more than any other family.
  • Scope option: Limit this family to course entry and key activity launches if the questions are about participation rather than browsing.

Before finalizing, confirm in the Logstore xAPI documentation exactly which navigation events the version you deploy emits, because event names and coverage change between releases.

How Moodle events travel to the Learning Record Store

A learner action in Moodle, such as a course view, quiz attempt, assignment submission or forum post, is written to the Moodle log. The Logstore xAPI plugin queues those events, and a scheduled task sends them in batches over HTTPS to the Learning Record Store, which keeps the statements for reporting tools. Check where the trust boundary sits and whether the scheduled task runs reliably, because a stalled task delays every statement behind it.

Moodle events move through a queue and scheduled batch before crossing into the LRS network.

How scheduled task batching shapes delivery and timing

Statements reach the LRS on the task schedule, not in real time. The Logstore xAPI plugin collects Moodle events such as course views, quiz attempts, assignment submissions and forum posts, then sends them in batches through a scheduled task. Anyone building dashboards, alerts or compliance reports on the LRS should expect a lag equal to the gap between task runs plus the time a run takes to process its batch. Confirm the task's default interval, the batch size setting and whether the plugin retries failed batches with the vendor's documentation and on a test site before you promise stakeholders a reporting window. Those values are configurable in the plugin and in the site's task settings, so the figures in your environment are the ones that matter.

Because delivery depends on Moodle's cron, cron health becomes a data pipeline concern. Moodle runs scheduled tasks through the cron process, and if cron stops, the xAPI task stops with it. Events keep accumulating in Moodle's logs, so the backlog is not lost in the usual case, but the LRS falls behind silently and nothing in the LRS signals the gap. Monitor the last successful run of the xAPI task and alert when it goes stale, and check that cron is running on every node that executes tasks. Confirm with the plugin maintainers how the task resumes after a long outage, how large a catch-up batch can get and whether catching up competes with interactive traffic during peak class hours.

Size the batch and the schedule against the site's event volume, not against the average day. Count events per hour during your busiest teaching periods, such as assignment deadlines and exam windows, using Moodle's own logs as a baseline. Then test a catch-up run on a copy of that volume to measure how long one task run takes and whether it finishes before the next one starts. If runs overlap or time out, shorten the interval or reduce the batch size, and watch the task's failure count afterward. Ask the plugin vendor and your LRS provider for their rate limits and retry behavior, because a batch that the LRS rejects will look like a delivery problem even when Moodle has sent it correctly.

How Moodle events and users map to xAPI statements

This table compares each part of an xAPI statement (actor, verb, object, result and context) with the Moodle data that fills it. Use it as a checklist when you review plugin output in a test LRS, because the exact fields depend on the event and the plugin configuration. The main takeaway is that the actor identifier is the field most likely to carry personal data, so it needs a privacy decision before go-live.

Statement partWhat Moodle suppliesWhat to check in the test LRS
ActorThe Moodle user record, usually identified by an account or email-based identifier chosen in the plugin settingsConfirm which identifier is sent and whether it is a direct identifier such as email or a pseudonymous value
VerbThe Moodle event type, such as a course view, quiz attempt, assignment submission or forum postConfirm each event you enabled produces the verb your reporting expects, and that unwanted events are excluded
ObjectThe course, activity module, quiz or forum the event relates to, identified by a Moodle URL or activity IDConfirm object IDs are stable across backups, restores and course copies, so statements still match the right activity
ResultOutcome data where the event has one, such as a quiz score or submission status, if the plugin includes itConfirm whether results are sent at all for your event types and whether scores are stored in the right units
ContextCourse, parent activity and session details the plugin attaches to the statementConfirm which course and session identifiers are included and whether they reveal more about the learner than needed
Timestamp and senderThe time of the event and the Moodle site that generated itConfirm time zones are consistent and that statements from several Moodle sites can be told apart
Identifiers that may be personal dataEmail addresses, usernames, Moodle user IDs and IP-related fields if included in the statementFlag each one for the privacy review and decide whether a pseudonymous identifier can replace it

Choosing an LRS you can run in your own infrastructure

Running the LRS yourself keeps learner statements inside the infrastructure you already control, which is the main reason organizations choose this option. The trade-off is that your team owns installation, database backups, certificates, upgrades and capacity planning for a service that receives a continuous stream of events from Moodle.

  • Data location: Statements, attachments and backups stay in the hosting environment you define, which simplifies data residency answers.
  • Operational ownership: Patching, monitoring and restore testing move to your team or to a partner under a written support scope.
  • Authentication: Confirm which credential method the project supports for the Logstore xAPI connection and how keys are rotated.
  • Retention: Confirm whether the project offers statement deletion or retention rules, or whether you must build them in the database layer.
  • Version support: Check the project's documented xAPI version and whether it matches the version the plugin sends.

Before you choose this path, confirm each of these points in the project's documentation and in a test instance, because a wrong assumption here is expensive to reverse once statements have accumulated.

Securing the connection and the learner data it carries

The xAPI pipeline moves learner activity out of Moodle and into a system you may not run yourself, so the controls sit at three points: the connection, the credentials and the data itself. Each card below covers one of those points and the check that proves it works.

Store the LRS credentials outside course content

The Logstore xAPI plugin needs the LRS endpoint and the key pair or token it uses to write statements. Keep these in the plugin settings that only site administrators can read, not in course pages, custom blocks or code committed to a repository. Check that a user with a course editor role cannot see the values and that your configuration backups are handled as sensitive files.

Send statements only over HTTPS

Every statement carries learner identifiers and activity details, so the LRS endpoint should use an address with a certificate your Moodle server trusts. Confirm the endpoint in the plugin settings begins with and test with a non-production LRS that a plain HTTP address is rejected or redirected rather than silently accepted. Ask the LRS vendor how it terminates TLS if a proxy sits in front of it.

Give the LRS account write-only access

The Moodle side only needs to post statements, so create an LRS credential that can write statements to one dedicated workspace or activity stream. Deny read access to other learners' records, reporting endpoints and administrative functions. Confirm the scope with the LRS documentation before go-live, since permission models differ between products.

Limit which events leave Moodle

Sending every log event widens the data set and the privacy review. Enable only the event types the reporting use case needs, such as course views, quiz attempts, assignment submissions and forum posts, and leave out events that expose content or personal fields you do not need. Document the chosen list and re-check it after each Moodle upgrade, because event names and content can change between releases.

Use pseudonymous actor identifiers

An xAPI actor is normally identified by an account, mailbox or hashed value. Where the LRS does not need names or email addresses, use an opaque identifier that maps back to the Moodle user only inside your own systems. Test one sample statement to confirm no name or email appears in the actor, the context or the result extensions, and record how the mapping is kept.

Control log access and rotate credentials

Restrict who can view the Moodle logs that record statement sends and failures, and treat failed-send entries as sensitive because they can include learner data. Set a rotation schedule for the LRS key pair, change it through the plugin settings and confirm the old key stops working. Ask the plugin maintainer and your LRS vendor how rotation affects queued statements in the scheduled task.

What a privacy review of learner statements should cover

Start the review with the lawful basis and the notice to learners, because every other question depends on what the organization is allowed to collect and why. Confirm with your data protection lead which basis applies to sending learner activity to a Learning Record Store, and whether learners, parents or employers must be told before statements start flowing. The Logstore xAPI plugin sends events such as course views, quiz attempts, assignment submissions and forum posts, so the notice should describe those categories in plain terms rather than refer only to the LRS. Record the event list you enable in the plugin settings as part of the review evidence, since the notice and the configuration must describe the same activity.

Next, map the data each event carries. An xAPI statement identifies an actor, a verb, an object and a result, and the actor field is where a learner's identity usually sits. Check which user identifier the plugin sends, whether names or email addresses travel with statements, and whether any free text such as forum post content or quiz answers is included in the object or result. Ask the LRS vendor or operator to confirm how it stores the actor field and whether it can be pseudonymized. Then set retention in the LRS, decide who can query the statements through the LRS roles and API credentials, and confirm where the LRS stores data, including any transfer to another region. Finally, agree how a deletion request reaches the LRS, because statements already written there will not be removed by changing the Moodle account alone. DeployOpen prepares the controls and evidence for your review but does not issue attestations, so an independent assessor or your own compliance function makes the final judgement.

Why statements stop arriving at the LRS

This table lists the failures that most often stop Logstore xAPI statements from reaching a Learning Record Store, with the likely cause and the fix for each. Read it from the top when a feed goes quiet, and check the first two rows before changing any LRS settings. The main takeaway is that a silent feed is usually a scheduled task, endpoint or certificate problem on the Moodle side, not a fault in the LRS.

FailureLikely causeFix
No statements sent at allCron is not running, or the Logstore xAPI scheduled task is disabled or has not run since setupConfirm cron runs on the Moodle host, then check the task status in site administration and run it manually once to test
Statements queued but not deliveredWrong endpoint URL or statements path for the LRS, or the xAPI version path does not match what the LRS expectsCopy the endpoint exactly from the LRS documentation, confirm the version it supports, and test with one manual send
Requests rejected with an authentication errorExpired or mistyped API key or secret, or the LRS account lacks write permission for the target storeRegenerate credentials in the LRS, update the plugin settings, and confirm the account can write statements
Connection fails over HTTPSThe LRS certificate is issued by a private or internal authority that the Moodle host does not trustInstall the internal CA certificate in the host trust store, then restart the web and PHP services before retesting
Some event types never appearThe event is not selected in the plugin settings, or the source activity is turned off in the courseReview the enabled events list, enable the ones in scope, and send a test action such as a course view to confirm
Duplicate or missing statements after a restoreA database restore replays queued records, or the queue and log tables were not restored consistently with each otherReview the queue after any restore, clear or reconcile records the LRS already holds, and agree a restore runbook with the LRS owner
Feed stops after a Moodle upgradeThe plugin version does not match the new Moodle release, which can leave the task or settings brokenCheck the plugin directory for supported Moodle versions before upgrading, and test the feed on staging first

Common questions about xAPI for Moodle

What does it cost to send Moodle activity to an LRS with xAPI?

The cost is mostly labor and the platform you send data to, not the Logstore xAPI plugin itself, which is a community plugin listed on the Moodle plugins directory. Costs fall into three groups: the implementation work (event scoping, testing, configuration and documentation), the privacy review, and the Learning Record Store, which is either a service you pay for or software you host. One-time work covers design and setup. Recurring costs cover hosting, LRS licensing or support, and retesting after each Moodle upgrade. Ask any partner for a quote that separates these items and states which events are in scope. No price is given here because the scope, LRS choice and hosting model decide it.

How long does an xAPI integration for Moodle take?

Duration depends on how many event types you send, how many LRS systems you connect, and how long the privacy review takes. A narrow setup that sends a short list of events to one LRS you already run is much shorter than a setup covering every course, quiz and forum event across several systems. Privacy and security review often sets the pace because it depends on your organization's approval steps, not on the plugin. Confirm the timeline in writing against a defined event list and a named LRS, and ask what testing and retest steps are included before go-live.

Can our internal team set up the Logstore xAPI plugin ourselves?

Yes, a team with Moodle administration experience can install and configure the plugin, provided it has access to the Moodle site, the scheduled task settings and an LRS endpoint with credentials. The harder parts are deciding which events leave the platform, documenting what personal data each statement contains, and testing that statements arrive correctly in the LRS. Those tasks need input from data protection and learning design staff. If your team lacks time for these steps, a partner can take on a fixed-scope piece of the work and hand over the configuration and documentation.

What does our team need to provide for the xAPI integration?

Plan to provide five things: administrator access to the Moodle site and a test instance, an LRS endpoint with credentials and an agreed statement format, network rules that allow the Moodle server to reach the LRS, a named data protection owner who approves the event list and retention, and a contact who can confirm which courses and activities are in scope. Also provide a copy of your current Moodle version and plugin list. Confirm the exact network path and any outbound restrictions with your network team before work starts, since a blocked connection is a common cause of delay.

How do Moodle upgrades affect the xAPI plugin?

Each Moodle upgrade can change core events, database tables or plugin APIs, so the plugin must be checked against the new version before the upgrade goes live. The plugins directory lists the Moodle versions Logstore xAPI supports, and the current listing covers Moodle 4.1 to 5.2. If you plan to move to a newer release, confirm plugin support first and test on a staging copy. Check the Moodle release notes for the target version, since server requirements also change between releases. Keep the plugin version and the LRS connection settings in your configuration records so the upgrade can be repeated.

Can xAPI statements stream from Moodle in real time?

The Logstore xAPI plugin batches events through a scheduled task rather than sending each event the moment it happens, so statements reach the LRS on the task's schedule, not instantly. Batching reduces load on Moodle and the LRS, but it means dashboards and alerts built on the LRS lag behind activity. If near-real-time reporting is a requirement, confirm the task frequency you can run on your server, check how the scheduled task runs with cron in your environment, and test the delay under normal course load. Ask the vendor or plugin maintainer whether any event type can be sent without the batch step.

How should we review privacy before sending learner data to an LRS?

Start by listing every event type you plan to send, the fields each statement contains, and where the LRS stores them. Compare that list with your data protection policy, the lawful basis for processing and your retention periods. Confirm whether statements contain names, email addresses, grades or free text from forum posts, and remove any field you do not need. Record where the LRS is hosted and who can access it. Data protection and security teams should sign off on the list before the scheduled task is switched on in production.

How DeployOpen scopes and delivers Moodle xAPI integrations

DeployOpen plans, implements, tests and documents Moodle integrations inside the client's own infrastructure, so the xAPI pipeline to a Learning Record Store is reviewed by the client's security and privacy teams before it carries learner data. Work starts with a written scope that names the events, the target LRS and the privacy review steps.

How we scope

  • Agree in writing which Moodle events are sent, such as course views, quiz attempts, assignment submissions and forum posts.
  • Confirm the Moodle version and the Logstore xAPI plugin version against the plugin's listed support range before work starts.
  • Record the target LRS, its hosting location and who in your organization owns the statement data.

How we build

  • Install and configure the Logstore xAPI plugin on a staging copy of your Moodle site first, not production.
  • Set the scheduled task frequency and batch behavior, then test how a backlog of events drains into the LRS.
  • Map each event to its xAPI verb and object, and test a sample of statements against the LRS for accuracy.

How we hand over

  • Deliver a configuration record listing enabled events, credentials handling, scheduled task settings and the LRS endpoint.
  • Provide a privacy review summary covering which learner fields leave Moodle and where they are stored.
  • Walk your operations team through checking statement delivery, failed batches and the logs that show them.

How we support

  • Scope a retest after Moodle minor releases or plugin updates, since event coverage can change between versions.
  • Offer ongoing support, upgrades and continuous testing as a retainer if your team wants DeployOpen to keep the pipeline current.
  • Advise on LRS changes or event additions as separate, written scope items so cost and risk stay visible.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.