Skip to content

variable images inside prompt HTML #770

Answered by vijaymarupudi
rosemintz asked this question in Q&A
Discussion options

You must be logged in to vote

You can't use timelineVariables like they're strings because they return a placeholder, not a string, that is later replaced by jsPsych. To do what you'd like, try this.

{
   type: "audio-button-response",
   stimulus: jsPsych.timelineVariable('affixedfile1'),
   choices: ['Play option 2'],
   prompt: function() { return '<img src = "' + jsPsych.timelineVariable('picture', true) + '" >' }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rosemintz
Comment options

Answer selected by rosemintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants