Skip to content
Discussion options

You must be logged in to vote

Hi @csavasegal, you can add an image element directly into the html string, e.g.

{
  type: jsPsychSurveyHtmlForm,
  html: '<div><img src="img/my_image.png"/></div><p><input name="first" type="text" /></p>'
}

And you can use variables to generate the value of the html parameter by turning it into a dynamic parameter (i.e. a function that returns the value that should be used on that trial).

{
  type: jsPsychSurveyHtmlForm,
  html: function() {
    return '<p>'+jsPsych.timelineVariable('name')+'<input name="second" type="text" /></p>';
  }
}

Note: with older versions of jsPsych (before v6.3), you need to add a second true argument when using the jsPsych.timelineVariable function inside of a…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@csavasegal
Comment options

@becky-gilbert
Comment options

@becky-gilbert
Comment options

@csavasegal
Comment options

Answer selected by becky-gilbert
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