1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\...

12
1 of 20 Advanced Advanced Exercises (1- Advanced Exercises (1- 4) 4) E-Prime 2002 Workshop E-Prime 2002 Workshop Files on C:\My Experiments\ Files on C:\My Experiments\ Workshop\ Workshop\ E-Prime Exercises E-Prime Exercises Exercises Exercises

Transcript of 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\...

Page 1: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

1 of 20Advanced

Advanced Exercises (1-4)Advanced Exercises (1-4)

E-Prime 2002 WorkshopE-Prime 2002 Workshop

Files on C:\My Experiments\Workshop\Files on C:\My Experiments\Workshop\E-Prime ExercisesE-Prime Exercises

E-Prime Advanced E-Prime Advanced ExercisesExercises

Page 2: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

2 of 20Advanced

List of Adanced List of Adanced ExercisesExercises

1. StringInput1. StringInput 2. Response Areas for Mouse Input2. Response Areas for Mouse Input 3. Sprite Animation3. Sprite Animation 4. Suspend and Resume4. Suspend and Resume

Page 3: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

3 of 20Advanced

Exercise 1:Exercise 1: StringInputStringInput This example illustrates the use of string input. The This example illustrates the use of string input. The

subject is presented with a question and is asked to type subject is presented with a question and is asked to type a response. The subject's response echo's to the display, a response. The subject's response echo's to the display, so that they may see their response.so that they may see their response.

String input in E-Prime is currently supported by setting String input in E-Prime is currently supported by setting the MaxCount parameter on the Advanced pages of the the MaxCount parameter on the Advanced pages of the Duration/Input page. The MaxCount parameter allows Duration/Input page. The MaxCount parameter allows you to set the maximum number of keys allowed for you to set the maximum number of keys allowed for input. The termination response is also set in the input. The termination response is also set in the Advanced pages allowing you to select any key to Advanced pages allowing you to select any key to terminate a trial. The echo property is set within the terminate a trial. The echo property is set within the Advanced pages of the Duration/Input tab, and selecting Advanced pages of the Duration/Input tab, and selecting the echo tab, you will need to add the Display device to the echo tab, you will need to add the Display device to echo. echo.

Load C:\My Experiments\Workshop\E-Prime Exercises\Load C:\My Experiments\Workshop\E-Prime Exercises\StringInput.es and run paradigmStringInput.es and run paradigm

Page 4: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

4 of 20Advanced

Edit Display Echo Color and Edit Display Echo Color and TextText

1. Open TextDisplay1 1. Open TextDisplay1 property pages, select property pages, select Duration/Input tab and Duration/Input tab and click on the Advanced click on the Advanced buttonbutton

2. Click on Echo tab, 2. Click on Echo tab, select Display icon and select Display icon and click Editclick Edit

4. Using the drop down 4. Using the drop down menus change Fore menus change Fore Color to “blue” and Color to “blue” and Back Color to “gray”Back Color to “gray”

5. Run program5. Run program

Page 5: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

5 of 20Advanced

Exercise 2: Response Areas for Mouse Exercise 2: Response Areas for Mouse InputInput

The sample demonstrates how to create response The sample demonstrates how to create response areas on the screen, then collect and score mouse-areas on the screen, then collect and score mouse-click responses based on those areas. The experiment click responses based on those areas. The experiment uses HitTest, a method of the SlideState object which uses HitTest, a method of the SlideState object which returns the string name of a SlideImage or SlideText returns the string name of a SlideImage or SlideText object at specified coordinates. object at specified coordinates.

Load C:\My Experiments\Worskhop\E-Prime Exercises\Load C:\My Experiments\Worskhop\E-Prime Exercises\Response Areas for Mouse and run paradigmResponse Areas for Mouse and run paradigm

Page 6: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

6 of 20Advanced

Add Another Response AreaAdd Another Response Area

1. Open Stimulus 1. Open Stimulus object, select SlideText object, select SlideText tool button, click in tool button, click in Slide grid area in the Slide grid area in the center of the 4 boxescenter of the 4 boxes

2. Double click on the 2. Double click on the SlideText sub-object to SlideText sub-object to edit text, type [Center]edit text, type [Center]

3. Select Text1 sub-3. Select Text1 sub-object, open the object, open the property pages and property pages and change Border Width to change Border Width to “1”“1”

Page 7: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

7 of 20Advanced

