experiment timer, or safe mid-experiment stop?

374 views
Skip to first unread message

Alison T Miller Singley

unread,
Sep 27, 2012, 12:17:05 PM9/27/12
to e-p...@googlegroups.com
I'd like to modify an experiment to last only 10 minutes total, so regardless of how many trials a subject completes, the experiment stops at 10 minutes.

I can think of two options, but I don't know how to operationalize either of them:  :)
1 - have the test administrator watch time and manually stop the experiment at 10 minutes
Issue: by aborting the experiment (with ctrl+alt+shift), the .edat file is not created. Is there a way to safely stop an experiment and preserve the data? Or a way to write the .edat file continuously?

2 - set an experiment-level timer to end after 10 minutes
Issue: I don't know how to do this. :) Does anyone know of a feature or code I could use as an example?

Thanks!

terhi helminen

unread,
Sep 27, 2012, 1:40:56 PM9/27/12
to e-p...@googlegroups.com
Hi,

For option number 1 see the safe exit sample in 

Terhi


--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-p...@googlegroups.com.
To unsubscribe from this group, send email to e-prime+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/e-prime/-/BaIbAT82ksYJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Paul Groot

unread,
Sep 27, 2012, 5:00:09 PM9/27/12
to e-p...@googlegroups.com

Parallel to the manual break method (using GetUserBreakState), you could add a simple test that calculates the difference between the 'çurrent time' and some starting point, and use this value to set the break state as soon as a timeout limit is reached:


Const maxduration&=600000&   ' add & to make sure large values are declared as long integer

if Clock.ReadMillisec>=StartObject.OnsetTime+maxduration then
   SetUserBreakState(1)
end if

if GetUserBreakState() then
    TrialList.Terminate
    BlockList.Terminate
end if

Where StartObject is the object that is the first one displayed in the 10minute epoch (this must be an object that is displayed only once).

Cheers
Paul



2012/9/27 terhi helminen <helmin...@gmail.com>

Sam

unread,
Sep 28, 2012, 9:57:27 AM9/28/12
to e-p...@googlegroups.com
Hello, 

I found the above script for setting the Break State to be very helpful since I am currently trying to accomplish something similar. I have an IQ test that must advance to a feedback stage after 20 minutes if the questions haven't been completed. However, the way I implemented the above suggestion, it seems to wait until the end of the trial in order to terminate. Since subjects can take as long as they want on each trial, the trial duration is "infinite", so it's possible it could never exit until much later if they are just beginning one of the questions before the time runs out. Do you know if there is a way I can modify the script so that it would end the current trial as soon as the time limit is reached?

Thanks for your help, and I apologize if there is something very basic I have missed. I am somewhat new to programming in E-prime. 

Sam

Paul Groot

unread,
Sep 28, 2012, 12:18:35 PM9/28/12
to e-p...@googlegroups.com
Well, probably the easiest way to achieve this is to add additional inline script that sets the duration of the response-object to the allowed 'leftover' time. It shouldn't be to difficult if you only focus on the trial objects that have their durations set to infinite. Basically is can be something like this:

Dim leftover as long
leftover = StartObject.OnsetTime + maxduration - Clock.ReadMillisec
if leftover<0 then
   leftover = 0
end if
RespObject.Duration = leftover

The maxduration constant (defined in the previous example) should be placed in the global User Script section, so it is available in all inline scripts. You might have to add additional scripts if you have several trial objects that should be handled (probably using goto's and a label to jump to the end of a trial if leftover<=0)

cheers
Paul

2012/9/28 Sam <saman...@gmail.com>
To view this discussion on the web visit https://groups.google.com/d/msg/e-prime/-/eMlUPO9Xje8J.

Sam

unread,
Sep 28, 2012, 1:27:15 PM9/28/12
to e-p...@googlegroups.com
Interesting, thank you very much for your help! :-)

Best,
Sam

Alison T Miller Singley

unread,
Sep 28, 2012, 1:52:48 PM9/28/12
to e-p...@googlegroups.com
Yes, thank you both very much for your advice! 
Alison
Reply all
Reply to author
Forward
0 new messages