version: v2024.1.5
I’m trying to create an old-new recognition experiment, where when participants click the option ‘old’, it prompts them with a screen to probe their response further. If they hit ‘new’, they will simply be presented with the next trial.
What did you try to make it work?:
Using the keyboard component with a line of code works, where it redirects participants to a separate screen (written as doSM on the builder), I’ve included the code below:
if key_resp_5.keys == ‘z’:
doSM = 1
else:
doSM = 0
For the purposes of this study, using the mouse component would make things simpler. When using the mouse component to click ‘old’ and ‘new’, it goes through to the next trial. However, when trying to branch the experiment in the ‘old’ condition, the line of code does not work and instead, regardless of if ‘old’ or ‘new’ are selected, the participant sees the next trial. I have included the code for the mouse component below:
if (mouse.clicked_name == ‘OLD’):
doSM = 1
else:
doSM = 0
‘OLD’ is the name of the response as written on the psychopy text component title. mouse.clicked_name is the name of the column that generates the output for the response. There was also previously a syntax error message when I tried using the code for the mouse component, but I have not been able to reproduce that message.
I need support with creating code for when participants hit ‘OLD’, it redirects them to another screen. Any help would be appreciated!