Hey guys! I would Appreciate it if you can give me some advices to solve the problem. I’ve tried a lot but there exists problems all the time.
Functions that I want to achieve:
First, the stimulus will be presented for 300ms, which is a fixed duration;
Second, the keyboard response will be considered as valid response when the RT is less than 1000ms since the stimulus presentation. Besides, the keyboard response is admitted once the stimulus is presented no matter whether it is still on the screen or not, which means that there are two possibilities: particpants press the key within the deadline of stimulus onset as well as out of the deadline.
I coded in this way at first:
When I run this script, the stimulus won’t disappear until the deadline (maxWait=1) of event.waitKeys. Thus, it is not what I want. Then I changed the code to achieve the functions I want:
But now, although this script can nearly achieve the function of presenting the stimulus in 300ms and getting MOST keyboard response, there is a strange thing: despite the participants responded to every stimuli, the data collected in this pre-experiment showed us some ‘miss’ trials in which we failed to collect the RT data. I assume that the reason may be that there is a gap between two lines of ‘event.waitKeys’ so that the script can only judge it as a ‘miss’ trial.
If anyone have the same problem or have any solution, please do reply!!! It would help me a lot!!!