Skip to content
LRS
Ralph.en

Ralph

XAPI Format guidelines

Syntax

Encode your URLs


"activities": "https://www.lip6.fr/mocah/invalidURI/interactable/Verrou Mur", # ERROR: invalid IRI
"activities": "https://www.lip6.fr/mocah/invalidURI/interactable/Verrou%20Mur", # OK

Beware of bad encoding

"extensions": {
    "https://w2id&46;org/learning-analytics/learning-management-system/external-id": "TY" # ERROR: ???
},
"extensions": {
    "https://w2id.org/learning-analytics/learning-management-system/external-id": "TY" # OK
},

Content

Fill descriptions of language maps (or don’t define it at all)

"definition": {
    "type": "http://id.tincanapi.com/activitytype/source",
    "name": {
    "en": "Moodle"
    },
    "description": {
    "en": "" # ERROR: empty description
    }
},
"definition": {
    "type": "http://id.tincanapi.com/activitytype/source",
    "name": {
    "en": "Moodle"
    },
    "description": {
    "en": "No description provided" # OK
    }
},
"definition": {
    "type": "http://id.tincanapi.com/activitytype/source",
    "name": {
    "en": "Moodle"
    },
},

Fill result/response (or don’t define it at all)

"result": {
    "response": "", # ERROR: empty result
    "completion": true,
    "success": false,
    "extensions": {
    "http://learninglocker&46;net/xapi/cmi/true-false/response": false
    },
"result": {
    # OK: No result
    "completion": true,
    "success": false,
    "extensions": {
    "http://learninglocker&46;net/xapi/cmi/true-false/response": false
    }

Getting statements

Caution

TODO

Use HTTPie!

Examples:

  • Retrieve agent with account details:
http -a user:password GET LRS_URL/xAPI/statements agent=="{\"account\":{\"name\":\"...\",\"homePage\": \"https://...\"}}"

Uploading statements

Data formatting

Currently

jq -nc --stream 'fromstream(1|truncate_stream(inputs))' /path/to/large/statements.json \
    split -dC 50M --addtional-suffix=.json -  /path/to/output/file_pattern_

Sending to LRS

Caution

TODO

Following Ralph documentation you can use HTTPie to send statements to Ralph. Use jq to format the statements if needed.

jq statements.json | http -a user:password POST LRS_URL/xAPI/statements