4 Creative Ways to Send xAPI Data from Non-eLearning Sources

As xAPI gains adoption in the industry, more and more course authoring tools offer a degree of xAPI support. eLearning is often, logically, the first place instructional designers encounter xAPI because we already have the built-in support at our disposal, and we’re keenly interested in learning more about what learners are actually doing in our courses!

But the fun doesn’t stop there.

xAPI allows us to track much more than the nitty gritty details of every click within an eLearning course. In fact, the very impetus for creating the xAPI specification in the first place was to get out of the LMS and into other aspects of learning—and even all the way to performance. To spark some creative inspiration, here are four quick examples of using xAPI to get data from non-eLearning sources that the team at TorranceLearning brought to the DevLearn xAPI Showcase stage, along with a discussion of the quirks and challenges inherent in each.

1: Instructor-led training roster

On a TorranceLearning project we needed to capture participation and engagement data from a variety of learning experiences, including instructor-led workshops and virtual classroom sessions. We built a simple data-loader HTML page for the client to enter the session title, location, date, and the participants’ names. The tool then created an xAPI statement for each individual indicating that they completed the course. It’s not very deep, but it gets the job done quickly.

Note that if this organization’s LMS had an LRS embedded or sent data from ILT directly to the LRS, this solution would not have been needed.

Here’s a quick view of a generic version of the roster tool:

A simple HTML page allows a user to enter information about the course and participants.

Figure 1: Dashboard of the roster tool

Figure 2 shows some xAPI statements the tool sent.

The simple xAPI statement includes the participant’s name, the activity, the course name, and the location.

Figure 2: Sample xAPI statements

Below, you can see the JavaScript for an abridged version of the xAPI activity statement that is sent for each attendee.

{
  "actor": {
    "mbox": "mailto:mtorrance@torranceLearning.com",
    "objectType": "Agent",
    "name": "Megan Torrance"
  },
  "verb": {
    "id": "http://adlnet.gov/expapi/verbs/completed",
    "display": { "en": "completed"
    }
  },
  "context": {
    "extensions": {
      "http://id.tincanapi.com/extension/location": "Chelsea, Michigan",
      "http://id.tincanapi.com/extension/datetime": "2019-01-07T05:00:00.000Z"
    },
  },
  "object": {
    "id": "http://www.torranceLearning.com/training/xapi/activities/xapi/design",
    "definition": {
      "name": {
        "en-us": "xAPI Strategy for Instructional Designers"
      },
      "type": "http://adlnet.gov/expapi/activities/course"
    },
    "objectType": "Activity"
  }
}

This sample JavaScript identifies the actor, verb, context, and object.

Quirks and challenges with the roster tool:

  • The email address for each attendee is manually entered by the roster tool user, which represents a huge opportunity for failure. Most of the xAPI activity generated for this program comes from tools within the company’s single sign on (SSO) environment, so it’s much more reliable. On the roster tool, it’s imperative that the correct attendee information be entered so that it can be matched with other data in the LRS about the individual’s activity.
  • In this case, we know all of the ILT and vILT sessions that will be offered for this particular program, so activities are identified in advance. This tool would need to be modified if we wanted it to handle credit-granting for any ILT session.

2: SurveyGizmo questionnaire

Did you know that SurveyGizmo has an xAPI integration? We didn’t either, until last year when a client asked how they could get the results of their SurveyGizmo questionnaires sent to the LMS. (Fortunately that client had an LMS with a solid xAPI LRS inside, so it was relatively easy.) xAPI is available on the enterprise license, so you’ll have to pay extra to get it. If you’ve got the use case for it, it’s likely well worth it.

TorranceLearning hosts the xAPI Learning Cohort, and one of our weekly tasks is to gather updates from each of the roughly two-dozen project teams. We use SurveyGizmo for that, and the data from each weekly update questionnaire is stored as xAPI statements.

From the end user’s perspective, this looks like any other online survey. Note that while this survey requires an email address, which is used for the Actor in the xAPI statement, surveys can also be constructed using a generic Actor to keep responses anonymous.

The SurveyGizmo form asks users to enter name, email, and details of their team’s progress.

Figure 3: Screen for entering data into a SurveyGizmo form

SurveyGizmo sends an xAPI activity statement for each question, each page (this survey only has one), and the survey itself. The resulting collection of statements that are sent look like those shown in Figure 4, with Peter Guenther having identified himself as the Actor and submitter of this survey.

