[solved] Please Advise - Countdown Timer/Time Limit in Sequence
I'm trying to build a trial where participants have to complete as many trials as possible within a given time (60 seconds). Any idea how I can set this timer? Tried running sequence in parallel with an advanced delay, but that crashes the programme. All suggestions/help gratefully appreciated
Comments
One thing you could do, is add an inline_script item directly before the loop that runs your trials. Add the following code:
Prepare phase
Run phase
Now set the
Break ifstatement in the advanced options of your loop item to the following:Or you can download this working example.
Good luck!
Hi Edwin,
I'm having the same problem mstudent mentioned, and I tried to do what you did suggest, but it still don't work. I don't know if it is because I am not using last version of OpenSesame, if it is because I am using Mac OS or another reason I can't figure it out..
Any advice on this?
Thanks!!
Francisco
Hi Francisco, I just answered your other post (which didn't specify that the participant has to do as many trials as possible within a given timeframe by the way; this is a different story!)
This should however be easier; and just like Edwin said. You place an inline_script at the beginning of your experiment, where you make the variable exp.start_time = self.time()
Next, in the loop item that contains your trial sequence (which is supposed to repeat for 60 seconds?), you tick the advanced options box and insert the break-if command: =self.time - self.get('start_time') > 60000.
This will work on any OS, so if there's still a problem after you implement the above it must be somewhere else in your code/structure.
If so, can you tell us what the structure of your experiment looks like? (Where are your inline_scripts, what is in the sequence item exactly, and is this sequence placed in a loop?)
Cheers,
Josh
Hi Edwin, hi Josh,

like mstudent I'm trying to build a trial where participants have to complete as many arithmetics as possible within a given time.
if I do just copy paste in the break if statement of my "new loop" (arithmetics) the experiment execute just until the "word loop". Could you please tell me where I'm wrong?
ok done! I didn't write the second line in the run part of the same inline script in which I wrote the first!
Now it (seems to) work!
Next step will be trying to use the text input form instead of the sketchpad. How can I eliminate the sound from the form?
Hi,
What do you mean with eliminating the sound? Just delete the lines that are sound related? And why do you want to use a
text_inputfor?Good luck,
Eduard
Hi all,
Thank you for the solution.
I just need the whole thing a little more precise, unfortunately. The loop should not simply be interrupted when the time is up, but really terminated. With the solution shown here, it is so that after the time has expired, the respective run is still terminated. In my case, however, I need a solution that also the current run is already ended. Is there also a solution?
Hi Mirko,
I don't quite get what you mean. Could you elaborate on the distinction that you see and what exactly it is that you need?
Thanks,
Eduard
ps, is this discussion about the same issue? Then, I will reply there (if still needed)