I’m new to Psychopy, so hoping someone can help me with a challenge in setting up my experiment.
I’m doing a 2-alternative forced choice experiment, where participants have to watch two displays of six gabor patches, where one will stand out. So one display contains an oddball. The task of the participant is to identify which display contains the oddball, which is indicated by a button press (either '‘n’ for display1 or ‘m’ for display2).
My challenge is that this is a group task for dyads, so two persons need to collaborate and respond. Therefore I’ve added two additional response keys (‘o’ for display1 and ‘p’ for display2). I’ve done this by adding two columns in my excel spreadsheet with the correkt keys for each display.
My problem is, that the routine needs to end only after both participants has responded with a key press, so that both can respond.
I probably have to use a code component for this, but I’m very new to coding.
Does anyone has any suggestions on how to solve this?
If you have a keyboard response called key_resp which saves all keys then you need the following code in Each Frame
if key_resp.keys:
if len(key_resp.keys) > 1:
continueRoutine = False
However, this won’t check that both participants have responded, only that two keys have been pressed, so it would probably be better to have two keyboard components, one for each participants. Then each keyboard component could just save a single key (first) and the code would be
if key_resp_1.keys and key_resp_2.keys:
continueRoutine = False
Make sure that the individual keyboard components don’t force the end of the routine.
The second code worked perfectly.
Very grateful for your help, thank you!