Has anyone combined an image with the jsPsychSurveyHtmlForm? And read in variables into that input function? #2214
-
To add more detail: Is there a plug-in (or a way to create one easily) that combines an image file with the jsPsychSurveyHtmlForm plugin? And more importantly, have people had success reading in variables into the html component of the jsPsychSurveyHtmlForm plugin? Something like this: It doesn't seem to work for me, but I am a fan of the 'response' save out for this plug in. Thanks!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @csavasegal, you can add an image element directly into the {
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 {
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 Does this work for you? |
Beta Was this translation helpful? Give feedback.
Hi @csavasegal, you can add an image element directly into the
html
string, e.g.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).Note: with older versions of jsPsych (before v6.3), you need to add a second
true
argument when using thejsPsych.timelineVariable
function inside of a…