The simple xAPI statement includes the participant’s name, the activity, the question, and the response.

Figure 4: Sample xAPI statements

The JavaScript below shows an abridged version of the xAPI activity statement that is sent for one of the survey questions.

{
  "actor": {
    "name": "Peter Guenther",
    "mbox": "mailto:pguenther@torranceLearning.com",
    "objectType": "Agent"
  },
  "result": {
    "duration": "PT0H6M24S",
    "completion": true,
    "response": "Yes! We need people willing to load the webapp to their phone and use checklist so we can get some testers from outside our team. "
  },
  "verb": {
    "display": {
      "en-US": "answered"
    },
    "id": "http://adlnet.gov/expapi/verbs/answered"
  },
  "context": {
    "contextActivities": {
      "parent": [
        {
          "id": "https://www.surveygizmo.com/s3/4554408/xAPI-Cohort-Weekly-Check-In/page/1",
          "objectType": "Activity"
        }
      ],
      "category": [
        {
          "definition": {
            "name": {
              "en-US": "SurveyGizmo"
            },
            "type": "http://id.tincanapi.com/activitytype/source"
          },
          "id": "https://www.surveygizmo.com/",
          "objectType": "Activity"
        }
      ],
      "grouping": [
        {
          "id": "https://www.surveygizmo.com/s3/4554408/xAPI-Cohort-Weekly-Check-In",
          "objectType": "Activity"
        }
      ]
    },
  },
  "object": {
    "definition": {
      "interactionType": "fill-in",
      "name": {
        "en-US": "Do you have needs or help to request from the Cohort as a whole?"
      },
      "type": "http://adlnet.gov/expapi/activities/cmi.interaction"
    },
    "id": "https://www.surveygizmo.com/s3/4554408/xAPI-Cohort-Weekly-Check-In/question/6",
    "objectType": "Activity"
  }
}

This JavaScript snippet shows the learner’s response to a survey question as the “result.” It also provides important context—that the information came from a SurveyGizmo weekly cohort check-in survey.

Quirks and challenges with SurveyGizmo:

  • SurveyGizmo has a similar challenge to the roster tool: The Actor is identified by manually typing in an email address, making it prone to inaccurate data collection.
  • Of note, SurveyGizmo also collects the browser, IP address, and location information of the computer used to complete the survey.

3: The xINC xAPI image and note capture

The xINC tool is a little project that TorranceLearning did a few years ago to capture images and notes digitally and store them alongside other learning experiences. It uses a set of tools and technologies strung together to create an image gallery. In this case, a user uploads an image to a specific folder in Google Drive. Every 15 minutes that folder is swept by Zapier, and any new images are documented using an xAPI statement that is sent to the LRS. The image gallery page displays the images.

Figure 5 shows a gallery with a single image.

The xINC screen shows the uploaded files with images in a gallery-style display. This figure shows a gallery with a single image.

Figure 5: The xINC tool creates a digital record, with xAPI statements, of documents and images that have been uploaded

Figure 6 shows sample xAPI statements for three images in the LRS.

The simple xAPI statement includes the team email address as the “Actor,” the activity, and the name of the uploaded file.

Figure 6: Sample xAPI statements

The JavaScript snippet below shows an abridged version of the xAPI activity statement that is sent for each image.

{
  "actor": {
    "objectType": "Agent",
    "mbox": "mailto:tlworkspace@torranceLearning.com",
    "name": "TL Workspace"
  },
  "verb": {
    "id": "http://adlnet.gov/expapi/verbs/uploaded",
    "display": { "en-US": "uploaded"
    }
  },
  "context": {
    "extensions": {
      "http://www.torranceLearning.com/xapi/activities/extensions/xinc": {
        "url": "https://drive.google.com/uc?id=1f7LxTY0R8RRuQ5oOWWzSN7DRYWFK2TUU",
        "filename": "schedule",
        "filesize": "8317385",
      }
    }
  },
  "version": "1.0.0",
  "object": {
    "id": "http://www.torranceLearning.com/xapi/activities/xinc/",
    "definition": {
      "name": {
        "en-US": "schedule"
      },
      "description": {
        "en-US": "Image uploaded via Google Drive to LRS and displayed on xINC dashboard"
      },
      "moreInfo": "http://www.torranceLearning.com/xinc/"
    },
    "objectType": "Activity"
  }
}

