Howdy, Stranger!

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

Supported by

[open] Display time left on form text input

edited January 2014 in OpenSesame

Hi,

I am trying to display the duration of time left on a form. For example, if participants have 2 minutes to finish a task that is presented on a form text input. I wish to show the total time allowed and the time left on a corner.

I was able to display time left on a canvas taking some bits of code from here http://forum.cogsci.nl/index.php?p=/discussion/38/solved-intentional-binding-paradigm-creating-animations/p1 but I am unable to find a way to present it on item itself (form_text_input).

Any insights and pointer will help.

Thanks in advance,
Asma

Comments

  • edited January 2014

    Hi all,

    So here is what I was able to achieve after posting the query-

    [pastebin:vPyqwLqT]

    Right now, I am able to create a canvas that shows the time lapsed in seconds and a form that consist of a task that I wish participants would do in allotted time. Although my script works in parts but does not achieve what I want. I want to display the time elapsed at the bottom of the form (not on a separate canvas as it is now), but right now it just shows the last value I get in the while loop present in the inline script.

    Any help will be much appreciated.

    Thanks!

  • edited 6:38PM

    Hi Ahani,

    Looking at your script it seems like you want a continuously running countdown timer in your experiment, is that correct? I'm afraid that this is not possible, at least not without extensive inline scripting.

    What you can do, however, is present a static countdown timer that is updated with, for example, every new trial. Would that be sufficient? The script below shows how you can keep track of the time that is left as the variable timeleft (see code comments for details). You can then use this variable to display the time left in sketchpad items, etc. But it will be a static message, not a running counter.

    # Total duration in seconds
    total_time = 60
    # Time passed since the start of the experiment, as determined by the
    # presentation timestamp of an `instructions` item.
    time_passed = (self.time() - self.get('time_instructions'))/1000
    # Set the time that is left
    exp.set('timeleft', total_time-time_passed)
    

    Cheers!
    Sebastiaan

  • edited 6:38PM

    Thanks Sebastiaan,
    I was able to display the total time passed. I wanted a dynamic display to show the time passed.

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