Fixed duration in reoccuring timeset trials! IDEAS?

39 views
Skip to first unread message

K.O.

unread,
Jan 9, 2017, 9:34:52 PM1/9/17
to E-Prime
Hey all,
I just joined group...but have been a fan for a while.
Whenever I get stuck, I come here first....Great ideas!

I have two blocks. Random repeats at 120seconds and 60 seconds. Stimulus is one slide, user deines input amount (so basically slide is set at 999) and user responds as much as needed until time runs out.
After slide terminates, 2 rating responses are initiated.
Then back to the ramdonly chosen 60sec unlimiterd response or the 120 second response scenario.

I have scripted this multiple ways (global variable, confined block variables, terminating the list, tried event, cumulative,etc), however, only the 1st and sometimes second loops time is correct. After that script is bi-passed and all iterations turn to one trial on stimulus and straight to ratings questions.
I must have ALL responses (right or wrong).
Program works beautifully...except for the fixed duration, which is the whole point!

Here are two of the codes that work the best so far....but I am open to ANY OPTIONS:

1. (120 seconds and 60 seconds script same; just substitute numbers 60/120 in variable name)

' FirstOnset Is a Global variable declared In user section Of script window
If FirstOnset=0 Then
    FirstOnset = STIM60.TargetOnsetTime
End If

Dim timeLeft As Long
timeLeft = 60000 - STIM60.TargetOnsetTime
If timeLeft>0 Then
    STIM60.Duration = timeLeft
Else
    DesignList60.Terminate
End If

(with un-referenced In-Line)
FirstOnset = STIM60.ta

(and User script)
Dim FirstOnset As Long ' onsettime of first stimulus
_______________________
2. (same120/60 substitution as 1, no globals...this works the longest)
Dim timeLeft As Long
timeLeft = 120000 - STIM120.TargetOnsetTime
If timeLeft>0 Then
    STIM120.Duration = timeLeft
Else
    DesignList120.Terminate
End If

Thanks All...K.O.

David McFarlane

unread,
Jan 13, 2017, 1:38:25 PM1/13/17
to e-p...@googlegroups.com
K.O.,

Not sure that I follow all this, but here's a thought ...

Note that TargetOnsetTime is always from the start of the experiment.
To see this better, do the following: (1) Log the TargetOnsetTime of
your stimuli, and look at the values that show up in the .edat2 file;
(2) Start the program, but then wait a minute or so before moving from
whatever "Welcome" screen you have before you start the experiment
proper, and then see how your timing works. I bet something else
happens! (Also, look at
https://groups.google.com/d/topic/e-prime/OeiZ00V9SRc for some
explanation of the various E-Prime time audit measures.)

So
timeLeft = 60000 - STIM60.TargetOnsetTime

may not do what you want it to do. You might rather do something like

timeLeft = (60000 + FirstOnset) - STIM60.TargetOnsetTime

depending on what you really want this to do. Moreover, it will help
your debugging if you log these values so you can see what they do, e.g.,

c.SetAttrib "timeleft", timeleft

or sometimes, just do this at run time with a MsgBox, e.g.,

MsgBox "timeleft: " & timeleft

That should help you see what is really going on.

---------------
David McFarlane
E-Prime training online:
http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster)
Reply all
Reply to author
Forward
0 new messages