Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
Created February 13, 2013 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjmiller/4946347 to your computer and use it in GitHub Desktop.
Save brianjmiller/4946347 to your computer and use it in GitHub Desktop.
Sample TinCanJS usage
TinCan.enableDebug();
var tincan = new TinCan (
{
recordStores: [
{
endpoint: "https://cloud.scorm.com/ScormEngineInterface/TCAPI/public/",
auth: "" // Base64 encoded string that looks like "test:password"
}
]
}
);
tincan.sendStatement(
// any statement as raw object literal or pre-constructed TinCan.Statement
{
actor: {
mbox: "mailto:test@scorm.com"
},
verb: {
id: "http://adlnet.gov/expapi/verbs/experienced"
},
object: {
id: "http://......"
}
},
function (err, xhr) {
if (err === null) {
// success
} else {
// failure
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment