mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
use class instead of id for non-unique id
This commit is contained in:
parent
7a65ab9aaf
commit
74853f928f
@ -2,8 +2,6 @@
|
||||
* jspsych-survey-multi-picture
|
||||
* a jspsych plugin for multiple choice survey questions
|
||||
*
|
||||
* Shane Martin
|
||||
*
|
||||
* documentation: docs.jspsych.org
|
||||
*
|
||||
*/
|
||||
@ -118,7 +116,7 @@ jsPsych.plugins['survey-multi-picture'] = (function() {
|
||||
display_element.querySelector(option_id_selector).innerHTML += option_label;
|
||||
}
|
||||
display_element.querySelector(option_id_selector + " label").innerHTML =
|
||||
'<img style="width: 250px; height: auto;" id="image" src="'+trial.options[i][j].url+'">' +
|
||||
'<img style="width: 250px; height: auto;" class="'+plugin_id_name+'-image" src="'+trial.options[i][j].url+'">' +
|
||||
display_element.querySelector(option_id_selector + " label").innerHTML;
|
||||
}
|
||||
}
|
||||
@ -129,7 +127,7 @@ jsPsych.plugins['survey-multi-picture'] = (function() {
|
||||
var response_time = endTime - startTime;
|
||||
var question_data = {};
|
||||
var id = 'Q' + index;
|
||||
var val = currentImageDiv.querySelector("#image").src;
|
||||
var val = currentImageDiv.querySelector('.'+plugin_id_name+'-image').src;
|
||||
var obje = {};
|
||||
obje[id] = val;
|
||||
Object.assign(question_data, obje);
|
||||
|
Loading…
Reference in New Issue
Block a user