Retrieving xAPI statement records not working

386 views Asked by At

I am trying to retrieve records from an LRS and I'm using code that previously worked fine. Now when I try it and look at the console it says "Uncaught ReferenceError: TinCan is not defined" for lines 12, 20 and 71. I do have the tincan.js file in the same folder as the html file.

    <!DOCTYPE  html> 
<html lang='en'> 
    <head> 
        <meta charset='UTF-8'> 
        <title>Get statements  101</title> 
        <script type="text/javascript" src="tincan.js"></script> 
    </head> 
    <body> 
        <h1>Get statements  101</h1> 
        <div id='response'></div>
        <script>
       var tincan = new TinCan (
    {
        recordStores: [
            {
                endpoint: "https://lrs.adlnet.gov/xapi/",
                username: "xapi-tools",
                password: "xapi-tools",
                allowFail: false
            }
        ]
    }
);

        var container =  document.getElementById('response');
        tincan.getStatements({
            'callback': function (err, result) {
                container.innerHTML = (err !== null ? 'ERROR' : JSON.stringify(result.statements));
            }
        });
        </script> 
    </body> 
</html>
0

There are 0 answers