[solved] button click timestamp
Hi everyone,
does Open Sesame provide a function to return the timestamp of a button click without using an inline script? (the response form has two buttons, so a decision has to be made and I would like to retrieve the response time)
Some ideas I already had which didn't work:
(a) insert mouse_response after form with buttons --> form waits for a button click and mouse_response waits for mouse button click --> you have to click two times and it's not an accurate reaction time then
(b) as described above but set only_render to 'no' --> you don't know which of the two buttons was clicked and you can click anywhere you like
Thanks in adavance for any more ideas that work ![]()
Jasmin
Comments
Hi Jasmin,
I don't know if you have an actual inline_script aversion, but even if you do, I'm still going to suggest a very simple and minimalistic inline_script implementation.
1) Right before the response form, you insert one of those bad boys, with one line of code added in the run phase:
start_time = self.time()2) Right after the response form, you insert another one of those bad boys, with one line of code added in the run phase:
exp.set('response_time', self.time()-start_time)And there you go: a response time!
Cheers,
Josh
Hi Josh, thank you for your help, this is a very convenient way to do it. And no, I have no particular aversion for inline scripts
it's just that I had huge problems with timing (which was quite unhandy since I need to collect reaction times) and had the impression that running different forms, scripts etc. are making timestamps inaccurate. But I will try out your solution and check the timestamps.
Cheers,
Jasmin
Hi Jasmin,
If you keep some general points in mind, there is no reason why you shouldn't get ms-precision timing. Checkout this page of the documentation. There Sebastiaan explains quite detailed how a optimal timing is obtained with OpenSesame.
Good luck with your experiment.
Eduard
Hi Jasmin, one more thing though: the lines of code should be in the run-phase rather than the prepare-phase. (All prepare-phases are run before anything else, meaning it would create the response time variable before the form. I edited my mistake in the original post; apologies!
Josh