SCORM to Experience API (xAPI) Cookbook
SCORM to Experience API Cookbook
We’ve put together the SCORM to xAPI Cookbook to help you identify how to create xAPI data that is equivalent to SCORM data. The cookbook identifies a few ways to send xAPI statements based on the events that occur in the SCORM data model. It also includes SCORM data samples and recommendations for representing them with xAPI statements. If you have any questions about these, please get in touch with us. We love talking to people about xAPI.
ADL’s SCORM Profile
This SCORM to Experience API cookbook has been available for a while and has been followed by many authoring tools and content vendors. You’ll find the cookbook helpful, but you may find you want a little more detail. ADL are working on a SCORM Profile that’s a much more detailed version of this cookbook. The ADL SCORM profile is not complete yet, but is still a helpful reference alongside this cookbook.
SCORM Scenarios
- Record attempt but not completion
- Record completion with no score or pass/fail
- Record completion with score
- Record passing with score
- Record fail with score
Interaction Data
The result object is included on some of these samples to show it is not required, but can be used to present more data from the action.
Bookmarking and SuspendData
Bookmarking and SuspendData can be handled with xAPI State API. This is a key/value database that can store these values and more.
Record attempt but not completion
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/attempted", "display": { "en-US": "attempted" } }, "object": { "id": "http://www.example.com/tincan/activities/sqyCkLBd", "objectType": "Activity", "definition": { "name": { "en-US": "Example Activity" }, "description": { "en-US": "Example activity definition" } } } }
Record completion with no score or pass/fail
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/completed", "display": { "en-US": "completed" } }, "result": { "completion": true, "duration": "PT0H0M2S" }, "object": { "id": "http://www.example.com/tincan/activities/sqyCkLBd", "objectType": "Activity", "definition": { "name": { "en-US": "Example Activity" }, "description": { "en-US": "Example activity definition" } } } }
Record completion with score
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/completed", "display": { "en-US": "completed" } }, "result": { "completion": true, "score": { "scaled": 0.75, "raw": 75, "min": 0, "max": 100 }, "duration": "PT0H5M2S" }, "object": { "id": "http://www.example.com/tincan/activities/sqyCkLBd", "objectType": "Activity", "definition": { "name": { "en-US": "Example Activity" }, "description": { "en-US": "Example activity definition" } } } }
Record passing with score
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/completed", "display": { "en-US": "completed" } }, "result": { "completion": true, "success": true, "score": { "scaled": 0.9, "raw": 90, "min": 0, "max": 100 }, "duration": "PT0H5M2S" }, "object": { "id": "http://www.example.com/tincan/activities/sqyCkLBd", "objectType": "Activity", "definition": { "name": { "en-US": "Example Activity" }, "description": { "en-US": "Example activity definition" } } } }
Record fail with score
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/completed", "display": { "en-US": "completed" } }, "result": { "completion": true, "success": false, "score": { "scaled": 0.3, "raw": 30, "min": 0, "max": 100 }, "duration": "PT0H5M2S" }, "object": { "id": "http://www.example.com/tincan/activities/sqyCkLBd", "objectType": "Activity", "definition": { "name": { "en-US": "Example Activity" }, "description": { "en-US": "Example activity definition" } } } }
True/False
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "result": { "success": true, "duration": "PT0H0M3S", "response": "true" }, "object": { "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question1", "objectType": "Activity", "definition": { "name": {"en-US":"Question 1"}, "description": {"en-US":"Does the TCAPI include the concept of statements?"}, "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType": "true-false", "correctResponsesPattern": ["true"] } } }
Choice
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "result": { "success": true, "duration": "PT0H0M3S", "response": "golf" }, "object": { "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question2", "objectType": "Activity", "definition": { "name": {"en-US": "Question 2"}, "description": {"en-US": "Which of these prototypes are available at the beta site?"}, "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType": "choice", "correctResponsesPattern": ["golf[,]tetris"], "choices": [ {"id": "golf", "description": {"en-US": "Golf Example"}}, {"id": "facebook", "description": {"en-US": "Facebook App"}}, {"id": "tetris", "description": {"en-US": "Tetris Example"}}, {"id": "scrabble", "description": {"en-US": "Scrabble Example"}} ] } } }
Fill-in
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "object": { "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question3", "objectType": "Activity", "definition": { "name": {"en-US": "Question 3"}, "description": {"en-US": "Ben is often heard saying: "}, "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType": "fill-in", "correctResponsesPattern": ["Bob’s your uncle"] } } }
Likert
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "object": { "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question3", "objectType": "Activity", "definition": { "name": {"en-US": "Question 3"}, "description": {"en-US": "How awesome is xAPI?"}, "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType": "likert", "correctResponsesPattern": ["likert_3"], "scale": [ {"id": "likert_0", "description": {"en-US": "It’s OK"}}, {"id": "likert_1", "description": {"en-US": "It’s Pretty Cool"}}, {"id": "likert_2", "description": {"en-US": "It’s Damn Cool"}}, {"id": "likert_3", "description": {"en-US": "It’s Gonna Change the World"}} ] } } }
Matching
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "object": { "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question4", "objectType": "Activity", "definition":{ "name":{"en-US":"Question 4"}, "description":{"en-US":"Match these people to their kickball team:"}, "type":"http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType":"matching", "correctResponsesPattern":[ "ben[.]3[,]chris[.]2[,]troy[.]4[,]freddie[.]1" ], "source":[ { "id":"ben", "description":{"en-US":"Ben"} }, { "id":"chris", "description":{"en-US":"Chris"} }, { "id":"troy", "description":{"en-US":"Troy"} }, { "id":"freddie", "description":{"en-US":"Freddie"} } ], "target":[ { "id":"1", "description":{"en-US":"SCORM Engine"} }, { "id":"2", "description":{"en-US":"Pure-sewage"} }, { "id":"3", "description":{"en-US":"Tin Can xAPI"} }, { "id":"4", "description":{"en-US":"SCORM Cloud"} } ] } } }
Performance
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "object": { "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question5", "objectType": "Activity", "definition": { "name": {"en-US": "Question 5"}, "description": {"en-US": "This interaction measures performance over a day of RS sports:"}, "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType": "performance", "correctResponsesPattern": ["pong[.]1:[,]dg[.]:10[,]lunch[.]"], "steps": [ {"id": "pong", "description": {"en-US": "Net pong matches won"}}, {"id": "dg", "description": {"en-US": "Strokes over par in disc golf at Liberty"}}, {"id": "lunch", "description": {"en-US": "Lunch having been eaten"}} ] } } }
Sequencing
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "object": { "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question6", "objectType": "Activity", "definition": { "name": {"en-US": "Question 6"}, "description": {"en-US": "Order players by their pong ladder position:"}, "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType": "sequencing", "correctResponsesPattern": ["tim[,]mike[,]ells[,]ben"], "choices": [ {"id": "tim", "description": {"en-US": "Tim"}}, {"id": "ben", "description": {"en-US": "Ben"}}, {"id": "ells", "description": {"en-US": "Ells"}}, {"id": "mike", "description": {"en-US": "Mike"}} ] } } }
Numeric
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "object": { "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question7", "objectType": "Activity", "definition": { "name": {"en-US": "Question 7"}, "description": {"en-US": "How many jokes is Chris the butt of each day?"}, "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType": "numeric", "correctResponsesPattern": ["4:"] } } }
Other
{ "actor": { "mbox": "mailto:user@example.com", "name": "Joe User", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "object": { "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question8", "objectType": "Activity", "definition": { "name": {"en-US": "Question 8"}, "description": {"en-US": "On this map, please mark Franklin, TN"}, "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType": "other", "correctResponsesPattern": ["(35.937432,-86.868896)"] } } }
Questions about the cookbook?
Ask us anything. We’re here to help.