52
TinCanAPI.com #TinCanAPI Anatomy of a Tin Can Statement Brian J. Miller Rustici Software

Anatomy of a Tin Can Statement

Embed Size (px)

DESCRIPTION

Brian Miller is one of the world’s top Tin Can experts, will be presenting a technically oriented webinar that will take a deep-dive into each part of a Tin Can statement. Topics that Brian will cover: • Actor/Agent • Verbs • Activities • Objects • Attachments • Context • Result • Extensions • Others

Citation preview

Page 1: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Anatomy of a Tin Can Statement

Brian J. MillerRustici Software

Page 2: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Brian

● Long time web developer● Maintainer of TinCanJS, TinCanJava, TinCan_Prototypes● Primary developer, maintainer and now curator of The Registry● Contributor to the specification● Up and comer on the Rustici Software Pong Ladder

Page 3: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

JSON

Page 4: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Why JSON?

● JavaScript Object Notation● Browser support thus library support● Human Readable● Minimalist (transfer size)● Arbitrarily nestable● “Executable”● Popular

Page 5: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

JSON Entities

● Strings are quoted● Numbers, booleans (`true`, `false`), and `null` are primitives

○ Primitives are not quoted

● { } indicates an Object○ Objects have a key/value pair structure○ The key is known as a “property”○ Keys must be strings (quoted)○ : is the separator○ , is the delimiter○ Values are strings, primitives, arrays and objects

● [ ] indicates an Array○ Contains a list of values: strings, literals, objects and arrays○ , is the delimiter

● Whitespace is ignored

Page 6: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Sample JSON

{ “simpleProperty”: “Some string value”, “listProperty”: [ “first in list”, “second in list” ], “booleanProperty”: true, “nullProperty”: null, “nestedObject”: { “somePropertyOfObject”: “I’m inside an object” }}

Page 7: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Sample JSON

[ { “sample2”: “Array at top level works too” }, { “sample3”: “List of objects this time” }]

Page 8: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

IdentifiersIRI, UUIDs

Page 9: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

IRI vs URI vs URL

● Commonly recognizable by the non-technical● Domain Specific Identifier● Allows for “Ownership”● Allows for Resolvability (and Updates)● Multiple Object Uses● The Registry

tag:adlnet.gov,2013:expapi:0.9:activities:6VoMrbxMPZD

http://rusticisoftware.github.com/TinCanJS

Ben Clark
Example of each maybe?
Page 10: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Gooowhat?

● Two names for basically the same thing● Specification uses UUID (version 4)● Good library support

72c099dc-6388-4964-b7e5-

3a2a4c34e452

f58f502c-e711-4e77-aed1-

7d4ea8c07f44

27c8e14c-9055-4ef3-bdb9-

eb5dc60987ee

Page 11: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Language Map

Page 12: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Language Map

● Object of language code to string mappings● Provides Internationalization (I18N)● RFC5646 for properties● “und”

{ “en-US”: “...”, “en-GB”: “...”, “es-ES”: “...”, “es-MX”: “...”, “de-DE”: “...”}

Page 13: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Building Statements{ }

Page 14: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Properties vs. Object Types

idactorverbobjectcontextresulttimestampstoredauthorityversionattachments

AgentGroupVerbActivityActivity DefinitionContextResultScoreStatement ReferenceSub-StatementLanguage Map

Page 15: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“actor”Agent/Group

Page 16: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“actor”

● Who the statement is about● Required property of a statement● Value is an Agent or Group

Page 17: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Agent

● One Representation of a Person● Ways to identify an Agent

○ Email Address (or mbox)○ mbox SHA1○ OpenID○ Account

● Named

{ “mbox”: “mailto:[email protected]”, “name”: “Brian J. Miller”}

