I have added a Tin Can course to my LMS and I am successfully able to upload and playback the course so that my statements are being written to the Initial Application Realm LRS. So far so good.
Now I want to be able to retrieve from the LRS a list of all statements that have been written so that I can iterate through these and check for course completion for the signed in user. My statements are being written to the following endpoint:
https://cloud.scorm.com/tc/7QLMQA89WV/
I have tried to query the statements by using the .NET library and the following code:
//Initialize the TinCan Remote LRS for retrieving completion statistics
LRS = new RemoteLRS("https://cloud.scorm.com/tc/7QLMQA89WV/", "<username>", "<pw>");
Version = TinCan.TCAPIVersion.V101;
//Create the TinCan statement to query completed activities for the logged in user
var query = new StatementsQuery();
query.agent = new TinCan.Agent();
query.agent.mbox = "mailto:[email protected]";
query.verbId = new Uri("http://adlnet.gov/expapi/verbs/completed");
query.activityId = new Uri("http://tincanapi.com/GolfExample_TCAPI");
This however is returning a list of all statements regardless of verb or activity that have been used. Could there possibly be a bug in the query filter as when using SCORM Cloud I can see the TCAPI query string and when entering the URI of the Verb or Activity here it filters appropriately.
As a means of testing that the statements was being output correctly I also have the following on my view, not sure if this is the best way to get a human readable version of the statement, but I have this output for each statement within my List
<p>@statement.actor.name @statement.verb.display.ToJObject().GetValue("und") '@statement.target.ToJObject(Model.Version)["definition"]["name"]["en-US"]'</p>
I recommend using the TinCanJS library. I'll update with a link later, but you should be able yo find it and instructions on Google.