Displaying the value of a form response variable
I am trying to (1) get text input from the subject using form_text_input and (2) later display the input text in a sketchpad. For example, (1) they enter their name in the form and (2) the sketchpad says "Thanks" followed by the name.
I thought I could do this by calling the form response variable "name" and then adding "Thanks, [name]" in the sketchpad. But it didn't work: the sketchpad displays just "Thanks", without the name.
I checked the variable inspector and I do see the value of the variable match the input. I also added an inline script to print out the variable value, i.e. print("Thanks, ", var.name) and that seemed to work as well.
What am I missing with the sketchpad approach?
Comments
Hi,
What you are missing is that sketchpads are drawn in the prepare phase. To present input of the participants (or any other variable that is created during run time) you need to use a feedback item, which is drawn in the run phase. See here for more info: https://osdoc.cogsci.nl/3.3/manual/prepare-run/#sketchpad-and-feedback-items
Hope this clears things up.
Eduard
That certainly cleared up my confusion. Thanks so much!
Hahn