Picture of Matt Leathes
Re: Retrieving student_response from the server
by Matt Leathes - Wednesday, 30 May 2018, 10:36 AM
 

Hi Rob

No there isn't - because that's not really the intention of cmi.interactions.

For example, if I answer the same question seven times whilst taking the course, seven entries will be added to cmi.interactions, showing all seven answers I gave.

Whilst it would technically be possible to write some code that retrieved the most recent answer given from cmi.interactions, really it would be better to store data like this in cmi.suspend_data since that's specifically there for the purpose of storing the 'state' of the course at the point the user exits.

Unfortunately the spoor plugin doesn't currently support saving/restoring text-based responses (as it would be far too easy to exceed the paltry 4K of storage you get).

But you might have a look at https://github.com/LearningPool/adapt-contrib-openTextInput/ which saves the user's response in localStorage instead