[solved] How to show an error message when the user pressed a key during an advanced delay item.
I created a simple experiment that measures the reaction time of the user. The sequence shows a message to the user to wait for the signal. Than there is a random delay with an advanced delay item and the signal is shown. The user has to press a pre-defined key as fast as possible, without making any decisions.
Now, when the user waits for the signal, I need to show an error message, and restart the sequence if the user press the pre-defined key too early. Do you have any idea to achieve this?
Comments
The
advanced_delaysimply halts your experiment, so there is no room for checking for keypresses while it is active. However, keypresses made during the delay will still be registered by the back-end. With a nifty trick, you can use this to your advantage.Untick the box labelled Flush pending keypresses in your
keyboard_response. Now, if the reponse time is 0, you know a keypress has been made before the onset of thekeyboard_response. All values above 0 should be fine. Therefore, you can give the error feedback when[response_time] < 1.Good luck!