tin can API or xAPI send statement to the LRS

878 views Asked by At

I am using tin can api or xAPI and I tried this javascript code to send a JSON statement to the LRS and it's worked correctly but I have a problem I need to send specific record like the URL that opened in the window browser or any record but it couldn't send so any help

$(window).ready(function(){
    $(".clickme").click(function(){
        var url = window.URL;
        var tincan = new TinCan ({
            recordStores: [{
                endpoint: "https://cloud.scorm.com/tc/HD1A9O7JK5/",
                username: "[email protected]",
                password: "******* my Pass",
                allowFail: false
            }]
        });

        tincan.sendStatement({
            actor: {
                mbox: "mailto:[email protected]"
            },
            verb: {
                id: "http://adlnet.gov/expapi/verbs/attempted"
            },
            target: {
                id: "http://tincanapi.com/activities/sending-my-new-statement"    
            }
        });
    })
});
0

There are 0 answers