Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Please Advise - Countdown Timer/Time Limit in Sequence

edited May 2015 in OpenSesame

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

  • edited 11:26AM

    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

    # pre-create the variable, so we don't run into any trouble in other prepare phases
    exp.set('block_starttime', None)
    

    Run phase

    # get a timestamp for the block start
    exp.set('block_starttime', self.time())
    

    Now set the Break if statement in the advanced options of your loop item to the following:

    =self.time() - self.get('block_starttime') > 60000
    

    Or you can download this working example.

    Good luck!

  • edited 11:26AM

    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

  • edited 11:26AM

    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

  • edited 11:26AM

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

  • edited April 2016

    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?

  • edited 11:26AM

    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_input for?

    Good luck,

    Eduard

    Buy Me A Coffee

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

  • edited March 2022

    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)

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games