Thank you so much for your response. The script worked well for the study.
I do have two followup questions:
1) what does the timeout of 1000 ms do exactly? I tried to change its duration, but nothing noticeable happened. However, there were a few times when I first moved the mouse, the trial didn’t end. The trial only ended when I moved the mouse again to a different location. Does this has anything to do with the timeout?
2) Where should I add the feedback on a trial? When I added a tooltip after your second function, the tooltip itself appeared on the screen, but for some reason I can’t click on it and thus can’t move onto the next trial.
Let me know if you’d like more information.