This article applies to:
This sample demonstrates how to create response areas on the screen, then collect and score mouse-click responses based on those areas.
In the experiment, response areas have been defined as SlideText objects on the Slide object 'Stimulus'. Each SlideText object is given a unique name via its 'Properties' window.
The 'TrialList' references the SlideText object by name under the 'CorrectAnswer' attribute.
The 'DoHitTest' script tells E-Prime to find the x- and y-coordinates of the mouse click when a response is made. The 'HitTest' method determines the string name of the SlideText object at the specified coordinates. If the mouse click occurs within a SlideText object, the name of the object is returned. If the mouse click occurs in another area of the display, a 'null' value is returned.
The 'DoHitTest' InLine then compares the name returned by the response to the name designated in the 'TrialList' as the 'CorrectAnswer'. If they match, the response is scored as correct. If they do not, the response is incorrect.