Veracity Logo

2420107
Statements

39296
Actors

308999
Activities

415
LRSs

Back to TOC

User Manual

xAPI Utilities


In order to help you use the LRS, and to create the best possible Learning Record Providers (LRPs), Veracity Learning LRS includes a set of utilities to help you generate and consume statements. These tools can be used to explore the data model, test endpoints, test JSON, or otherwise interact with the xAPI via a visual interface.

You can access the most tool from the top menubar. A few of the tools require information from an LRS. In this case, you'll find them in the left side menu from the LRS home page.

Table of Contents

### Statement Validator ![](/public/images/statementValidator.JPG)

The statement validator is a simple tool for testing whether or not a JSON object is valid according to our implementation of xAPI data model. Simply paste a JSON object in the box and click "Validate".

You must provide a valid JSON object as input. While the xAPI endpoint can accept some malformed JSON when in non-strict mode, this tool can only parse proper JSON input. However, you can still test any object structure, so long as the format is valid.

If your statement matches the schema completely, you'll receive a message like this:

If it is not correct, you'll get detailed feedback about what went wrong. We've endevored to make this feedback as useful as possible, but not every error can be clearly described. Sometimes, the object you've sent is just not close enough to generate useful feedback. Here's an example of a clear error.

The value of the actor.mbox field does not meet the requirements of the specification. The mbox format is defined as "mailto:(email)". We omitted the "mailto:" part and entered an email address directly

{

    "properties": {
        "email": {
            "type": "string",
            "pattern": "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z00-9](?:[a-z0-9-]*[a-z0-9])?"
        },
        "name": {
            "type": "string",
            "minLength":3,
            "maxLength":64
        },
        "phone":{
            "type":"string",
            "minLength":0,
            "maxLength":32
        },
        "message": {
            "type": "string",
            "minLength":0,
            "maxLength":1024
        }
    },
    "additionalProperties": false,
    "required": ["email","message"]
}

If we paste something ridiculous like the value above, we can't even generate useful feedback. This is nowhere close to a valid statement.

Occasionally you might try to use some JSON that is acceptable under an older version of the xAPI spec like 0.9 or 0.95. These old versions have slightly different data requirements. There are also a few other edge cases we can accept.

In cases like this,, we can only accept the statement when the LRS is not in "Strict" mode. We'll tranlate this object to the proper xAPI 1.0.3 structure automatically.

Statement Generator

The xAPI spec allows for a rich variety of different data to be recorded. This tool randomly generates syntactically valid xAPI statements. Click "new statement" to generate a new, random statement. You might be surprised by some of the possibilities. Use this tool generate test data or just to explore the data model.


xAPI Lab

xAPI Lab is an incredible tool first written by the engineering staff at Advanced Distributed Learning (ADL). The tool is open source, and is therefor integrated into many different products and projects.

Our implementation adds support for some of our custom features like the aggregation endpoint. We also have an option to populate the credential section automatically.

You can launch xAPI Lab from the main menubar, under "xAPI Utilities". This opens the tool in its default configuration. You'll need to scroll to the bottom and input proper xAPI endpoint, username and password information in the "LRS Basic Auth Setup" panel.

You can also get to this tool from the left side menu on the homepage for an LRS. Under the tools menu, click "xAPI Lab". Instead of taking you directly to the tool, we'll prompt you to choose from one of your Access Keys. Click on the large green box that represents the Access Key you would like to use.

We'll then load the xAPI Lab tool, and set up the "LRS Basic Auth Setup" section to talk to the LRS you were just on, using the key you selected.