xAPI

JSONxAPI
xAPI is a uniform way of storing and retrieving learner experiences in eLearning systems. This specification is useful for allowing systems to share information for learning analytics or a variety of other purposes. In its simplest form, an xAPI statement is much like a sentence in any written language.

xAPI is a uniform way of storing and retrieving learner experiences (hence the "x") in eLearning systems. This specification is useful for allowing systems to share information for learning analytics or a variety of other purposes. In its simplest form, an xAPI statement is much like a sentence in any written language where we communicate that someone did something to something within certain contexts, etc.

In many language learning settings, it is common to diagram sentences to identify the different parts of speech. For instance, "Juan walked home with his dog" might be diagrammed as follows:


This diagram allows us to visualize who is doing the action ("Juan"), what the action is ("walked"), and contextual information about the action, such as where he walked ("to his home") and with whom he walked ("with his dog").


xAPI uses JSON to structure JavaScript objects that do the same thing. They allow us to record and retrieve information about an experience, such as who did what and in what contexts. In this case, a simplified xAPI-like statement might be as follows:

{
  actor: "Juan",
  verb: "walked",
  context: [
    "to his home",
    "with his dog"
  ]
}

By storing this experience in this way, others can easily understand what happened in the experience.

Because experiences are often much more complex than this simple sentence and because not everyone might have the same definitions of terms, xAPI statements include a few other components, but the basic idea is to identify an actor (who is doing something?), a verb (what are they doing?), an object (what are they doing it to?), and a context (what is the context?). A more realistic xAPI statement in an eLearning scenario might be like the following:

{
  "actor": {
    "name": "Alice Johnson",
    "mbox": "mailto:alice.johnson@example.com"
  },
  "verb": {
    "id": "http://adlnet.gov/expapi/verbs/interacted",
    "display": {
      "en-US": "interacted"
    }
  },
  "object": {
    "id": "http://example.com/buttons/button-1",
    "objectType": "Activity",
    "definition": {
      "name": {
        "en-US": "Button 1"
      },
      "description": {
        "en-US": "A button that the learner clicked"
      }
    }
  },
  "context": {
    "contextActivities": {
      "category": [
        {
          "id": "http://example.com/activities/learning-module-1"
        }
      ]
    }
  }
}

In this example, a learner named Alice Johnson (with the email address alice.johnson@example.com) interacted with a button (called Button 1) within the context of learning module 1.

Here's another example:

{
    "actor": {
        "name": "Sally Glider",
        "mbox": "mailto:sally@example.com"
    },
    "verb": {
        "id": "http://adlnet.gov/expapi/verbs/completed",
        "display": {
            "en-US": "completed"
        }
    },
    "object": {
        "id": "http://example.com/activities/solo-hang-gliding",
        "definition": {
            "name": {
                "en-US": "Solo Hang Gliding"
            }
        }
    },
    "result": {
        "completion": true,
        "success": true,
        "score": {
            "scaled": .95
        }
    }
}

In this example, a student named Sally Glider completed a "Solo Hang Gliding" course with a grade of 95%.

Notice in these examples that the verbs and objects both have IDs that look like URLs. These are Universal Resource Identifiers (URIs). A URI doesn’t take you to a web address, like a URL does, but it is a unique identifier for an action.  It references a specific meaning defined by a specific organization. You can look up xAPI URIs in The Experience API Registry (see Figure 1). If you want to specify a particular activity or context, chances are that a URI for it has already been defined in the registry. Recognizing and using standard URIs allows your tool or platform to communicate clearly with other tools and platforms in the education space.

Figure 1

An “Activity Type” Entry in the Experience API

Activity Type: discussion

URI

http://id.tincanapi.com/activitytype/discussion

Description

Represents an ongoing conversation between persons, such as an email thread or a forum topic.

Current Meta Data

{
    "name": {
        "en-US": "discussion"
    },
    "description": {
        "en-US": "Represents an ongoing conversation between persons, such as an email thread or a forum topic. "
    }
}

Figure 2

An “Verb” Entry in the Experience API

Verb: presented

URI

http://activitystrea.ms/schema/1.0/present

Description

Indicates that the actor has presented the object. For instance, when a person gives a presentation at a conference.

Current Meta Data

{
    "name": {
        "en-US": "presented"
    },
    "description": {
        "en-US": "Indicates that the actor has presented the object. For instance, when a person gives a presentation at a conference."
    }
}


This content is provided to you freely by EdTech Books.

Access it online or download it at https://edtechbooks.org/elearning_hacker/xapi.