Executing two commands contingent on one response in E-Basic
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Executing two commands contingent on one... Expand / Collapse
Author
Message
Posted 10/19/2007 3:20:04 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/23/2007 12:32:02 PM
Posts: 1, Visits: 13
I'm a first time poster and relatively new E-prime user, and was hoping that someone might be able to help me solve a dilemma I'm having regarding E-Basic. I am trying to set up my task as follows:

The participant is shown a prime (a picture of a door), and is given the choice to either proceed with the trial by choosing 'yes' (in this case, that means viewing a picture stimulus), or to not proceed with the trial by choosing 'no' and view a blank screen. I have written E-Basic script that handles this by going to one of two different active states (the picture or the blank screen) on a slide object based on the Y or N response. However, there is also a followup to the prime (a picture of a door opening) that I want the participant to see if they choose Yes, but not if they choose No. Therefore, I'd like to also set up E-basic to also go to a label object that would skip the open door pic. However, all attempts I have made to join these commands in E-Basic have failed, and only the first one is executed. Does anyone know how to set up a command that would be like a "If...Then, And...., Else If...Then" statement, or know of alternative ways to join two commands that stem from the same participant response (i.e., both contingent on a participant response of 'N')? Any help would be very much appreciated.
Post #719
Posted 10/30/2007 7:44:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/11/2008 4:08:57 AM
Posts: 4, Visits: 11
There're probably much better methods, but I think this might work. If you have three slides:

Slide1: The initial door, collects responses.

Slide2: Two states: "OpenDoor" (contains e.g. a picture of a door half-open) and "StayingClosed".

Slide3: Two states: "YesState" and "NoState".

Then you can put this inline code between the first two slides:

if Slide1.Resp = "y" then
 Slide2.ActiveState = "OpenDoor"
 Slide3.ActiveState = "YesState"
else
 Slide2.ActiveState = "StayingClosed"
 Slide3.ActiveState = "NoState"
end if

Pressing "n" (or anything other than "y" with this code) at Slide1 changes the states on slides 2 and 3 so that the door stays close (or just that the screen goes empty). Pressing "y" is followed by an opening door picture and then the behind-the-door picture.

Regards,

Thomas

  Post Attachments 
doors.es (9 views, 18.78 KB)

Post #785
Posted 10/30/2007 10:51:52 AM


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Moderators
Last Login: 10/30/2008 3:23:17 PM
Posts: 127, Visits: 924
Hello,

Thomas' response will certainly work (as the attached sample proves). If you wanted to skip the second Slide object, you could alternatively place a Label object between Slide2 and Slide3 and then alter the If...Then...Else statement as follows (note that Slide2 would have only 1 SlideState that presents an open door):

If Slide1.Resp = "y" Then
  Slide3.ActiveState = "YesState"
Else
  Slide3.ActiveState = "NoState"
  Goto Label1
End If

You can take a look at the modified sample to see how this works.


- Matt
PST Technical Consultant
http://pstnet.com


  Post Attachments 
doors revised.es (5 views, 15.77 KB)
Post #789
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 10:35am

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.125. 13 queries. Compression Disabled.