I am using jsPsych to create a serial reaction time task. At the end of the task I need to create a free generation trial, where participants are required to try and recreate the sequence they have previously been exposed to. The variable should record all the responses given and then terminate after 45 seconds.
The code I have been working with seems to mostly function as required (perhaps a bit clumsy), however, when the data is downloaded it does not store the data correctly. The variable outputs: [object Object]. As such, I am unsure if it is even storing all the responses in a string or just the first response given.
Below is the an example of the code I have produced so far:
var free_gen = {
type: 'html-keyboard-response',
response_ends_trial: false,
minimum_trial_time:200,
trial_duration: 45000,
task: 'free_gen',
timeline: [
{stimulus: "<h1 style= background-color:palegreen;>Free Generation</h1>", prompt: "<img src= buttons.png style= width:1150px;height:650px;></img>", choices: ['a','b','c','d'], data: { test_part: 'Free_gen'}, },
],
on_finish: function(data){
data.response = jsPsych.data.get().select('response');
JSON.stringify(data.response);
},
};
Any help or suggestions would be much appreciated.