Howdy, Stranger!

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

Supported by

[solved] Collecting response time when using image button with inline script

edited May 2014 in OpenSesame

hello guys,

I am establishing a psychological experiment with a task in which one can click on a image (in a form) to choose the answer and proceed to next round of loop.

Everything runs ok except the inline script (custom form) fails to collect the response time of my mouse click on the image button (the default variable "time_inline_script turns out to be "NA").

So I tried to find other solutions,

from openexp.mouse import mouse
my_mouse = mouse(exp)
start_time = self.time()
resp, position, timestamp = my_mouse.get_click()
self.experiment.set('response_time', timestamp-start_time)

the code above succeeded to calculate and record the response time, while another problem comes that I have to do one additional click to continue (which is unacceptable in such experiment). I guess this is because the function of image button demands one click and that of mouse click demands another.

I am stuck in this for two days and deeply hope that somebody could help me to get a solution.

Thanks in advance.

Antonie

Comments

  • edited 4:13AM

    Hi Antonie,

    the code above succeeded to calculate and record the response time, while another problem comes that I have to do one additional click to continue (which is unacceptable in such experiment). I guess this is because the function of image button demands one click and that of mouse click demands another.

    That's correct, yes. Since the form will not give you any response times, you'll have to use an inline_script to catch the mouse response (like you did), or simply use the mouse_response item (which actually seems easier in your case). To avoid having to click twice, you make the form non-interactive (i.e. it's shown but doesn't wait for input), by adding the following line to the form's script:

    set only_render "yes"
    

    See also:

    Hope this helps!
    Sebastiaan

  • edited 4:13AM

    hi Sebastiaan,

    thank you for your answer! Now I understand that the codes I wrote do exactly the same thing as the item "mouse response". Sadly I still cannot solve my problem with your advice.

    May I introduce briefly the procedure of my experiment?

    1. Fixation point lasting 1000ms (with item "sketchpad")

    2. An interface including the task of "click a button to choose the answer" (with item "inline script", written by python codes)

    3. item "logger"

    And of course the 3 times are included in a sequence and loop.

    I am quite a newbie of programming, but I guess it was not a good idea to make the item 2 "non-interactive" since the "interaction" is the very purpose of the step.

    Please tell me if I misunderstood your idea and thanks again for your help.

    Antonie

  • edited 4:13AM

    Hi Antonie,

    Ah, right, so you have implemented the form in an inline_script as well? (I assumed that you used the form_base plug-in, and my suggestion was based on that assumption.) In that case, you could simply get the timestamps of before and after the form has been executed, and use these to determine the response time. For example like so:

    # (... create your form here ...)
    start_time = self.time()
    button_clicked = form._exec()
    timestamp = self.time()
    self.experiment.set('response_time', timestamp-start_time)
    

    Does that make sense?

    Cheers,
    Sebastiaan

  • edited 4:13AM

    Bravo! It works with your advice. Thanks a lot!

    Well the solution is so simple that I'm now confused why it didn't occur to me. I just could ignore the mouse click function and the lines of time calculation will do the work. I wish I could have more time to learn some basics of programming...

    And it feels great that we have both such useful software and considerate instructions of you and your colleagues.

    Antonie

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