how to show number on image-slider-response scale? #1267
-
Hello, I would like the participant to see the number that corresponds with the position on the slider, but I'm not sure how to make this happen. I tried implemented the solution that was posted for html-slider-response, but that didn't work for me. The console gives me an error that I have an unexpected identifier in my string. Following the example in the html-slider-response solution, I tried doing this:
And then when I push the trial to the main timeline, I did it like this: Beads_timeline.push(beads1,
{
type: 'image-slider-response',
html: '', // your stimulus
on_load: function() {
var input = document.querySelector('#jspsych-image-slider-response-response')
input.addEventListener('input', function() {
document.querySelector('#answer-display').innerText = input.valueAsNumber.toString()
})
}
}
) but I get the unexpected identifier error on the line with the prompt. Any help to make this work out would be greatly appreciated. thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Please find attached a modified version of the image plugin where you can use the parameter @becky-gilbert , do you think it is worth it to add this functionality to the different slider plugins and include that in the pull request #1212 ? |
Beta Was this translation helpful? Give feedback.
Hi @ricardojromeu
Please find attached a modified version of the image plugin where you can use the parameter
slider_number: true
to show a number to the right of the slider. You can run the example in the attachment where the 1st image shows the slide.jspsych-image-slider.zip
@becky-gilbert , do you think it is worth it to add this functionality to the different slider plugins and include that in the pull request #1212 ?