Tech Dive into Tin Can
(Use arrows to navigate.)

History

Key Concepts





REST + JSON Web Service

Tin Can Endpoint

[endpoint]/statements
ex: http://tincanapi.com/lrs/statements

Client Config

JSON refresher

 {
    "simpleProperty":"someSimpleValue",
    "complexProperty":{
        "someOtherProp":"etc",
        "complexity":0.1
    },
    "lastProperty":{
        "arbitrary" : {
            "nesting":{ "is":"allowed" }
        }
    }
}

Simple Statement

David Ells attended 'A Tech Dive into Tin Can'

{
   "actor": {
       "name": "David Ells",
       "mbox": "mailto:david.ells@scorm.com"
    },
    "verb": {
         "id": "http://adlnet.gov/expapi/verbs/attended",
         "display": {"en-US": "attended"}
         },
    "object": {
        "id": "http://tincanapi.com/activities/tech_dive_webinar",
        "definition":{
            "name": {"en-US": "A Tech Dive into Tin Can"}
        }
    }
}

What are Statements?

Statement Structure

Basic Format

[actor] [verb] [object]

[Sally] [experienced] [Solo Hang Gliding]

Statement Structure

Sally experienced "Solo Hang Gliding"

{
    "actor": {
        "name": "Sally",
        "mbox": "mailto:sally@example.com"
     },
     "verb": {
         "id": "http://adlnet.gov/expapi/verbs/experienced",
         "display": {"en-US": "experienced"}
         },
     "object": {
         "id": "http://example.com/activities/solo-hang-gliding",
         "definition": {
             "name": { "en-US": "Solo Hang Gliding" }
         }
     }
}

Statement Structure

The "Why?" of Agents

Agent IDs

Email

{
   "name": "Sally",
   "mbox": "mailto:sally@example.com"
}

Open ID

{
   "name": "Sally",
   "openid": "http://sally.openid.example.com"
}

Agent IDs

System Account

{
   "name": "Sally",
   "account": [{ 
       "accountServiceHomePage": "http://twitter.com",
       "accountName": "sallyglider434"
   }]
}

Use of URIs

Activities

Activities

Activity Structure

Solo Hang Gliding, as defined by example.com

{
    "id": "http://example.com/activities/solo-hang-gliding",
    "definition": {
        "name": { "en-US": "Solo Hang Gliding" }
        "description": {
            "en-US": "An assessment of hang gliding skill, consisting of a 20 minute
                      flight from launch point #2 on Mount Magazine. See URL for 
                      additional info."
        }
    }
}

More Activity Structure!

Solo Hang Gliding, from example.com, with internationalization

{
  "id": "http://example.com/activities/solo-hang-gliding",
  "definition": {
    "type":"http://adlnet.gov/expapi/activities/course",
    "name": { 
        "en-US": "Solo Hang Gliding",
        "es":"Solo Ala Delta"
     },
     "description": {
         "en-US":"The 'Solo Hang Gliding' course provided by The Hang Glider's Club",
         "es":"El curso de 'Solo Ala Delta' siempre por el Club de Planeadores Hang"
     }
}

Verbs

{
    "id": "http://adlnet.gov/expapi/verbs/completed",
    "display": {"en-US":"completed" }
}

Verb vs Activity

Verb vs Activity

Sally experienced 'Solo Hang Gliding at Mount Magazine'

{
    "actor": {
        "name": "Sally Glider",
        "mbox": "mailto:sally@example.com"
     },
     "verb": {
         "id": "http://adlnet.gov/expapi/verbs/experienced",
         "display": {"en-US": "experienced"}
         },
     "object": {
		"id": "http://example.com/activities/solo-hang-gliding-Mt-Magazine",
				"definition": {
					"name": { "en-US": "Solo Hang Gliding" }
				}
		}
	}
}

Verb vs Activity

Sally hang-glided Mount Magazine

{
    "actor": {
        "name": "Sally",
        "mbox": "mailto:sally@example.com"
     },
     "verb": {
        "id":"http://example.com/verbs/hang-glided",
        "display": {"en-US":"hang-glided" }
     },
     "object": {
         "id": "http://example.com/objects/mount-magazine",
         "definition": {
             "name": { "en-US": "Mount Magazine" }
         }
     }
}

Verb vs Activity

{
    "actor": {
        "name": "Sally",
        "mbox": "mailto:sally@example.com"
     },
     "verb": {
         "id": "http://adlnet.gov/expapi/verbs/experienced",
         "display": {"en-US": "experienced"}
         },
     "object": {
         "id": "http://example.com/activities/solo-hang-gliding",
         "definition": {
             "name": { "en-US": "Solo Hang Gliding" }
         }
     }
}

Statements, Round 2

[authority] asserts [actor] [verb] [object] in [context] with [result]

Context

Context

"Sally took the ‘Solo Hang Gliding’ course, under the instruction of Irene, as part of Hang Gliding Class A"

{
    "actor": { "mbox": "mailto:sally@example.com" },
    "verb": {
         "id": "http://adlnet.gov/expapi/verbs/experienced",
         "display": {"en-US": "experienced"}
         },
    "object": { "id": "http://example.com/activities/solo-hang-gliding" },
    "context": {
        "instructor": {
            "name": "Irene",
            "mbox": "mailto:irene@example.com"
         },
         "contextActivities":{
             "parent": { 
                "id": "http://example.com/activities/hang-gliding-class-a" 
             }
         }
    }
}

Context

"Sally watched the ‘Solo Hang Gliding Refresher’ video on her fancy iPhone

