Sorry, I assumed you wanted a global time, but I guess 120 s is actually quite short for that.
There is a value simply called 't', which is the time elapsed within a trial, but it gets reset to zero each time. So we need to manually keep track of that cumulative time across trials.
So in the "begin experiment" box of the code component, put:
cumulativeTime = 0 # initialise a variable to use later.
And amend the "end routine" check to be something like (NB not tested):
if Response.keys != ['7']: # the person pushed 1-6, so go on to the next trial:
trials_repeat.finished = 1
else: # the person pushed '7' so we will continue repeating, but check the time first:
cumulativeTime = cumulativeTime + t
if cumulativeTime >= 120: # the person pushed '7' but we should exit anyway:
trials_repeat.finished = 1
Regards,
Michael
On 13 Aug, 2013, at 16:19, Paweł Strojny <
stroj...@gmail.com> wrote:
> Great,
>
> I have small issue abut time.
>
> If I use command you've suggested ('if globalClock.getTime() > 120: trials_repeat.finished = 1') script is metering one global time of experiment - that's why if global clock reached 120 s once all subsequent trials are ended immediately they're started. I'm looking for some command which I can put into End Routine which may reset globalClock - is that a good idea? Or maybe I should use another command refering to some "nonglobal"Clock?
>
> Pawel
--
Michael R. MacAskill, PhD 66 Stewart St
Research Director, Christchurch 8011
New Zealand Brain Research Institute NEW ZEALAND
Research Fellow,
michael....@nzbri.org
Te Whare Wānanga o Otāgo, Otautahi Ph:
+64 3 3786 072
University of Otago, Christchurch
http://www.nzbri.org/macaskill