Having looked at the ActorVerbObject and Result elements of an xAPI statement, we now turn our attention to the Context – not of the Object, but context of the statement as a whole.

Understanding The Context Element of an xAPI Statement

The context consists of 9 elements that are all optional.

  1. Registration – a enrollment ID
  2. Instructor – the person who created the content
  3. Team – the group that you are a part of
  4. Context Activities
    • Parent – e.g. nested activities (a level is part of a course)
    • Grouping – e.g. a course is part of a qualification
    • Category – e.g. a tag, e.g. xAPI course, that helps you group things together
    • Other – anything else
  5. Revision – the revision of the activity or if there has been a previous version of the activity
  6. Platform – where it happened – e.g. Curatr, Moodle
  7. Language – what language it happened in
  8. Statement – reference to another statement that is contextually relevant (NOT the Object Statement)
  9. Extensions – Not the Result or Object definition, this is more holistic to the whole activity

An Example Context Statement Summary

A complete Context statement that includes all elements may look something like this:

 

{

“actor”: {

“objectType”: “Agent”,

“name”: “John Smith”,

“account”: {

“name”: “123”,

“homePage”: “http://www.example.com/users/”

}

},

“verb”: {

“id”: “http://adlnet.gov/expapi/verbs/completed”,

“display”: {

“en-GB”: “completed”

}

},

“object”: {

“objectType”: “Activity”,

“id”: “http://www.example.com/activities/1”

},

“context”: {

“registration”: “957f56b7-1d34-4b01-9408-3ffeb2053b28”,

“instructor”: {

“objectType”: “Agent”,

“name”: “Joe Bloggs”

“account”: {

“name”: “321”,

“homePage”: “http://www.example.com/users/”

}

},

“team”: {

“objectType”: “Group”,

“name”: “HT2”,

“account”: {

“name”: “123”,

“homePage”: “http://www.example.com/groups/”

}

},

“contextActivities”: {

“parent”: [{

“objectType”: “Activity”,

“id”: “http://www.example.com/activities/parent”

}],

“grouping”: [{

“objectType”: “Activity”,

“id”: “http://www.example.com/activities/grouping”

}],

“category”: [{

“objectType”: “Activity”,

“id”: “http://www.example.com/activities/category”

}],

“other”: [{

“objectType”: “Activity”,

“id”: “http://www.example.com/activities/other”

}]

},

“revision”: “1.0.0”,

“platform”: “Example”,

“language”: “en-GB”,

“statement”: {

“objectType”: “StatementRef”,

“id”: “957f56b7-1d34-4b01-9408-3ffeb2053b28”

},

“extensions”: {

“http://www.example.com/ext”: true

}

}

}

As you can tell, if you include all of this data in your statement then it’s starting to get pretty long – but if you’re looking at really getting the most from your data, then there is one further element that we’ll look at in our final post on our 101 Series: xAPI Statements: Going Beyond the Basics.

——-

For more practical tips and advice about the xAPI, download our Technology Managers Guide to xAPI