{
    "actor": { 
        "mbox": "mailto:sally@example.com" 
    },
    "verb": {
         "id": "http://adlnet.gov/expapi/verbs/experienced",
         "display": {"en-US": "experienced"}
         },
    "object": { 
        "id": "http://example.com/activities/solo-hang-gliding-refresher" 
        "definition":{
            "type":"
	http://adlnet.gov/expapi/activities/media",
            "name":{ "en-US":"Solo Hang Gliding Refresher" },
            "description": {
                "en-US":"A short refresher on Hang Gliding"
            }
    },
    "context": {
        "platform": "iPhone OS 6_0"
    }
}

Result

Result

"Sally completed ‘Solo Hang Gliding’ with a passing score of 95%"

{
   "actor": {
       "name": "Sally",
       "mbox": "mailto:sally@example.com"
    },
     "verb": {
         "id": "http://adlnet.gov/expapi/verbs/completed",
         "display": {"en-US": "completed"}
         },
    "object": {
        "id": "http://example.com/activities/solo-hang-gliding"
    },
    "result": {
        "completion": true,
        "success": true,
        "score": {
            "scaled": 0.95
        }
    }
}

Result

"Sally completed ‘Solo Hang Gliding’ with a failing score of 2 out of 6"

{
   "actor": {
       "name": "Sally",
       "mbox": "mailto:sally@example.com"
    },
     "verb": {
         "id": "http://adlnet.gov/expapi/verbs/completed",
         "display": {"en-US": "completed"}
         },
    "object": {
        "id": "http://example.com/activities/solo-hang-gliding"
    },
    "result": {
        "completion": true,
        "success": false,
        "score": {
            "min": 0,
            "max": 6,
            "raw": 2
        }
    }
}

Result

"Sally completed ‘Solo Hang Gliding’ and passed, in 4 hours"

{
   "actor": {
       "name": "Sally",
       "mbox": "mailto:sally@example.com"
    },
     "verb": {
         "id": "http://adlnet.gov/expapi/verbs/completed",
         "display": {"en-US": "completed"}
         },
    "object": {
        "id": "http://example.com/activities/solo-hang-gliding"
    },
    "result": {
        "completion": true,
        "success": true,
        "duration": "PT4H"
    }
}

Result

"Sally answered ‘Question A’ with the correct response 'B', in 8 seconds"

{
   "actor": {
       "name": "Sally",
       "mbox": "mailto:sally@example.com"
    },
     "verb": {
         "id": "http://adlnet.gov/expapi/verbs/answered",
         "display": {"en-US": "answered"}
         },
    "object": {
        "id": "http://example.com/questions/question-a"
    },
    "result": {
        "success": true,
        "response": "B",
        "duration": "PT8S"
    }
}

Extensions

Extensions

{
    "actor": { "mbox": "mailto:sally@example.com" },
     "verb": {
         "id": "http://adlnet.gov/expapi/verbs/completed",
         "display": {"en-US": "completed"}
         },
    "object": {
        "id": "http://example.com/activities/solo-hang-gliding"
    },
    "result": {
        "completion": true,
        "success": true,
        "extensions": {
            "http://example.com/metersClimbed": 500
        }
    },
    "context": {
        "extensions": {
            "http://example.com/wind_gusts": { "knots" : 17 }
        }
    }
}

Timestamp and Stored

Timestamp is when the event happened, stored is when the LRS knew about it.

{
   "actor": {
       "name": "Sally",
       "mbox": "mailto:sally@example.com"
    },
    "verb": {
         "id": "http://adlnet.gov/expapi/verbs/experienced",
         "display": {"en-US": "experienced"}
         },
    "object": {
        "id": "http://example.com/activities/solo-hang-gliding",
        "definition": {
            "name": { "en-US": "Solo Hang Gliding" }
        }
    },
    "timestamp" : "2012-09-27T19:45:29.115Z",
    "stored" : "2012-09-27T22:48:29.828Z"
}

Authority

Irene asserts that Sally completed 'Solo Hang Gliding'

{
    "authority": {
        "name": "Irene",
        "mbox": "mailto:irene@example.com"
    },
    "actor": {
       "name": "Sally",
       "mbox": "mailto:sally@example.com"
    },
    "verb": {
         "id": "http://adlnet.gov/expapi/verbs/completed",
         "display": {"en-US": "completed"}
         },
    "object": {
        "id": "http://example.com/activities/solo-hang-gliding",
        "definition": {
            "name": { "en-US": "Solo Hang Gliding" }
        }
    }
}

Authority

Hang Glider App asserts that Sally completed 'Solo Hang Gliding'

{
    "authority": {
        "name": "Hang Glider App",
        "account": [{ 
            "accountServiceHomePage": "http://glider-club.example.com",
            "accountName": "glider-app"
        }]
    },
    "actor": {
       "name": "Sally",
       "mbox": "mailto:sally@example.com"
    },
    "verb": {
         "id": "http://adlnet.gov/expapi/verbs/completed",
         "display": {"en-US": "completed"}
         },
    "object": {
        "id": "http://example.com/activities/solo-hang-gliding",
        "definition": {
            "name": { "en-US": "Solo Hang Gliding" }
        }
    }
}

Give it a try!

{
   "actor": {
       "name": "Your Name",
       "mbox": "mailto:your-email@example.com"
    },
    "verb": {
         "id": "http://adlnet.gov/expapi/verbs/attended",
         "display": {"en-US": "attended"}
         },
    "object": {
        "id": "http://tincanapi.com/activities/tech_dive_webinar"
    }
}

Give it a try!

{
    "actor": {
        "mbox": "mailto:david.ells@scorm.com",
    },
    "verb": {
         "id": "http://adlnet.gov/expapi/verbs/experienced",
         "display": {"en-US": "experienced"}
         },
    "object": {
        "id": "http://news.ycombinator.com/",
        "definition": {
            "name": { "en-US": "Hacker News" }
        }
    }
}

Getting Started

/

#