Howdy, Stranger!

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

Supported by

how to calculate total duration time of sketchpad?

Hello!

I am planning an experiment about solving an anagram.
Every time participant sees a word, he/she presses any key and write the word into the text input and then anagram comes again. I want them to be able to see anagram only for 180000 ms in total. I could calculate the time between the time_anagram and time_text_input and I could get the cumulative total. But because this calculation is based on time_text_input, when the time is up anagram doesn't disappear. It only disappears after the text_input, if the time is up.

So, I need a variable which counts the duration time of the sketchpad including anagram, independent from text_input. When cumulative total of time_anagram reaches to 180000 ms, the loop should break.

Is there any suggestion to solve this problem?

Thanks in advance!

Comments

  • Hi,

    This requires some scripting. Basically, what you need to do is to compute the residual time after every item has been executed. The time that is left, you should set then as duration/timeout field for the next item. That way you can make sure that the sequence does not last longer than 180 seconds. Depending on your experimental structure, you can build some other conditioning around that.

    Does that make sense?

    Eduard

    Buy Me A Coffee

  • Thanks for your reply Eduard!

    I am not sure if I got it correctly: Is this way independent from text_input phase?

    That actually makes sense, but here is the thing: suppose that participant saw the anagram (sketchpad) for 178 seconds and press the key and saw the text input and wrote the word. Then he/she saw the anagram again and it doesn't stop until he/she presses the key again. Because this script is based on the residual time between the anagram and the text input. So he/she can see the anagram for much more seconds than 180, whenever he/she presses the key again. I need a variable based on duration time of the sketchpad, not based on a subtraction script. Because this way doesn't actually standardize the duration time of the anagram for all of the participants. I need to find a variable to break the loop when time is up, even it was on the anagram phase. Is it possible?

  • Hi,

    you are right, I made a mistake. I think what you want is not possible to do with sketchpads and text_input_forms only. Maye co-routines can help you? If I am not mistaken you can set an overall duration for a co-routine, I am just not sure whether you can (and if so, how easy it is) to wrap a co-routine inside a loop.

    Regardless, it should be possible to accomplish this with some python coding though. So, use an inline_script and start a while loop. This loop lasts for 180 seconds. Further, every time an event is detected, it changes the stimulation. Once done, it continues to sample for a key press, while throughout keeping track of the time in the background. This code here is not supposed to work, but could you get started:


    # canvas object replaces a sketchpad https://osdoc.cogsci.nl/3.2/manual/python/canvas/ cv = Canvas() cv.circle(0,0,100,color= 'red',fil=True) # make a custom text input form. see here: https://osdoc.cogsci.nl/3.2/manual/forms/custom/#available-widgets-and-keywords # check this, I didn't really try to make a reasonable form form = Form( cols=[1,1], rows=[1,2,1], margins=(50,100,50,100), spacing=25 input_widget =Text_input(var=input_variable, timeout = 2) form.set_widget(input_widget, (0, 0), colspan=2) # make a keyboard item kb = Keyboard(timeout = 2) t0 = cv.show() formFinished = 0 while (clock.time()-t0)< 180000: # check whether a response is given if k != None: # show the form, form._exec() # once the form is clicked away, log that formFinished= 1 else: # only wait for a key response if we are in the canvas phase k,t = kb.get_key() if formFinished: # if the form is over, move to the canvas phase k = None formFinished = 0 cv.show()

    Again, I didn't test this code and didn't even try to make it perfect. I hope you will understand the logic of how to approach this problem with python coding.

    Good luck,
    Eduard

    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