jquery - Retrieving a list of Tin Can API statements from SCORM Cloud LRS -


i have added tin can course lms , able upload , playback course statements being written initial application realm lrs. far good.

now want able retrieve lrs list of statements have been written can iterate through these , check course completion signed in user. statements being written following endpoint:

https://cloud.scorm.com/tc/7qlmqa89wv/ 

i have tried query statements using .net library , following code:

//initialize tincan remote lrs retrieving completion statistics lrs = new remotelrs("https://cloud.scorm.com/tc/7qlmqa89wv/", "<username>", "<pw>"); version = tincan.tcapiversion.v101;  //create tincan statement query completed activities logged in user var query = new statementsquery(); query.agent = new tincan.agent(); query.agent.mbox = "mailto:jpmcfeely@hsl-data.com"; query.verbid = new uri("http://adlnet.gov/expapi/verbs/completed"); query.activityid = new uri("http://tincanapi.com/golfexample_tcapi");  

this returning list of statements regardless of verb or activity have been used. there possibly bug in query filter when using scorm cloud can see tcapi query string , when entering uri of verb or activity here filters appropriately.

as means of testing statements being output correctly have following on view, not sure if best way human readable version of statement, have output each statement within list

<p>@statement.actor.name @statement.verb.display.tojobject().getvalue("und") '@statement.target.tojobject(model.version)["definition"]["name"]["en-us"]'</p> 

+1 andrew's suggestion using library. reason getting results getting because missing 'x-experience-api-version' header library adds requests appropriately. lack of header means lrs interpreting request 0.9 version request , unless you've stored statements using version none returned (statements not down converted).

i know know library is, so's posterity:

http://rusticisoftware.github.io/tincanjs/

also note return lrs' first page of statements, you'll need handle 'more' url returned lrs fetch next page, recursively. tincanjs provides simple method doing well.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -