SCORMSuspendDataSerializer Library
Proposed method for question-component user-selections & state storage in Adapt Framework.

As this is library can serialize only boolean, number and array data types, the question components mcq, gmcq, slider and matching can have their user selections and their isComplete, isCorrect, isPartiallyCorrect states recorded. Incorrect textinput values would have to be discarded or stored separately but correct textinput values (identified by index) and the component's states can be saved.

Below is an example of how the storage requirements are greatly reduced using this method vs JSON. This library allows for the states + user selections of over 200 question components to be captured using less that 3/4 of the 4kb (4096 bytes) SCORM suspend data limit.

TECH BIT:
This method uses base64 encoded binary(base2) to store booleans as bits, numbers with values 0-15 as 4bits, 0-255 as 8bits, 0-65536 as 16bits, 0-4294967295 as 32bits, -4294967295-4294967295 2 decimal precision doubles at a maximum of 80 bits.
It stores these values as 4bit chucks in arrays. The arrays are essentially a header specifying the array length and value padding. The arrays can be nested inside one another. Arrays can only have one subtype, so an array with larger numbers will store each item according to the largest number type required.

The native JavaScript datatypes this code will store are limited to booleans, numbers and arrays. Strings are off-limits as they can only be stored at base256 without increasing in size (and in some languages require two bytes per character) - which would be no good for Adapt and SCORM.


Pick the quantity and style of question components required:

Selection & results:
No Question Components Selected
	

Encoded Data:

JSON Equivalent Data [[blockPosition, trackingId], [isComplete, isCorrect, isPartial], [selections]]: