This commit is contained in:
raynatang 2025-03-13 14:41:44 +00:00 committed by GitHub
commit b721236c4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,6 +108,11 @@ const info = <const>{
type: ParameterType.BOOL,
default: true,
},
/** If true, the slider's value will be displayed in real time below the slider. */
value_display: {
type: ParameterType.BOOL,
default: true,
},
},
data: {
/** The path of the image that was displayed. */
@ -224,7 +229,13 @@ class ImageSliderResponsePlugin implements JsPsychPlugin<Info> {
trial.max +
'" step="' +
trial.step +
'" id="jspsych-image-slider-response-response"></input>';
'" id="jspsych-image-slider-response-response" ';
if (trial.value_display) {
html += 'oninput="this.nextElementSibling.value = this.value"></input>';
html += "<output>" + trial.slider_start + "</output>";
} else {
html += "></input>";
}
html += "<div>";
for (var j = 0; j < trial.labels.length; j++) {
var label_width_perc = 100 / (trial.labels.length - 1);