How to Integrate with Training APIs

This page provides some quick tips to pass student metrics from your application to the MOTAR Dashboard.


If you have graded quizzes in your lesson, you should build this as a child module in the Course Creator of MOTAR Sandbox and us the Assessment API so it reports in the quiz format on the dashboard and allows the instructor to see student data including student attempts, right and wrong answers and the questions.

Example of Assessment Data reported via assessments API and shown on the Instructor Dashboard

When updating progress on an assessment for students you must update the student's lesson progress allowing the MOTAR dashboard to correctly display the assessment data.

If you set a MOTAR assessment to pass/fail with auto-grade (not instructor graded) and only have multiple choice questions it will assume 100% is a pass, anything else is a fail

If a student has MOTAR instructor permissions, both class lists will be returned, the user's instructor class list, and then their student class list. A student can be assigned to a course with a class. The class must be created on the instructor dashboard.

Create a class

Add a student

After adding the student to the class you created all course content will now be available until the class reaches its end date.


You can use the MOTAR Sandbox to add child "Assessments" for your graded events and quizzes. Assessments can include multiple choice, true/false (two choice multiple choice), or short answer response assessments. These assessments can be instructor graded or graded by your apps.


You can add an App child module under a Stage to report xAPI data for a sub-scene (aka room or major task).



A student ID represents the relationship between a user and a class. You should get a student ID from MOTAR in the query parameters when launched from the dashboard.

When setting up your app to relay student data to the MOTAR dashboards, ensure you have:

  1. Authorized the Training scope for your app in Studio

  2. Generated a sandbox user with "instructor" permissions

  3. Use the sandbox user to login to MOTAR Sandbox

There are three primary APIs used to pass data to the MOTAR dashboards

  1. Lessons

  2. xAPI

  3. Assessments

See below for more details and choose the best method for the data you are trying to relay. You can relay data to a learning module or a child module.

Child Modules

Add child modules to organize and track student metrics on the MOTAR dashboard. Student metrics can be sent to child or parent modules.

Some metrics are captured automatically when a student starts a lesson module (parent or child module).

Lesson Start / Stop Times

Starting a lesson starts server time for that module. Updating a lesson with a complete set to "true" ends the timer. You can override server times (in case the student is offline with your own timestamps using the Lesson startTime and endTime options.)

Assessment Reattempts

If you call the "Start Lesson" API route a second time, that creates a second attempt. A student can have many attempts.

To support a student taking notes in your training application, use the Notes API. Notes should be sent in with the student's user ID and lesson ID to show up on the student dashboard appropriately.

Notes will be available to the student for the lesson in which they were tagged and they will be summarized in a consolidated Notes section.

Send in student general metrics via xAPI (see API or Unity and IOS SDK docs). Make sure you pass in the lessonId with the object so MOTAR can properly report the xAPI data under the corresponding lesson module.

xAPI data gets shown on the lesson module per the lessonID you pass in similar to this:

Swift xAPI Example

// Report an xAPI Statement - Swift

let xD = ["lessonId" : appLesson, "classId": classID]
PlayPortalXAPIClient.shared.createStatement(actor: user.userId, verb: "Started sim", object: xD) { (error) in
    if let error = error {
        print("failed to update \(error)")
    } else {
        print("created statement")

Unity xAPI Example

// Report an xAPI statement - Unity

// Use a Serializable class for the @object argument
class XAPIStatementObject
    public string lessonId;
    public string classId;

public void CreateStatement() {
    var timestamp = DateTime.UtcNow.ToString("o");
    var @object = new XAPIStatementObject
        lessonId = yourLessonId,
        classId = yourClassId
        actor, verb, @object,
        error =>
            // Handle error (hopefully there will be none!)

Make sure you use the userId accessed from "get My Profile" to report the actor in xAPI statements.

Last updated