In this JavaScript example, the object includes a description of what was done (an image was uploaded and displayed on an xINC dashboard).

Quirks and challenges with xINC:

  • Once again, Actor identification is a challenge. We have not worked too hard to nail this down, as this is not a production-scale project. In this case, we’re using a generic team email address to indicate the Actor.
  • Note that the image itself is not being sent with the xAPI statement. In this case we are documenting the location of the image in Google Drive. While this is not necessarily a robust long-term solution, it works fine for our proof-of-concept.

4: The Internet of Things: Our conference room door sensor

Today there is a diverse array of off-the-shelf, customizable, and custom-built devices that report across the Internet. Our final example of non-eLearning data stored as xAPI statements has been running faithfully for about four years now: a sensor on our conference room door. A magnet switch sensor above the door detects whether the door is open or closed, and an Arduino-based board sends the sensor data to Zapier whenever the door’s status changes. Via a several-step Zapier process, data is formatted as an xAPI statement that is sent to the LRS communicating the door’s status, along with the temperature, barometric pressure, and altitude of the sensor. Another step sends the data to a Google Sheet, and the last turns a light plugged into a We-Mo switch on and off in another part of our office building so we know if the door is opened or closed.

Figure 7 shows the sensor on the door.

A small sensor attached to the top of the conference room door uses xAPI and Internet connectivity to send status data.

Figure 7: This sensor shares data on whether the conference room door is open or closed

Figure 8 shows the open-and-closed data sent by the door on a typical day at the office (and yes, our conference room is often unbearably hot).

The simple xAPI statement includes the team name as the “Actor,” the activity, and the temperature of the conference room.

Figure 8: Sample xAPI statements

This final JavaScript sample shows an abridged version of the xAPI activity statement that is sent whenever the door is opened or closed (in this case the door was opened).

{
  "actor": {
    "name": "TorranceLearning Team",
    "mbox": "mailto: tlworkspace@torranceLearning.com"
  },
  "verb": {
    "id": "http://activitystrea.ms/schema/1.0/open",
    "display": {
      "en-US": "opened"
    }
  },
  "object": {
    "id": "http://www.torranceLearning.com/xapi/activities/sensors/rooms/tl-conference-room",
    "definition": {
      "name": {
        "en-US": "Conference Room door"
      },
      "description": {
        "en-US": "ESP8266 WiFi board with magnet switch connected to door."
      }
    }
  },
  "context": {
    "extensions": {
      "http://www.torranceLearning.com/xapi/activities/extensions/sensors/statusNum": "1",
      "http://www.torranceLearning.com/xapi/activities/extensions/sensors/temp": "78",
      "http://www.torranceLearning.com/xapi/activities/extensions/sensors/pressure": "974",
      "http://www.torranceLearning.com/xapi/activities/extensions/sensors/altitude": "325"
    }
  },
  "timestamp": "2018-12-20T17:13:12.703Z"
}

In addition to the door’s open or closed status, the JavaScript includes additional “context”: the temperature, altitude, and barometric pressure.

Quirks and challenges with the conference room door sensor:

  • While our door has a sensor, our team members do not wear identifying badges so we decided that the “TorranceLearning Team” would be the Actor for these statements. We could have also assigned the door itself an Actor ID, and ultimately created an entire grouping of fixtures and sensors in our office (other doors, the coffee pot, the printer, the refrigerator, etc.).
  • xAPI references verb and activity definitions to provide clarity. However, the verb definition we selected (“open”) was not defined for xAPI several years ago when we built this so we used the Activity Streams verb “open,” indicating that the Actor has opened an object. Alternatively, we could use the verb “opened,” as defined in the updated xAPI Vocabulary and Profile Server, which indicates that the Actor has moved or adjusted an object to allow access or viewing.

Try a new technology in 2019!

In The eLearning Guild’s 2019 Predictions for eLearning eBook, Megan Torrance challenges readers: “Try a new technology or approach.” With any luck, this article will inspire you to try something beyond the eLearning course for your next xAPI project. If you’re looking for ideas, inspiration, and a team to help you get started, sign up for the next xAPI Learning Cohort, a 12-week, virtual, vendor-neutral, learning-by-doing experience offered to learning professionals twice a year.

Learn more about xAPI at xAPI Camp, co-located with Learning Solutions 2019 Conference and Expo, in Orlando, Florida. The xAPI camp is March 25, 2019; Learning Solutions is March 26–28, 2019.

More Development

You May Also Like