{ “account”: { “homePage”: “http://twitter.com”, “name”: “k95bm01” }, “name”: “Brian J. Miller (on Twitter)”}

Page 18: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Group

● Subtype of Agent● ‘objectType’ property required● Two kinds

○ Identified○ Anonymous

● Has a “members” property○ Value is an array○ Members are Agents

{ “objectType”: “Group”, “account”: { “homePage”: “http://twitter.com”, “name”: “rusticisoftware” }, “name”: “Rustici Software (on Twitter)”, “members”: [ { “account”: { “homePage”: “http://twitter.com”, “name”: “k95bm01” }, . . . } ]}

Page 19: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Build a Statement

{ “actor”: { “mbox”: “mailto:[email protected]” }}

Page 20: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“verb”

Page 21: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“verb”

● What occurred, the action● Required property of a statement● Value is a Verb● Past tense

Page 22: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Verb

● Required “id” property with URI value● Optional but highly recommended “display” property with Language Map

value

{ “id”: “http://adlnet.gov/expapi/verbs/experienced”, “display”: { “en-US”: “experienced” }}

Ben Clark
display SHOULD be used, the better simplification is probably just to drop the word 'Optional'.
Page 23: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Build a Statement

{ “actor”: { “mbox”: “mailto:[email protected] ” }, “verb”: { “id”: “http://adlnet.gov/expapi/verbs/experienced”, “display”: { “en-US”: “experienced” } }}

Page 24: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“object”Activity, Agent/Group

Statement Reference, Sub-Statement

Page 25: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“object” property

● Target of the action● Required property of a statement● Multiple possible types of value

○ Activity○ Agent/Group○ Statement Reference○ Sub-Statement

Page 26: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Activity

● “id” property is a URI● “definition” takes an Activity Definition object

○ “type” is a URI○ “name” and “description” are language maps○ “moreInfo” is a URL○ “extensions” object○ Other properties for interactions

{ “id”: “http://tincanapi.com/webinar/anatomy-of-a-statement”, “definition”: { “type”: “http://adlnet.gov/expapi/activities/media”, “name”: { “en-US”: “Anatomy of a Tin Can Statement” }, “description”: { “en-US”: “Presentation about the parts of a Tin Can Statement.” } }}

Page 27: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Build a Statement{ “actor”: { “mbox”: “mailto:[email protected]” }, “verb”: { “id”: “http://adlnet.gov/expapi/verbs/experienced”, “display”: { “en-US”: “experienced” } }, “object”: { “id”: “http://tincanapi.com/webinar/anatomy-of-a-statement”, “definition”: { “type”: “http://adlnet.gov/expapi/activities/media”, “name”: { “en-US”: “Anatomy of a Tin Can Statement” }, “description”: { “en-US”: “Presentation about the parts of a Tin Can Statement.” } } }}

Page 28: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Build a Statement{ “actor”: { “mbox”: “mailto:[email protected]”, “name”: “Mike Rustici” }, “verb”: { “id”: “http://id.tincanapi.com/verb/hired”, “display”: { “en-US”: “hired” } }, “object”: { “mbox”: “mailto:[email protected]”, “name”: “Brian J. Miller”, “objectType”: “Agent” }}

Page 29: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“context”Context Object

Page 30: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“context” property

● Value is Context object● All properties optional

○ contextActivities - Object with "parent', "category", "grouping", and "other"○ registration - UUID○ instructor - Agent/Group○ team - Group○ statement - Statement Reference○ revision - String○ platform - String○ language - RFC5646 String, when known○ extensions - Object

Page 31: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Build a Statement{ “actor”: { “mbox”: “mailto:[email protected]” }, “verb”: { “id”: “http://adlnet.gov/expapi/verbs/experienced”, “display”: { “en-US”: “experienced” } }, “object”: { “id”: “http://tincanapi.com/webinar/anatomy-of-a-statement/slide37”, “definition”: { “name”: {“en-US”: “Slide 37”} } }, “context”: { “registration”: “111b5f5d-c54d-4b9c-8eb3-0b646f207496”, “contextActivities”: { “parent”: { “id”: “http://tincanapi.com/webinar/anatomy-of-a-statement” } } }}

Page 32: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“result”Result Object

Page 33: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“result” property

● Value is Result object● All properties optional

○ "completion" - Boolean○ "success" - Boolean○ "duration" - ISO8601 Duration○ "score" - Score, object of numerical properties

■ "scaled"■ "raw"■ "min"■ "max"

○ "extensions" - Object

Page 34: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Build a Statement{ “actor”: { “mbox”: “mailto:[email protected]” }, “verb”: { “id”: “http://adlnet.gov/expapi/verbs/completed”, “display”: {“en-US”: “completed”} }, “object”: { “id”: “http://tincanapi.com/webinar/anatomy-of-a-statement/pop-quiz”, “definition”: { “name”: {“en-US”: “Pop Quiz”} } }, “context”: { “contextActivities”: { “parent”: {“id”: “http://tincanapi.com/webinar/anatomy-of-a-statement”} } }, “result”: { “completion”: true, “success”: true, “score”: { “raw”: 97, “scaled”: 0.97 }, “duration”: “PT15M32S” }}

Page 35: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“id”

Page 36: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“id” Property

● Identifies a specific statement● Value is a UUID● Optional when sending statement to an LRS● Set by LRS if not included● Used in Statement Reference objects● Use to query single statements● Provides primary key for systems

72c099dc-6388-4964-b7e5-3a2a4c34e452

Page 37: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Build a Statement

{ “id”: “69552da6-14c0-4e8d-bac5-2c026488f295”, “actor”: { “mbox”: “mailto:[email protected]” }, “verb”: { “id”: “http://adlnet.gov/expapi/verbs/experienced”, “display”: { “en-US”: “experienced” } }, “object”: { “id”: “http://tincanapi.com/webinar/anatomy-of-a-statement/slide37”, “definition”: { “name”: {“en-US”: “Slide 37”} } }, “context”: { “registration”: “111b5f5d-c54d-4b9c-8eb3-0b646f207496”, “contextActivities”: { “parent”: { “id”: “http://tincanapi.com/webinar/anatomy-of-a-statement” } } }}

Page 38: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“timestamp”

Page 39: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“timestamp” Property

● Date and time when statement is created● Value is an ISO8601 formatted string● Optional when sending statement to an LRS● Set by LRS if not included

2013-09-11T14:52:46.907Z

Page 40: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Build a Statement{ “id”: “69552da6-14c0-4e8d-bac5-2c026488f295”, “timestamp”: “2013-09-11T22:38:16.329Z”, “actor”: { “mbox”: “mailto:[email protected]” }, “verb”: { “id”: “http://adlnet.gov/expapi/verbs/experienced”, “display”: { “en-US”: “experienced” } }, “object”: { “id”: “http://tincanapi.com/webinar/anatomy-of-a-statement/slide37”, “definition”: { “name”: {“en-US”: “Slide 37”} } }, “context”: { “registration”: “111b5f5d-c54d-4b9c-8eb3-0b646f207496”, “contextActivities”: { “parent”: { “id”: “http://tincanapi.com/webinar/anatomy-of-a-statement” } } }}

Page 41: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Properties Set by the Learning Record Store

“stored”, “authority”, “version”

Page 42: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

LRS Set Properties

“authority”●Indicates who asserts the statement●Value is an Agent or Group●Group of two members when using OAuth

“stored”●Date and time when statement is stored in the LRS●Value is an ISO8601 formatted string●Not used when sending statement to an LRS●Set by LRS even if already exists

“version”●1.0.0+ Single Stream

Page 43: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Fetch a Statement{ "id": "69552da6-14c0-4e8d-bac5-2c026488f295", "actor": { "mbox": "mailto:[email protected]", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/experienced", "display": {"en-US": "experienced"} }, "context": { "registration": "111b5f5d-c54d-4b9c-8eb3-0b646f207496", "contextActivities": { "parent": [ { "id": "http://tincanapi.com/webinar/anatomy-of-a-statement", "objectType": "Activity" } ] } }, "timestamp": "2013-09-12T01:37:13.128Z", "stored": "2013-09-12T01:37:13.128Z", "authority": { "name": "Test Activity Provider", "account": { "homePage": "http://cloud.scorm.com/", "name": "FACN92U0w1fM" }, "objectType": "Agent" }, "version": "1.0.0", "object": { "id": "http://tincanapi.com/webinar/anatomy-of-a-statement/slide37", "definition": { "name": { "en-US": "Slide 37" } }, "objectType": "Activity" }}

Page 44: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“extensions”Activity Definition, Context, Result

Page 45: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“extensions” property

● Catch all object● For use in Activity Definition, Context, and Result● Properties are URIs● Values can be anything● See The Registry

http://id.tincanapi.com/extension/tweet

Page 46: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“attachments”

Page 47: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

“attachments”

● Array of objects defining a list of files● Required properties

○ “usageType” - URI, The Registry○ “display” - Language map○ “contentType” - RFC2046 MIME Media Type○ “length” - Integer (number of octets)○ “sha2” - String hash used as identifier

● Optional properties○ “description” - Language map○ “fileUrl” - URL for source

Page 48: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Public LRSStatement Viewer

Page 49: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Public LRShttp://tincanapi.com/public-lrs

Statements generated that are sent to the public endpoint provided on SCORM Cloud

Clicking a statement will show the raw JSON

Page 50: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Questions?

Page 51: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Thank You!

Page 52: Anatomy of a Tin Can Statement

TinCanAPI.com #TinCanAPI

Contact Us

Questions?Comments?

http://tincanapi.com/talk/

#TinCanAPI@projecttincan, @k95bm01

[email protected], [email protected],[email protected]

/join #tincanapi @ freenode