Created
February 13, 2013 17:28
-
-
Save brianjmiller/4946347 to your computer and use it in GitHub Desktop.
Sample TinCanJS usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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