Picture of Rob Mausser
Retrieving student_response from the server
by Rob Mausser - Monday, 28 May 2018, 9:03 PM
 

Is there any existing function in adapt to retrieve the values submitted to the 

cmi.interactions.n.student_response 

 

data set in Scorm?

 

I see the getResponse function, which is for posting such data to Scorm,

 

however upon reopening a closed course, I want to be able to retrieve this saved value and repopulate a text form field with the students answer that they submitted. 

 

does such a reverse function to getResponse exist?

 

Thanks. 

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