xAPI data model

The Experience API (xAPI), also known as Tin Can API, is a technical specification for recording and tracking learning experiences. It is an open-source standard that enables learning records to be stored and shared across different systems and platforms. The xAPI defines a set of statements that describe a learning activity, such as "learner watched a video," "learner completed a quiz," or "learner attended a workshop."

The xAPI allows for more granular tracking of learning activities compared to traditional learning management systems (LMS), which typically only track course completions. With xAPI, learning records can be collected from a variety of sources, including mobile devices, simulations, games, and social media, providing a more comprehensive view of a learner's activities and achievements.

In simple terms, an xAPI statement is a way of recording a learning activity or experience in a consistent format. Typically, an xAPI statement follows an "Actor-Verb-Object" structure, which translates to "Who did what to what?"

Structure

Let's break down the structure:

1. Actor: This is who completed the action. The actor is usually a person but can be a group or an organization. For instance, in the statement "John completed a quiz," 'John' is the actor.

2. Verb: This is the action that the actor carried out. In the same example, 'completed' is the verb.

3. Object: This is what the action was performed on. In our example statement, 'a quiz' is the object.

Those are the three primary components required for an xAPI statement. However, a statement usually also include additional details that provide further context, such as:

4. Timestamp: This documents when the action occurred.

5. Context: This provides extra information about the situation in which the action took place. It could include details about the specific learning environment, platform, or other relevant activities.

6. Result: This captures the outcome of the action. For instance, in the statement "John scored 85% on a quiz," '85%' would be the result.

Example

Let's take and example:

"John (Actor) completed (Verb) the Mathematics course (Object) on January, 19th at 10:34 am."

This xAPI statement indicates that John finished his Math course successfully.

The corresponding JSON for the above example will look like this:

```json

{

  "actor": {

    "name": "John",

    "objectType": "Agent"

  },

  "verb": {

    "id": "http://adlnet.gov/expapi/verbs/completed",

    "display": {

      "en-US": "completed"

    }

  },

  "object": {

    "id": "http://example.com/MatheMaticsCourse",

    "definition": {

      "name": {

        "en-US": "Mathematics Course"

      },

      "description": {

        "en-US": "The Mathematics Course that John completed"

      }

    },

    "objectType": "Activity"

  },

  "timestamp": "2022-01-19T10:34:00Z"

}

```

In this JSON representation, "actor" represents John, "verb" represents the action completed, "object" represents the Mathematics Course, and "timestamp" is the date and time the action occurred in a specific pattern (ISO 8601 format). This pattern ("2022-01-19T10:34:00Z") indicates that the date was January 19th, 2022, and the time was 10:34:00 in Coordinated Universal Time (UTC).

Extensions

The xAPI specification has a built-in feature to handle custom parameters that don't fit into the established set of fields (actor, verb, object, result, context, timestamp, etc.). This feature is called the "extensions" attribute.

The extensions attribute is an open-ended, container field, where you can add as many extra data points as you want. This makes xAPI incredibly flexible and adaptable to a wide range of use cases, since it allows for capturing unique or granular details about any learning experience.

So, let's say for instance, you are developing an e-learning solution for an industrial safety course, and you want to track when a learner uses a specific safety equipment in a Virtual Reality (VR) simulation. In this case, an 'extensions' field can be added to the xAPI statement to record this specific detail.

Here's an example of what that might look like:

```json

{

  ...

  "context": {

    "extensions": {

      "http://example.com/used_safety_equipment": true

    }

  }

}

```

In this case, the URL "http://example.com/used_safety_equipment" is a unique identifier for the fact that the learner used a specific safety equipment in the VR simulation. The value associated with this identifier (true) could reflect that the learner did use the equipment.

As such, the extensions attribute enables the collection of highly specific, rich data about a learner's engagement and actions, which can help better understand the learning process and allow for more personalized and effective learning solutions.

Sources

xAPI website, last consulted on 2023-09-01, https://xapi.com/overview/

xAPI-Spec, ADLNET, github repository, last consulted on 2023-09-01, https://github.com/adlnet/xAPI-Spec