Howdy, Stranger!

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

Supported by

Variable Timeout

Hi, I couldn't find anything online for my problem, so I hope someone can help me.

I have a keyboard response timeout of 2000 ms and afterwards a fixation star should be displayed. The Timeout of the fixation star should be something like this: [2500ms + Jittering - response time]. Is there an easy way to implement this? Unfortunately I am still very new to Python and OpenSesame.

Thanks in advance

Tobi

Comments

  • Hi Tobi,

    in an inline_script, you can compute the new timeout.

    It is important to put the code in the run phase, because otherwise no response will be defined.

    jitter = 2000 # or whatever you want
    var.star_dur = 2500 - var.resp_time + jitter
    

    Importantly, the star then needs to be shown in the feedback item, not a sketchpad. See here why:

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited December 2019

    Thank you, that solved my problem. Though I have another little thing: I want to show the text "Wrong!" when the wrong key was pressed and "Too slow!" when nothing was pressed, but if I use [correct] as variable for "Wrong" it is shown when nothing was pressed as well, so what variable do I have to use?

    Additionally, I want to use a custom keyboard, is there an easy way to implement this?

  • Hi,

    What do you mean with custom keyboard?

    Splitting the feedback into wrong and too late is possible, for that you need to use an additional variable though. For example, you can use var.response which indicates whether a response was given, so if [response] = 'None' and [correct]=0, then you would want to show too late, otherwise wrong.

    Good luck,

    Eduard

    Buy Me A Coffee

  • Hi, thanks for the help.

    With 'custom keyboard' I mean a response pad with 4 buttons, which can be accessed via ports, so I can't just use the normal keyboard response, but had to write an inline script where I access the port. I tried the following code, but I get an 'invalid syntax' (I think for the if condition), do you know why, and if the code would be working as intended?


    timeout_start = clock.time()

    timeout = 2000

    while clock.time() < timeout_start + timeout:

    var.response = io.DlPortReadPortUchar(port+1)

    if var.response == (4 or 5 or 6 or 7)

    var.response_time = clock.time() - timeout_start

    break

  • @Mkengine You have asked the exact same question in this post. Please don't do that in the future, and help us keep the forum clean!

  • Sorry, I won't do that again. After some time I just thought this thread was buried and it's faster to open a new one.

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