Continuously sampling data from a slider? #2244
Replies: 2 comments 5 replies
-
Hi @claregrall , I think the simplest solution will be to modify the plugin file. It looks like you are working with jsPsych 6.1.0. You might want to update to 6.3.1 first, and then the main changes to the plugin file would be to add some kind of timer that records the value of the slider every second. The slider value is recorded here This is inside the var responses = [];
var response_interval = setInterval(function(){
responses.push(display_element.querySelector('#jspsych-audio-slider-response-response').valueAsNumber);
}, 1000) This will store the value of the slider every 1,000ms in the When the trial ends, you'll want to clear the timer: clearInterval(response_interval); I know this is kind of a skeleton of the solution, so feel free to follow up if you want more guidance. This is a neat addition to the plugin, so if you get it working, you might consider submitting it to our community contributions repository. |
Beta Was this translation helpful? Give feedback.
-
Hi @jodeleeuw! I'm following up on this because I do need more guidance, as you offered (I'm very new to js). How do you recommend integrating this into the plugin? I'm continuing to try options for this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I am trying to program a task where participants listen to an audio story and continuously respond to a question using a slider on screen. We got the slider to work (https://www.jspsych.org/7.0/plugins/audio-slider-response/index.html), but now I am stuck on how I can set up this function to record the position of the slider every second. In other words, rather than waiting for the participant to click the "Continue" button, I'd like to sample the participant's response every second for the length of the audio stimulus and record that data to an output file. Do you have any recommendations? Thank you so much!
Here is the code so far!
Beta Was this translation helpful? Give feedback.
All reactions