Recording multiple responses in a dual-task design
I am currently setting up an experiment in which multiple responses need to be recorded during each trial. For brevity I will only describe the relevant sequence of the experiment. I want to present a first stimulus (image on sketchpad) for 2000 ms, followed by a 500 ms delay (also image on sketchpad), and a second stimulus (a third image on sketchpad) for 1500 ms. Throughout the full 4000 ms timeframe a response to the first stimulus can be given and should be recorded. There are two designated keys for this response [e.g., o and p]. In the last 1500 ms of the trial a response to the second stimulus should be recorded. Two different keys [e.g., q and w] are designated for this response. I have tried using the coroutines plugin to achieve this setup, but if the response for Stimulus 1 is given while stimulus 2 is already displayed and accordingly the keyboard_response item for this stimulus is active (i.e., response to stimulus 1 is given after 2500+ ms) it seems to be unpredictable whether any of the two responses, both responses or just one response is logged. I have since tried to use inlinescript to overcome this issue but that has not worked out.
Ideally, within the coroutine the program would constantly check whether one of the response keys designated to stimulus 1 is pressed. If that happens, it would log the response and the response time. Starting with the onset of the second stimulus, the program should additionally check whether one of the designated keys for stimulus 2 is pressed and if that happens log the response and response time.
Thank you in Advance,