130 likes | 1.28k Views
E-Prime Advanced Exercises. Advanced Exercises (1-4). E-Prime 2002 Workshop Files on C:My ExperimentsWorkshop E-Prime Exercises. List of Adanced Exercises. 1. StringInput 2. Response Areas for Mouse Input 3. Sprite Animation 4. Suspend and Resume. Exercise 1: StringInput.
E N D
E-Prime Advanced Exercises Advanced Exercises (1-4) E-Prime 2002 WorkshopFiles on C:\My Experiments\Workshop\E-Prime Exercises
List of Adanced Exercises • 1. StringInput • 2. Response Areas for Mouse Input • 3. Sprite Animation • 4. Suspend and Resume
Exercise 1:StringInput • This example illustrates the use of string input. The subject is presented with a question and is asked to type a response. The subject's response echo's to the display, so that they may see their response. • String input in E-Prime is currently supported by setting the MaxCount parameter on the Advanced pages of the Duration/Input page. The MaxCount parameter allows you to set the maximum number of keys allowed for input. The termination response is also set in the Advanced pages allowing you to select any key to terminate a trial. The echo property is set within the Advanced pages of the Duration/Input tab, and selecting the echo tab, you will need to add the Display device to echo. • Load C:\My Experiments\Workshop\E-Prime Exercises\StringInput.es and run paradigm
Edit Display Echo Color and Text • 1. Open TextDisplay1 property pages, select Duration/Input tab and click on the Advanced button • 2. Click on Echo tab, select Display icon and click Edit • 4. Using the drop down menus change Fore Color to “blue” and Back Color to “gray” • 5. Run program
Exercise 2: Response Areas for Mouse Input • The sample demonstrates how to create response areas on the screen, then collect and score mouse-click responses based on those areas. The experiment uses HitTest, a method of the SlideState object which returns the string name of a SlideImage or SlideText object at specified coordinates. • Load C:\My Experiments\Worskhop\E-Prime Exercises\Response Areas for Mouse and run paradigm
Add Another Response Area • 1. Open Stimulus object, select SlideText tool button, click in Slide grid area in the center of the 4 boxes • 2. Double click on the SlideText sub-object to edit text, type [Center] • 3. Select Text1 sub-object, open the property pages and change Border Width to “1”
Edit TrialList • 4.Open TrialList • Add another row • Add Center attribute • Type an “*” in the last cell • 5. Type Center in the Stimulus column and Text1 in the CorrectAnswer column Note, Text1 is the name of the TextSlide sub-object
Review Code • 6. Examine the code to determine how E-Prime is able to identify the location of the mouse click. • Find coordinates of mouse click (Mouse.GetCursorPos ptMouse.x, ptMouse.y) • Determine string name of SlideText object at mouse click coordinates. Assign that value to strHit(strHit = theState.HitTest(ptMouse.x, ptMouse.y) • Compare string name where mouse click occurred to CorrectAnswer attribute on each trial, and score response • 7. Run program
Exercise 3:Sprite Animation • This example illustrates the use of the Canvas object, off-screen canvases, the Rect structure, and transparency to perform smooth animation. The Canvas and CreateCanvas methods of the Display object are used to manipulate the current and off-screen canvases. The SourceColorKey method of the Canvas object and the ebEffectSourceColorKey parameter used with the Copy method of the Canvas method are used to present transparency.The Rect structure is used to track the location of small images written over the master image. • Load C:\My Experiments\Workshop\E-Prime Exercises\SpriteAnimation.es and run • Note – When running this example press “Enter” to exit program.
Review Structure and Run • Note the simple structure of the program. • Press Enter to terminate.
Exercise 4:Suspend and Resume • This sample experiment shows how an experiment can suspend devices during the running of an E-Prime experiment in order to launch an external application (e.g., PowerPoint Viewer).Once the devices are suspended, any external application can be called and used. The most common methods to call and access external programs would be via OLE/COM Automation or via DLL calls via Declare statements. The use of these methods are typically set aside for more advanced programmers.This specific experiment suspends the devices, calls a PowerPoint presentation, resumes devices, and continues with the experiment. • Load C:\My Experiments\Workshop\E-Prime Exercises\SuspendResume.es and run
Suspend and Resume • 1. Note the use of the ppt file in the TrialList