Edit TrialListEdit TrialList 4.4. Open TrialListOpen TrialList

Add another row Add another row Add Add Center Center

attributeattribute Type an “*” in the Type an “*” in the

last celllast cell

5. Type 5. Type CenterCenter in in the Stimulus the Stimulus column and column and Text1Text1 in the in the CorrectAnswer CorrectAnswer columncolumn Note, Text1 is the Note, Text1 is the

name of the name of the TextSlide sub-TextSlide sub-objectobject

Page 8: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

8 of 20Advanced

Review CodeReview Code 6. Examine the code to 6. Examine the code to

determine how E-Prime is determine how E-Prime is able to identify the location able to identify the location of the mouse click.of the mouse click.

Find coordinates of mouse click Find coordinates of mouse click (Mouse.GetCursorPos ptMouse.x, (Mouse.GetCursorPos ptMouse.x, ptMouse.y)ptMouse.y)

Determine string name of SlideText Determine string name of SlideText object at mouse click coordinates. object at mouse click coordinates. Assign that value to strHitAssign that value to strHit(strHit = (strHit = theState.HitTest(ptMouse.x, theState.HitTest(ptMouse.x, ptMouse.y)ptMouse.y)

Compare string name where mouse Compare string name where mouse click occurred to CorrectAnswer click occurred to CorrectAnswer attribute on each trial, and score attribute on each trial, and score responseresponse

7. Run program7. Run program

Page 9: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

9 of 20Advanced

Exercise 3:Exercise 3: Sprite Sprite AnimationAnimation

This example illustrates the use of the Canvas This example illustrates the use of the Canvas object, off-screen canvases, the Rect structure, and object, off-screen canvases, the Rect structure, and transparency to perform smooth animation. The transparency to perform smooth animation. The Canvas and CreateCanvas methods of the Display Canvas and CreateCanvas methods of the Display object are used to manipulate the current and off-object are used to manipulate the current and off-screen canvases. The SourceColorKey method of the screen canvases. The SourceColorKey method of the Canvas object and the ebEffectSourceColorKey Canvas object and the ebEffectSourceColorKey parameter used with the Copy method of the Canvas parameter used with the Copy method of the Canvas method are used to present transparency.The Rect method are used to present transparency.The Rect structure is used to track the location of small images structure is used to track the location of small images written over the master image.written over the master image.

Load C:\My Experiments\Workshop\E-Prime Exercises\Load C:\My Experiments\Workshop\E-Prime Exercises\SpriteAnimation.es and runSpriteAnimation.es and run Note – When running this example press “Enter” to exit Note – When running this example press “Enter” to exit

program.program.

Page 10: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

10 of 20Advanced

Review Structure and Review Structure and RunRun

Note the simple Note the simple structure of the structure of the program.program.

Press Enter to Press Enter to terminate.terminate.

Page 11: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

11 of 20Advanced

Exercise 4:Exercise 4: Suspend and Suspend and ResumeResume

This sample experiment shows how an experiment This sample experiment shows how an experiment can suspend devices during the running of an E-can suspend devices during the running of an E-Prime experiment in order to launch an external Prime experiment in order to launch an external application (e.g., PowerPoint Viewer).Once the application (e.g., PowerPoint Viewer).Once the devices are suspended, any external application can devices are suspended, any external application can be called and used. The most common methods to be called and used. The most common methods to call and access external programs would be via call and access external programs would be via OLE/COM Automation or via DLL calls via Declare OLE/COM Automation or via DLL calls via Declare statements. The use of these methods are typically statements. The use of these methods are typically set aside for more advanced programmers.This set aside for more advanced programmers.This specific experiment suspends the devices, calls a specific experiment suspends the devices, calls a PowerPoint presentation, resumes devices, and PowerPoint presentation, resumes devices, and continues with the experiment.continues with the experiment.

Load C:\My Experiments\Workshop\E-Prime Load C:\My Experiments\Workshop\E-Prime Exercises\SuspendResume.es and runExercises\SuspendResume.es and run

Page 12: 1 of 20 Advanced Advanced Exercises (1-4) E-Prime 2002 Workshop Files on C:\My Experiments\Workshop\ E-Prime Exercises E-Prime Advanced Exercises.

12 of 20Advanced

Suspend and ResumeSuspend and Resume 1. Note the use of the ppt file in the TrialList 1. Note the use of the ppt file in the TrialList