Upload
rustici-software
View
9.038
Download
0
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
TinCanAPI.com #TinCanAPI
Anatomy of a Tin Can Statement
Brian J. MillerRustici Software
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
TinCanAPI.com #TinCanAPI
JSON
TinCanAPI.com #TinCanAPI
Why JSON?
● JavaScript Object Notation● Browser support thus library support● Human Readable● Minimalist (transfer size)● Arbitrarily nestable● “Executable”● Popular
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
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” }}
TinCanAPI.com #TinCanAPI
Sample JSON
[ { “sample2”: “Array at top level works too” }, { “sample3”: “List of objects this time” }]
TinCanAPI.com #TinCanAPI
IdentifiersIRI, UUIDs
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
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
TinCanAPI.com #TinCanAPI
Language Map
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”: “...”}
TinCanAPI.com #TinCanAPI
Building Statements{ }
TinCanAPI.com #TinCanAPI
Properties vs. Object Types
idactorverbobjectcontextresulttimestampstoredauthorityversionattachments
AgentGroupVerbActivityActivity DefinitionContextResultScoreStatement ReferenceSub-StatementLanguage Map
TinCanAPI.com #TinCanAPI
“actor”Agent/Group
TinCanAPI.com #TinCanAPI
“actor”
● Who the statement is about● Required property of a statement● Value is an Agent or Group
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)”}
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” }, . . . } ]}
TinCanAPI.com #TinCanAPI
“verb”
TinCanAPI.com #TinCanAPI
“verb”
● What occurred, the action● Required property of a statement● Value is a Verb● Past tense
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” }}
TinCanAPI.com #TinCanAPI
Build a Statement
{ “actor”: { “mbox”: “mailto:[email protected] ” }, “verb”: { “id”: “http://adlnet.gov/expapi/verbs/experienced”, “display”: { “en-US”: “experienced” } }}
TinCanAPI.com #TinCanAPI
“object”Activity, Agent/Group
Statement Reference, Sub-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
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.” } }}
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.” } } }}
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” }}
TinCanAPI.com #TinCanAPI
“context”Context Object
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
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” } } }}
TinCanAPI.com #TinCanAPI
“result”Result Object
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
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” }}
TinCanAPI.com #TinCanAPI
“id”
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
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” } } }}
TinCanAPI.com #TinCanAPI
“timestamp”
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
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” } } }}
TinCanAPI.com #TinCanAPI
Properties Set by the Learning Record Store
“stored”, “authority”, “version”
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
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" }}
TinCanAPI.com #TinCanAPI
“extensions”Activity Definition, Context, Result
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
TinCanAPI.com #TinCanAPI
“attachments”
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
TinCanAPI.com #TinCanAPI
Public LRSStatement Viewer
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
TinCanAPI.com #TinCanAPI
Questions?
TinCanAPI.com #TinCanAPI
Thank You!
TinCanAPI.com #TinCanAPI
Contact Us
Questions?Comments?
http://tincanapi.com/talk/
#TinCanAPI@projecttincan, @k95bm01
[email protected], [email protected],[email protected]
/join #tincanapi @ freenode