Linking Response_Time to Event
Hi,
I want to be able to present a stimulus onscreen for a fixed amount of time, regardless of participants' responses. I found that the stimulus automatically disappears after response and so I added to my sequence a script which calculates 'remaining time' as the difference between the fixed presentation duration I want (e.g., 2 seconds) and participants' reaction time. This amount of time is then used as a presentation duration for the same target stimulus.
So this is my sequence:
- stimulus (duration is set to 0)
- keyboard response (duration set to 2000 ms)
- inline script (remaining_time = 2000 - response_time)
- stimulus again with remaining_time as duration
There are also instructions which end with a keypress before the sequence begins.
However, it seems like 'remaining_time' is calculated using the RT from the instructions, which are outside of the loop. So say it takes a participant 500ms to read the instructions, the reminaning time on the first trial would be 1500ms. So it looks like I can't make a distinction between RT toward my target stimulus and toward the instructions. Or, I can't seem to keep the 'remaining_time' variable inside the loop, even though it is only referred to in the loop.
I'll also mention that I tried resetting both remaining_time as well as response_time to 0 at the beginning/end of each trial, before/after the sequence. Nothing helped.
I also tried to debug this issue by printing both variables after each trial. Turns out the both variables are calculated even before the loop begins, just for the instructions. Not sure why or how, since 'remaining_time' is only introduced in the loop. Importantly, while during debugging the times are printed correctly, in the log file I can see that for the actual calculations, the 'remaining_time' calculation begins with the instructions while the 'response_time' is logged only for the sequence.
I hope my explanation was clear and not too messy.
Help would be appreciated!
Thanks in advance,
Elinor
Comments
Hi @elinora18,
Your general method is correct, but based on your description I suspect that you're presenting the second stimulus as a sketchpad instead of using a feedback object. Sketchpads are preparing before the sequence runs, which means that its duration is set and fixed before the participants even responds to the first stimulus. There may also be some issue with the code calculating the remaining time: is it located in the "prepare" or the "running" phase of the inline object? If it is located in the "prepare" phase, it would also be executed ahead of the sequence starting. If my description is correct, your task would calculate the remaining time based on the time participants took to respond to the instructions (only on the first trial), and from then on, it would calculate it based on the RT to the first stimulus of the previous trial. Is that what is happening?
I attach a task example with 5 trials and a total stimulus on screen duration of 3000ms to show you how to do it. Hopefully it'll help you work out what the issue with your task might be.
Otherwise, feel free to upload your task here and I or someone else can take a look at your implementation.
Best,
Fabrice.
Hi Fabrice,
Thanks so much for the reply and for the experiment you attached. It solved my problem perfectly.
Thanks again!
Best wishes,
Elinor
Hi @elinora18,
Great! I'm glad I could help.
Tip: when wrinting on the forum, if you use someone's handle, they get notified taht you wrote to them. To use a handle, type "@" followed by the first letters of your correspondent's name and a pull down menu will appear, like so
When your message is posted, your correspondent will get a notification.
Good luck with your experiment!
Fabrice.
PD: don't forget to include a logger in your trial sequence (in the example I sent you I did include it but in an actual experiment you'd of course need it to collect data).
Hi @Fab,
Got it! Thanks again!
Best,
Elinor