xAPI: Configuring xAPI Statements

Under Course Setup > Advanced you will find a section titled "xAPI Settings". This section lists the currently active LRS or Rest Hook integrations which have been set up for your course.

 

This section also lets you configure how xAPI statements are sent to these services, specifying:

  • which OpenLearning data is used to generate the "actor" field
  • the format by which the "actor" field is identified
  • the "account" field to use (if identifying the "actor" by a user account rather than mbox)
  • which OpenLearning-generated statements to send through to the LRS or hook (N.B. activities embedded using the xAPI widget will always send their statements to the LRS)

Actor Field

The "actor" field of an xAPI statement can be specified in multiple formats. OpenLearning supports the following combinations:

  • OpenLearning User ID
    • "mbox" provided as "<user ID>@users.openlearning.com"
    • "mbox_sha1sum" provided as the sha1 hash of the above generated email address
    • "account" provided as:
      "account": { "homePage": "<Your account value>", name: "<user ID>" }
  • Student ID for the Institution (if a course is under an Institution account)
    • "mbox" provided as the student ID value, if the student ID is formatted as an email address (otherwise the above "<user ID>@users.openlearning.com" format is provided)
    • "mbox_sha1sum" provided as the sha1 hash of the above generated email address
    • "account" provided as:
      "account": { "homePage": "<Your account value>", name: "<Institution Student ID>" }
      
  • Student ID as specified for this Class (as an enrolment ID)
    • "mbox" provided as the student ID value, if the student ID is formatted as an email address (otherwise the above "<user ID>@users.openlearning.com" format is provided)
    • "mbox_sha1sum" provided as the sha1 hash of the above generated email address
    • "account" provided as:
      "account": { "homePage": "<Your account value>", name: "<Enrolment Student ID>" }
      

Anatomy of an OpenLearning xAPI Statement

xAPI Statements generated by OpenLearning are sent as JSON HTTP requests to the specified LRS or hook endpoint, and will have the following anatomy (e.g. a comment on a page):

{
  "id": "<UUID for this statement>",
  "actor": {
    "objectType": "Agent",
    "name": "<User's Name>",
    "mbox", "mbox_sha1sum" or "account": `<Populated as per the options specified above>`
  },
  "verb": {
    "id": "http://adlnet.gov/expapi/verbs/commented",
    "display": {
      "en-US": "commented"
    }
  },
  "object": {
    "objectType": "Activity",
    "id": "<URL of the OpenLearning Page>",
    "definition": {
      "name": {
        "en-US": "<Name of the Page>"
      },
      "description": {
        "en-US": "An activity page on OpenLearning"
      },
      "extensions": {
        "https://xapi.openlearning.com/extensions/page-id": "<OpenLearning Page ID>"
      }
    }
  },
  "result": {
    "response": "<Text of the Comment Posted>",
    "extensions": {
      "https://xapi.openlearning.com/extensions/comment": {
        "definition": {
          "extensions": {
            "https://xapi.openlearning.com/extensions/comment-id": "<OpenLearning ID of the Comment Posted>"
          },
          "name": {
            "en-US": "A comment on '<Name of the Page>'"
          },
          "description": {
            "en-US": "A comment made on an OpenLearning Page"
          }
        },
        "id": "<Canonical URL of the Comment on OpenLearning>",
        "objectType": "Activity"
      }
    }
  },
  "context": {
    "registration": "<UUID of the Registration>",
    "team": {
      "objectType": "Group",
      "name": "<Name of the OpenLearning Class>",
      "mbox": "mailto:<OpenLearning Class ID>@classes.openlearning.com",
      "member": []
    },
    "contextActivities": {
      "grouping": [
        {
          "objectType": "Activity",
          "id": "<URL of the OpenLearning Course>",
          "definition": {
            "name": {
              "en-US": "<Name of the Course>"
            },
            "description": {
              "en-US": "<Description of the Course>"
            },
            "extensions": {
              "https://xapi.openlearning.com/extensions/course-id": "<OpenLearning Course ID>"
            }
          }
        }
      ]
    },
    "platform": "OpenLearning",
    "extensions": {
      "https://xapi.openlearning.com/extensions/user-id": "<OpenLearning User ID of the Actor>",
      "https://xapi.openlearning.com/extensions/cohort": {
        "name": "<Name of the Class>",
        "mbox": "mailto:<Class ID>@classes.openlearning.com",
        "objectType": "Group"
      }
    }
  },
  "timestamp": "2019-03-22T03:12:58.674Z",
  "version": "1.0.1"
}

 

For a complete list of xAPI statements and Objects, see this article.

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 4 mths agoLast active
  • 65Views
  • 3 Following