Send "answered" statements using xAPI for reporting question data

Using templates

When using Question templates, the question text, response options (if applicable), learner response, correct response, score, completion, and success will all be reported automatically.

Custom actions

When not using templates, you can use a variety of blocks to report as much or as little information as necessary. The xAPI standard does not require that all information be sent.

The simplest format is to report that a question was answered as well as the learner response:

video onEnd block

The "activity" field and "result" field can both take more information to provide more background regarding the question. For the activity, these include the name, description, type, correctResponsePattern, choices, etc. For the result, these include the success, duration, and response.

Because SCORM standardized interactions, a structure for interactions is provided in xAPI. Please see this page for more information about the common use cases - https://xapi.com/scorm-to-experience-api-xapi-cookbook/

SmartBuilder provides a number of blocks for common interaction types.

For example, with a true/false interaction, this block can be used, where the response can be set to the value of a Radio Button or Drop Down List:

xAPI answered true false activity activity id equals true

In the case of a Text Input interaction, when a button is clicked, the response can be set the value of the Text Input object:

xAPI answered string activity activity id equals text imput

More detail can be provided by creating maps with data that needs to be sent. Here is an example of some of the data that can be specified (using hard coded values to act as a sample).

using xAPI answers in a map

For a choice interaction, which is quite common, a more structured block is provided which can be used to specify all the details about an interaction. Here is a sample with hard coded sample values:

xAPI answered info processing

And here is a realistic example that includes all of the information about a choice interaction. It defines the ID, name, and description of the interaction, provides the IDs for the individual answers choices, pulls in the labels from a Radio Button object as the possible answer choices (names), defines the correct response (based on the IDs, in this case 2 is the correct answer), and then sends information about how the result - including the completion status (true - it was completed), the success status (was option 2 selected?) and the response (what Radio Button option was selected?):

xAPI complex action storing information

Generally it is recommended to use the SmartBuilder Question templates if you wish to track this level of detail, since these actions are already incorporated into the template logic.

Reporting interaction data using the "answered" blocks can be tricky to navigate if you haven’t used xAPI before. If you have questions when setting up custom “answered” blocks, please reach out to SmartBuilder support by emailing support@smartbuilder.com.

(Optional) If want to check that your statements are being sent properly, you can preview xAPI statements while you’re still authoring your lesson.