answering anytime in the sequence
Hi all!
I've set up a quick protocol that relies on an optical illusion due to the flickering of several images. Participants have to judge of the presence of the illusion.
To make the stimuli flicker, I made a sequence with 8 sketchpads (250ms each) in a loop (the variables of the loop modify the sketchpad at every trial), then fixation dot (0ms) with a keyboard response, then a logger. RT are not relevant, I just need the key pressed. So here, participants have to wait the end of the loop to give the response.
I want them to be able to give the response anytime during the sequence. How should I do ?
Thanks !
Comments
Hi Raph, you could insert an inline_script at the beginning of your experiment with a line of code to initialize the keyboard: see http://osdoc.cogsci.nl/python/keyboard/ for instructions.
After your stimulus, you could insert another inline_script where you check by means of keyboard.flush() whether a key was pressed. If so, then that key will also have been logged in a
keyboard_responsevariable. You may want to put the keyboard.flush() command in a while loop that goes onwhile keyboard.flush()==False:, so that participants really have to press a key for the trial to end. The while loop should be in the run-phase of your inline_script.Cheers,
Josh
Hi Josh, thank you for your quick answer.
Unfortunately, I am not very good with inline_scripts. I understand the logic on the keyboard.flush() and the while loop, but can you develop a bit on the way I should construct the while loop? Also, I'm not sure to understand where you would insert this script in the sequence, since I actually have several stimuli.
here's a screenshot,
Cheers,
Raph