Running a new procedure after fixed number of trials

194 views
Skip to first unread message

Christina B Young

unread,
Feb 10, 2012, 1:26:57 PM2/10/12
to e-p...@googlegroups.com
Hello,
I am running into a problem that hopefully has a straight-forward
solution. In my experiment, I have 90 trials that occur in random
order and the randomization is critical. However, after the 30ths and
60th trial, I would like to add a new procedure, but then have the
experiment continue with the original trials. So the order would be:
29th trial, 30th trial, new procedure, 31st trial, 32nd trial, etc.
Does anyone have any ideas on how to do this? Thanks!

Christina

David Vinson

unread,
Feb 11, 2012, 5:44:25 AM2/11/12
to e-p...@googlegroups.com
Hi Christina,

This is a common situation, for example when inserting a break every N
trials.

The easiest way I've found to do it is to insert that procedure
("NewProc") as if it occurred every trial, then add a Label immediately
after it ("JumpToLabel"). Then right before the procedure add an inline
to check the sample number and go to the "JumpToLabel" (thus skipping
past NewProc) unless it meets your requirements

If c.GetAttrib(c.GetAttrib("Running") & ".Sample") MOD 30 = 0 Then
goto JumpToLabel
End If

There's a sample experiment on the e-prime support site,
http://www.pstnet.com/support/samples.asp?Mode=View&SampleID=33
which does a similar thing, instead by running a procedure that sits
outside of the main experiment procedure (Unreferenced Objects) - in
this case the input masks would need to be set with an additional line
in inline code (see the sample InsertPause.es for more info).

One note - if your inserted procedure is something that logs data (e.g.
*.ACC etc) you may need to clear these values on instances in which the
event is skipped - otherwise they may inherit the values from the last
trial in which NewProc was run.

hope this helps,
-dv

--
David Vinson, Ph.D.
Senior Postdoctoral Researcher
Cognitive, Perceptual and Brain Sciences Research Department
University College London
26 Bedford Way, London WC1H 0AP
Tel +44 (0)20 7679 5311 (UCL internal ext. 25311)


David Vinson

unread,
Feb 11, 2012, 5:56:10 AM2/11/12
to e-p...@googlegroups.com
Oops I made a slight error in my previous mail - the inline code as
written would run the procedure on every trial *except* 30...60...90
etc. = should be >.

-dv

Christina

unread,
Feb 18, 2012, 5:41:03 PM2/18/12
to E-Prime
Thank you!!!
Reply all
Reply to author
Forward
0 new messages