base timing of a trial on total time taken in previous trials--mismatch error?

Janet Trammell janet.trammell at gmail.com
Thu Jun 30 18:18:23 UTC 2011


I am programming an experiment where the total time a person can take
is 10 minutes (600000 ms) (to do 12 trials), with a maximum of 2
minutes per trial (the trial terminates and starts the next trial
after 2 minutes). I have set the program to terminate the list if the
total time is over 10 minutes, however there is a problem--say a
person has taken 9:45 do to 7 trials, so they have 15 seconds left.
BUT...on trial 8, the duration is still set to max 2 min--so a person
can theoretically have a total of 11:45, not 10:00 before it
terminates. So I need to have the program know that if more than 8
minutes (480000) has been used, the duration of the trial should be
600000-however much time has been used so far.

I have tried to fix this by putting an attribute in the list object
called "trial" which is just the number of the trial, and another
attribute called "trialtime", which will be the duration of the slide
object (where the stimulus/trial is presented). in the slide object
properties, I have set timelimit to be the attribute "trialtime".
Lastly, after each trial, the attribute "timertrial" is calculated,
which essentially calculates the length of time taken for that trial
and adds it to the previous time taken, so that this attribute is
constantly updated to reflect the total time taken. All of this seems
to work fine, and running through the program shows that "timertrial"
is indeed calculating correctly and is recording in the edata file.
the problem occurs, however, when I put all this together, and try to
change the duration of the next trial based on the "timertrial"
attribute. Here is my code:

Using the inline statement below, I have set the first trial duration
is 120 seconds, and every other trial after that the duration is
calculated based on total time taken so far

If c.GetAttrib ("trial") = 1 then c.SetAttrib "trialtime", 120000
If c.GetAttrib ("trial") > 1 then
If c.getAttrib ("timertrial") >= 480000 then c.setAttrib "trialtime",
600000 - c.getAttrib ("timertrial")
If c.getAttrib ("timertrial") < 480000 then c.SetAttrib "trialtime",
120000
End If

The problem is, the program cannot find the attribute "timertrial"--it
calculates fine at the end of each trial, but when I start a new trial
(within the same list), it does not have a value yet for timertrial,
since that is calculated at the END of the trial. How do I get it to
pull the value of "timertrial" from the previous trial and use it as
an attribute in the NEXT trial? I am sure this is simple, but I can't
seem to get anywhere.

Also, Note: I have tried using this code instead:
If c.GetAttrib ("Trial") > 1 then
if LetterSetList.GetPrevAttrib ("timertrial") >= 480000 then
c.setAttrib "trialtime", 600000 - LetterSetList.GetPrevAttrib
("timertrial")
if LetterSetList.GetPrevAttrib ("timertrial") < 480000 then
c.setAttrib "trialtime", 120000
End If

And I keep getting type mismatch errors, which should be easy to
resolve, but this one keep stumping me.  Again, I'm sure this is
something simple, but for some reason I can't get it.

-- 
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