Picture of Saral Sharma
Identify number of assessment tries in Suspend Data
by Saral Sharma - Tuesday, 3 December 2019, 6:19 AM
 

Hi,

I have developed an assessment and used 3 maximum number of tries. It is working fine.

But I want to track these number of tries in LMS. I think this number is getting saved in LMS probably within Suspend data but could not decode the suspend data to find which character is representing tries-number.

Is anyone know which string or character represent this number of tries in suspend data?

  • cmi.suspend_data: {"lang":"en","a11y":false,"assessment":{"assess1":[1,3,15,3,0,{"5c812a01d62dd70a9444d27e":false,"5c812a01d62dd70a9444d28c":false,"5c812a01d62dd70a9444d283":false,"5c812a01d62dd70a9444d28d":false,"5c812a01d62dd70a9444d28b":false,"5c812a01d62dd70a9444d27f":true,"5c812a01d62dd70a9444d284":true,"5c812a01d62dd70a9444d285":false,"5c812a01d62dd70a9444d286":false,"5c812a01d62dd70a9444d282":true,"5c812a01d62dd70a9444d287":false,"5c812a01d62dd70a9444d288":false,"5c812a01d62dd70a9444d280":false,"5c812a01d62dd70a9444d289":false,"5c812a01d62dd70a9444d28a":false}]},"completion":"-1111111111111111","questions":"AiFKIFhAEADgx4OCDmqIFhAMADgx4mEEAUGdFKIFhAQADgx4ODDJqIVlAwAAMAFDAFQwAAODHhYQBIqaIWlAwAAMAGEAJDDAAA4MeHhBABEFKIFhAcQDgx8ODH16IFhAgQDgx8aEASNJ6IWlAwAAMAJEAIZDAAA4MeFhCATnohaUDAAAwAoQAhkMAADgx4WEAwFSiBYQLEA4MfDgwheiBYQMAA4MeGhEQUGaiFZQMAADADQwBUMAADgx4WEISBSiBYQOAA4MeDgQpSiBYQPAA4MeDgwRmiCYgAEAAADgx4SBDf","_isCourseComplete":false,"_isAssessmentPassed":false}
Picture of Oliver Foster
Re: Identify number of assessment tries in Suspend Data
by Oliver Foster - Tuesday, 3 December 2019, 5:30 PM
 

It's encoded in this string:

"AiFKIFhAEADgx4OCDmqIFhAMADgx4mEEAUGdFKIFhAQADgx4ODDJqIVlAwAAMAFDAFQwAAODHhYQBIqaIWlAwAAMAGEAJDDAAA4MeHhBABEFKIFhAcQDgx8ODH16IFhAgQDgx8aEASNJ6IWlAwAAMAJEAIZDAAA4MeFhCATnohaUDAAAwAoQAhkMAADgx4WEAwFSiBYQLEA4MfDgwheiBYQMAA4MeGhEQUGaiFZQMAADADQwBUMAADgx4WEISBSiBYQOAA4MeDgQpSiBYQPAA4MeDgwRmiCYgAEAAADgx4SBDf"

Which need this file https://github.com/adaptlearning/adapt-contrib-spoor/blob/master/js/serializers/scormSuspendDataSerializer.js to do the serialization/deserialization.

You can see in the image attachment provided that the string is effectively an array of typed arrays containing the values needed to restore the questions. We do this because suspend data is only about 4096 characters long and can't contain raw/uncompressed values for each question state. 

At these lines you can see how those array items are restored to each question > https://github.com/adaptlearning/adapt-contrib-spoor/blob/master/js/serializers/questions.js#L134-L175

So... the last number in the first array in each set of arrays is the attemptsLeft value, I think?

This method reduces the length of the data needed to describe these values from about 971 characters as raw JSON to about 302 characters for your 15 questions.


Picture of Ignacio Cinalli
Re: Identify number of assessment tries in Suspend Data
by Ignacio Cinalli - Tuesday, 3 December 2019, 9:18 PM