Logging in Coroutines
Hi,
I have a question concerning the logging of keyboard responses within coroutines. I created an experiment, where I show two mental rotation images at the same time for 3 second. During these three seconds of stimulus presentation, I want subjects to indicate if both images are only rotated or also mirrored, using a keyboard response. In order to be able to do the stimulus presentation and the keyboar response at the same time (because the experiment lenght needs to be constant), i decided to use the coroutines, which is working fine so far. The only problem is that I don't really know how I can get the keyboard response and the reaction times of the key press out of it, since I can't put a logger or an inline script inside the coroutine. Can you help me with that?
Thanks a lot!
Best regards, Fabian
Comments
Hi Fabian,
The typical solution would be to add the
coroutinesto asequence, and add theloggerto thatsequenceas well. Does that make sense? You see the idea in the screenshot below. (Trivia for the geeks: Screenshot taken with an Ubuntu Touch tablet.)Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks a lot for the quick response, Sebastiaan!
I already had the logger there but in the coroutine the duration of the keyboard response was set to 0, which probably caused that no inputs were recorded. Now it's working fine!
Cheers, Fabian