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
2. 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
4. TinCanAPI.com #TinCanAPI
Why JSON?
● JavaScript Object Notation
● Browser support thus library support
● Human Readable
● Minimalist (transfer size)
● Arbitrarily nestable
● “Executable”
● Popular
5. 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
9. 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
10. 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
14. TinCanAPI.com #TinCanAPI
Properties vs. Object Types
id
actor
verb
object
context
result
timestamp
stored
authority
version
attachments
Agent
Group
Verb
Activity
Activity Definition
Context
Result
Score
Statement Reference
Sub-Statement
Language Map
17. 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:brian.miller@tincanapi.com”,
“name”: “Brian J. Miller”
}
{
“account”: {
“homePage”: “http://twitter.com”,
“name”: “k95bm01”
},
“name”: “Brian J. Miller (on Twitter)”
}
18. 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”
},
.
.
.
}
]
}
22. 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”
}
}
25. 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
26. 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.”
}
}
}
27. TinCanAPI.com #TinCanAPI
Build a Statement
{
“actor”: {
“mbox”: “mailto:brian.miller@tincanapi.com”
},
“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.”
}
}
}
}
36. 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
39. 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
42. 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
45. 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
47. 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
Overall objective: Enable people to go out and capture all of the facets of an experience that they ’ d like to, beyond the simple Actor-Verb-Object
New to the e-learning industry, landed at the perfect moment to take up Tin Can as .95 was landing “ Maintainer ” and Primary developer as opposed to sole developer, open source software so community contributions appreciated
JavaScript is the language of the browser and hence the web Important for understanding because used for things outside of the scope of statements Other APIs are dropping support for XML and converging to JSON
Going to use URI instead of IRI cause I ’ ve just been doing this too long 1 character changes a URI, for instance a trailing slash Community effort established by Rustici to advance adoption of the specification Mention that other registries can and do exist
GUID is the generic name for a class of unique identifiers, UUID is a specific standard for one implementation
Members must be agents but they need not be identified by the same set of parameters as the identified group or each other
Vast range of available options, check the registry for an ever growing list
Indicate that spec says “ SHOULD ” for “ display ” , so while optional its a best practice to always include it
“ there is so much confusion about this you should touch on there being one definition per activity ID, it can't be changed on a per-statement basis. (gross oversimplification, but that's what's needed here) ” -- Ben Clark
At this point the statement is spec compliant and can be sent to an LRS.
At this point the statement is spec compliant and can be sent to an LRS.
contextActivities can take either a single or an array of one or more
Key to interoperability, must be a UUID so that collisions should be prevented across systems PK enables things such as favoriting, etc. Necessary for voiding from statement reference
Talk about ambiguity of time (start, middle, end of experience)
Statement as received back from the SCORM Cloud LRS
Sending attachment data requires sending a multipart/mixed request