Script for redoing a trial up to 16 times or untill response

David McFarlane mcfarla9 at msu.edu
Thu Apr 24 19:00:03 UTC 2008


Julia,

And here's another way to do it, without using a 
counter, and making use of functionality built in to E-Prime objects.

First, I assume that your search task, with 
stimulus array and blank screen, is in a 
Proc.  Let's call that PresentationProc.

Now, put PresentationProc in a list object, let's 
call that PresentationList.  So PresentationList 
has just one row with your PresentationProc in 
it, and your structure looks something like this:

PresentationList
     PresentationProc
         StimArray
         BlankScreen
         TrialFinishScript

Now comes the fun.  To make PresentationProc 
repeat, say, 16 times, you can do one of two 
things in the PresentationList:  (1) Give your 
PresentationProc row a weight of 16 (most users 
will find this the more natural way), or  (2) in 
the properties page of the PresentationList, go 
to the Reset/Exit tab and set it to exit after 16 cycles (my preferred method).

OK, now your trial will last for 16 
presentations.  How to get it to stop after a 
response?  You just need one line of script in TrialFinishScript, e.g.,

If Not(StimArray.InputMasks.IsPending()) Then PresentationList.Terminate

That's it.  The .Terminate will make the list exit early.

Now, a bit more to the lesson.  There are several 
ways for script to detect a response.  Here are 
four tests that return True if a response has occured to Stim:
- If Not(Stim.InputMasks.IsPending()) Then ...
- If Stim.RT <> 0 Then ...
- If Stim.RTTime <> 0 Then ...
- If Stim.RESP <> "" Then ...

Note that .IsPending() returns False if either it 
has received a response or the response time 
limit has passed, so it only works while waiting 
for a response (i.e., it will not work afterwards 
to tell whether or not a response was received 
earlier).  Other than that, which test you use is largely a matter of taste.

For more information on these, please see the 
List Object and InputMask Object topics in the E-Basic online help.

-- David McFarlane, Professional Faultfinder


At 4/23/2008 08:12 PM Wednesday, Julia Gomez wrote:
>Hi everyone,
>
>Could anyone help with the following script? I 
>am doing a interrupted visual search task. I am 
>presenting a screen with the stimuli array for 
>the search task followed by another screen with 
>a blank screen. Once a trial has started I would 
>like this trial to repeat (i.e stimuli array and 
>white screen over and over) until a maximum of 
>16 times or  until the participant responds. I 
>created the following script but is giving me an 
>error. I am not familiar writing scripts in eprime.
>
>Dim count as string
>
>count=0
>
>While count<17 ' I need to repeat a trial up to 16 times or until response
>    If StimuliArray.RESP = " " Then ' I am not 
> sure how to tell eprime if there is no response.
>        Goto ShowStimAgain ' this is a label 
> that I inserted after the fixation cross
>    End If
>count = count +1
>End
>
>Any help would be very appreciated.
>
>Thanks
>
>Julia Gómez


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime-unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---



More information about the Eprime mailing list