Using HitTest on Slide object with limited duration

61 views
Skip to first unread message

Lucy Wright

unread,
Feb 20, 2018, 8:12:56 AM2/20/18
to e-p...@googlegroups.com
Hi everyone,

Am I correct in thinking that when using HitTest to collect and score mouse-click responses from designated areas on a Slide object, the Duration for the slide object must be set to (infinite)?

As a bit of background, I am using E Prime 2 and I have a task where a stimulus is presented and participants must click one of two SlideText sub objects to make their response. This is a touch screen task so I have emulated the mouse. My script is adapted from the ResponseAreasForMouseInput example online and works perfectly to collect the response and say whether this was accurate or not.

However, response collection only works when the Slide object Duration is set to infinite. In all the examples that I have found online, this has been fine since tasks have been 2AFC where the task should only move on once a response has been made.

In this task, I only want the Slide object to appear for 4000ms, and want the task to move on to the next trial even if a response hasn’t been made in that time. It is important that participants don’t have an unlimited amount of time to make their response.

SO my real question is: how do I set a restricted duration for the slide object but still collect mouse input? Changing the Duration to 4000ms and Input mask response options to a time limit of 4000ms leads to response accuracy values of 0.

Any help would be very much appreciated! If this is too vague please let me know and I will provide more information.

Thanks,
Lucy

David McFarlane

unread,
Feb 20, 2018, 10:29:53 AM2/20/18
to e-p...@googlegroups.com
Lucy,

To answer your opening question: You are *incorrect* in thinking that
when using HitTest to collect and score mouse-click responses from
designated areas on a Slide object, the Duration for the slide object
must be set to (infinite). You may use SlideState.HitTest at any time,
in fact it will work (in a sense) even if you never present the Slide at
all, and of course the point input need not come from a mouse click
either. Literally, HitTest merely compares the given point data with
the areas defined on the given Slide, and then tells you the name of
whatever subobject that point lies within if any. In essence, it just
does PointInRect for all the subobjects on the Slide.

Your real problem seems more to do with unfamiliarity with "extended
input". Please see that tutorial in Appendix C of the User's Guide that
came with E-Prime. In short, your input mask may use a Time Limit
longer than the Duration of the stimulus. Alternatively, you might also
read mouse coordinates directly using inline code.

Finally, scoring mouse clicks on screen areas gets a *lot* easier with
E-Prime 3, although I don't know how well that works if the response
comes after the end of Slide presentation.

---------------
David McFarlane
E-Prime® 2.0 training online:
psychology.msu.edu/workshop-and-additional-course/e-prime-introduction-to-programming-computerized-behavioral-tasks
Twitter: @EPrimeMaster (twitter.com/EPrimeMaster)

Lucy Wright

unread,
Feb 22, 2018, 9:41:39 AM2/22/18
to E-Prime
Hi David, 

Thanks very much for your response. 

I can't have explained myself too well since I wasn't referring to extended input. I am reading mouse coordinates directly using inline code, and I was having problems since this was not working when duration was set to a finite number (but was working at infinite duration). 

I have however since found the problem. I had Pre-Release set to same as duration, not realising this will not work when followed by an InLine object. Now it's set to 0 I'm not having any problems. 

Plus your extended input comment was useful for something else :) 

Thanks for your help! 
Lucy 
Reply all
Reply to author
Forward
0 new messages