Tin Can Integration, module not resuming using State API

Jan 11, 2016

Hi again,

I have another problem while hosting an articulate module within a website, and integrating results using Tin Can.

This time I'm implementing support for the State API for capturing state (via state?method=PUT) and then returning the state so Articulate can resume (via state?method=GET)

So I'm successfully getting posted the PUT method, and saving the content data string into my database that seems to hold information on the state. Also, for reference, I've attached a screenshot from Fiddler which shows the details of the PUT web request.

Now I've implemented the GET method to try and let Articulate retrieve that state and resume where it's left off, but Articulate always just restarts at the first page.

I've tried a whole number of things, but I've also tried doing it according to the suggestions made here:

https://community.articulate.com/discussions/articulate-storyline/resume-tin-can-state

http://stackoverflow.com/questions/27933770/resume-in-articulate-with-tin-can-api

which advises to:

"just return that content string by itself and Articulate will resume to that specific spot it saved at."

and also "to explicitly set the content-type header to octet-stream"

I tried both those things, and I can see in Fiddler that the module is calling the GET method and my response is formatted as described, and the response is being sent back with a Http code of 200. But the module always just opens on the first page.

I know that in the Articulate options there are the resume settings, and I definitely have the "run in LMS, ignore flash cookie" setting checked, and have tried both Always Resume and prompt for Resume settings.

I've included a screenshot from Fiddler of my GET request, with that crazy state string returned as the request body. I've also tried with the json:

{"data":"2w26706080on1001211f010110111101211y101^1^n6CGyp0CNZaR.5zDe5hklD0O1^1^0~2k1~2e1cb101001a1a103lx0m3400978030111^34803400yw2Ffq340034003400340097w020111^000000002000"}

as well as trying with the string url encoded as well.

So I'm a bit stumped as to why the resume functionality isn't working. Any thoughts or advice would be appreciated.

Thanks,

Nelson 

1 Reply
Nelson Cheng

I've finally managed to get the State API working after some correspondence with Articulate support. FYI, Articulate Support are unable to give support for cases around third party LMS integrations (which is pretty standard), however, they did give some helpful hints which helped me figure out my issue.

In case anyone else has problems with the State API, here are the things that I did around resolving my issue:

Firstly, the data in the response body of the state?method=GET function is the full json that was sent in the state?method=PUT. i.e. the response body should look something like this:

{ "data" : "2w0006k" }

(Where "2w0006k" is the full data string originally sent it the put (usually a string of a few score characters)

Secondly, a helpful tip is that you can sign up for a free trial of of SCORM Cloud (https://cloud.scorm.com), which implements the Tin Can API. From there, you can upload your Articulate module and test it. If you're module resumes on that, then you know Articulate is working with Tin Can correctly, and the issue is on your Tin Can implementation. If it works on SCORM cloud, you can use the Google Dev Console or Firebug in Firefox to inspect the network traffic and drill into the Tin Can API calls the Articulate module is making to get working examples of what to expect.

Thirdly, I am setting the content type of my http response to "application/json" and that works. One of those posts above says to use "application/octet-stream" which I haven't tested, but I guess that might work too,

Finally, my last blocker issue was that I was getting JS Cross Browser security errors, because I set articulate to call an API which wasn't on the same domain as the site I'm hosting on (CORS security error). Currently on my dev env I've fixed that by setting the Access-Control-Allow-Origin Http Header on the response to "*" (which incidently is what cloud.scorm.com seems to be doing), though a better solution (which I'll implement) is to move your API function hooks into your current site that hosts the articulate module.

Cheers guys, hope that helps

 

This discussion is closed. You can start a new discussion or contact Articulate Support.