Windows 10 Computer
I am trying to create an experiment using an image as my rating scale instead of the normal Psychopy rating scale. Currently, I am trying to create a marker using the polygon function, such that participants who hit ‘1’ on the keypress will see a circle over the 1 and if they hit 2 the circle will be over the 2 part of the scale etc. How should I go about doing this?
One method I tried was to create a code component, such that if the key press equaled 1 a polygon would be set to appear
if key_resp_2.keys == 1: polygon = visual.Rect( win=win, name='polygon', width=(0.5, 0.5), height=(0.5, 0.5), ori=0, pos=(0, 0), lineWidth=1, lineColor=[1,1,1], lineColorSpace='rgb', fillColor=[1,1,1], fillColorSpace='rgb', opacity=0, depth=-1.0, interpolate=True)
But this returned an error saying
“NameError: name ‘key_resp_2’ is not defined”
Does anyone have an idea on how to fix this?