Forum Discussion

FrankSiegel's avatar
FrankSiegel
Community Member
12 years ago

Resuming an articulate story

When you launch an Articulate story (at least via SCORM Cloud), the question "Would you like to resume where you left off?" pops up.  This must come from the state API, specifically the GET call on activities/state.  Looking at the response from that, you get something like:

25245060ji1001111a010110111100~2C1~2w1cb101001a1a113te1M6Ai00H06Ai00I26Ai0000jDi3000m1118_default6Ai0012pn02Dkfe720118_default0000001000

What format is that in?  How can I use that data to know which slide to go to?  And even if you know, how do you get the browser to go to that slide?  Articulate must be getting (or giving) some information about that.

None of this is documented anywhere.

18 Replies

  • TripLevine's avatar
    TripLevine
    Community Member

    Frank, just return that content parameter by itself.

    So its a json return that should just say :

    2h145040981001111000$Xa91010310103xe1C1414e720118_default1414e770158_default00010000

    Or whatever your bookmark looks like.

  • Hey there, Ati.

    Just in case Frank is no longer subscribed to this discussion, feel free to use the Contact Me button on his profile page to reach out about his comment. And if there's anything we can help answer, please let us know!

    • TripLevine's avatar
      TripLevine
      Community Member

      Hey Ati,

      Look at my reply. You have to send the JSON string in your payload call..
      what have you tried so far?

      • atirah's avatar
        atirah
        Community Member

        thanks alot. finally it worked. my problem was that I didnt have any idea about payload, but now I get it,store it and at the next Get from State Api retrieve it

         

        to get the payload: StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd()

  • FrankSiegel's avatar
    FrankSiegel
    Community Member

    This is an old thread, but I am revisiting it now since we finally need this capability.  I have this method which is called if I have chosen the resume option in my Articulate story:

    [OperationContract, WebInvoke(Method = "*", UriTemplate = "{appId}/activities/state", ResponseFormat = WebMessageFormat.Json)]
    public void activitiesstate(string appId, Stream theStream)

    With this code:

    var method = WebOperationContext.Current.IncomingRequest.Method;
    string m = method.ToString();

    I can tell whether it's a GET or a PUT.  The framework seems fine -- GET only happens when the course is started, and for every question, I see a PUT, and the parameter "theStream" has the resume data, so I store it.  On the next GET, when I resume the course, I read that data.  It is not working.

    My questions come from these statements from a couple of other related posts:

    https://community.articulate.com/discussions/articulate-storyline/resume-tin-can-state
    https://community.articulate.com/discussions/articulate-storyline/resuming-an-articulate-story#reply-737844

    The first one has this statement:

    You just need to save the "Content" string which is the bookmark. And then when its requesting that info back, just return that content string by itself and Articulate will resume to that specific spot it saved at.

    I'm sure this advice is correct, but I'm not sure how to implement this.  How do I just return that content string by itself?  The method is a void, which I assume the Tin Can framework wants.

    The second one has this statement:

    Frank, just return that content parameter by itself.  So its a json return that should just say 2h145040981001111000$Xa91010310103xe1C1414e720118_default1414e770158_default00010000  Or whatever your bookmark looks like

    Again, how do I just return that content parameter by itself?

    Should the code for GET send this data back?  Like I said, the activitiesstate method is a void.  I figured if maybe the GET sent this data back, that when the statements method executes, it would go to the place I want to resume.  But I don't know how to send it back.

    I do this in the GET code.  resumeData has the proper string.

    WebOperationContext.Current.OutgoingRequest.ContentType = "application/octet-stream";
    WebOperationContext.Current.OutgoingResponse.ContentLength = resumeData.Length;

    I read that I need to set the ContentType to application/octet-stream.

    But this doesn't work yet.  Perhaps I need another line of code to include that data?  I don't quite see how to do that, and since the method is a void, I can't return anything.

    Or am I totally off about how this is supposed to work?  I guess my question is:

    What do I do in the GET part of this code to get this to work?

    Thanks

     

  • FrankSiegel's avatar
    FrankSiegel
    Community Member

    OK -- starting to figure this out and I've proved the concept.  I changed my activities/state method to return a string, and for GET, it now returns that JSON string of the resume data.  I am using application/json as the ContentType and that seems to be working.  Not totally working yet, but I've gotten past the issue that was bugging me.

    Thanks to Trip Levine and Nelson Cheng for info in their posts.

    • JohannaKisting's avatar
      JohannaKisting
      Community Member
      fbs 419

      OK -- starting to figure this out and I've proved the concept.  I changed my activities/state method to return a string, and for GET, it now returns that JSON string of the resume data.  I am using application/json as the ContentType and that seems to be working.  Not totally working yet, but I've gotten past the issue that was bugging me.

      Thanks to Trip Levine and Nelson Cheng for info in their posts.

      Any progress on this?