Set up sketchpad with variable value
Hello all,
I tried for the purposes of my oddball setup experiment to have inline scripts that contain random chosen images from a variable defined already inthe experiment's table and inserted in the pool .
After that , I should draw sketchpad objects which will have as input the randomly chosen image and present it ,from this variable. how is that possible?
this is the code in the sketchpad's window
set duration 300
set description "Displays stimuli"
draw image center=1 file="pool/{}".format(chosen_image) scale=1 show_if=True x=0 y=0 z_index=0
Thank you all,
Katerina
Comments
Hi Katerina, you can leave out the
pool/part and simply write{chosen_image}see the beginner's tutorial. There, this exact use case is explained. https://osdoc.cogsci.nl/4.0/tutorials/beginner/#step-6-draw-the-sketchpad-itemsEduard
I must admit, despite reading that tutorial countless times, it seems I needed to see it written out here for the information to truly register
Thank you so much!
Best,
Katerina