xAPI Lesson Activity ID

xAPI differentiates content using Activity IDs. This Lesson Activity ID should be unique to the lesson you are creating, and is in the form of a URI (similar to URL, but it doesn’t actually point to a location on the internet). An example would be "http://smartbuilder.com/xapi/activities/testlesson".

Lesson Activity IDs should be unique to your lesson. If two lessons using the same xAPI Endpoint have the same Activity ID, their data will be comingled, which can cause confusion when trying to run reports or retrieve data from the LRS. For example:

Similarly, if an update is made to a lesson, and activities within the lesson are added and removed, it is generally good practice to update the Lesson Activity ID. For example, if a lesson has dozens of responses, and then question8 was removed, and then the lesson has hundreds of more responses reported, the residual answers that were reported that include question8 may cause confusion when reports are run later in the LRS (e.g. "Why are so few people getting question8 correct?").

The Lesson Activity ID forms the root of Activity IDs for statements that you send from your lesson.

Here is a sample Lesson Activity ID: http://smartbuilder.com/xapi/activities/testlesson

Here are some sample Activity IDs within that lesson: http://smartbuilder.com/xapi/activities/testlesson/intro-video http://smartbuilder.com/xapi/activities/testlesson/question2

Here are some sample Activity IDs organized further: http://smartbuilder.com/xapi/activities/testlesson/survey/whatdidyouthinkofthelesson http://smartbuilder.com/xapi/activities/testlesson/survey/whatdoyouthinkcanbeimproved

The Lesson Activity ID can be found in the Publish settings for the lesson. By default, when xAPI is enabled, a Lesson Activity ID is generated based on the file name. This can be altered by clicking on the "..." button next to the Lesson Activity ID:

Lesson Activity ID in Publish Panel

When using action blocks to report xAPI data, the activity name that you type in the action block (e.g. intro-video) will be automatically appended to the Lesson Activity ID. For example, an action block with the following information:

xAPI experience action block

will be reported to the LRS as “http://smartbuilder.com/xapi/activities/testlesson/intro-video”. For advanced use cases where you don’t want to use the Lesson Activity ID as the root for your Activity IDs, you can type a fully qualified URI starting with “http://” in the activity socket. For example:

xAPI experience action block

If needed, the Lesson Activity ID can be referenced using the xAPI: lesson activity block.

xAPI lesson activity action block

This is typically done when reporting information about the lesson as a whole, e.g. marking a lesson complete:

xAPI completed passed action block