Images from timeline variables in survey-text #2933
-
Hi, Here's my current code: var response_trial = {
type: jsPsychSurveyText,
preamble: '<img src="' +jsPsych.timelineVariable('stimulus')+ '">',
questions: [{prompt: 'Enter the name of the object:'}],
data: {
stimulus: jsPsych.timelineVariable('stimulus'),
correct_response: jsPsych.timelineVariable('name'),
trial_type: 'response'
}
}; I think it's because I'm putting an array in the image tags, but I'm not sure how to fix it without creating a different response trial for each stimulus. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @aaron-cousins, Because you are using a function ( preamble: function() { return '<img src="' +jsPsych.timelineVariable('stimulus')+ '">' }, |
Beta Was this translation helpful? Give feedback.
Hi @aaron-cousins,
Because you are using a function (
jsPsych.timelineVariable('stimulus')
) in combination with the string to make theimg
tag, you'll need to use a dynamic parameter.