Howdy, Stranger!

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

Supported by

[solved] Button-click response times

edited January 2014 in OpenSesame

Hi,
Just wondering how to get the logger to log response times for my experiment. I'm using the form_base item to create buttons that participants will respond on. I've managed to find info on how to get the form to log which response is made, however I can't seem to get it to log response times?

Thanks in advance.
-Rose

Comments

  • edited 10:17PM

    Hi Rose,

    Welcome to the forum!

    Could you provide us with some more information? How did you try to determine the response time? And where does it go wrong? What kind of output do you get? Perhaps it would be easiest if you could upload your experimental script here by doing the following:

    • Open the "General properties" tab, click "Script editor" and copy the whole script,
    • go to http://pastbin.com or http://gist.github.com, upload your script there (simply paste and submit)
    • and provide us with the resulting link in your forum post.

    Best,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited November 2013

    Hi Lotje,

    Thanks for the quick reply.

    You actually answered a question like this before. So I used the the inline script you posted (1) and followed your directions; however when i run the experiment this what comes up in the error box (2)

    1.

    https://gist.github.com/anonymous/7654856

    2.

    Error: Inline script error
    In: inline_script (run phase)
    Line: 10
    
    Python traceback:
    TypeError: unsupported operand type(s) for -: 'int' and 'unicode'
    
    Full traceback in debug window
    

    This is what I have for my form_base:
    https://gist.github.com/anonymous/7654849

  • edited 10:17PM

    Hi Rose,

    Apparently I made a mistake in my inline script. To determine the time stamp of the form_base item, you should use:

    starting_time = self.get("time_my_form")
    

    instead of

    starting_time = self.get("my_form")
    

    Does that solve your problem?

    Best wishes.

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited December 2013

    Yes, it works perfectly.

    Thank you so much Lotje!

  • Hello,

    I hope you're doing well.

    I read this old conversation because I would also like to log the response time that participants give in a form_base. The thing is that in the "form_base" they have to put a string of 6 letters, so when I try to calculate the reaction time with "my_rt = current_time - starting_time" I get this message "unsupported operand type for (-) float and str. So I added the function float before (starting_time). But now I get this message ValueError: could not convert string to float: 'ABCDEF'.

    Do you have an idea about how can I solve this problem?


    Thank you very much in advance.

  • Hi @Gio38000 ,

    It looks like the variable starting_time actually contains the response as opposed to the onset of the item. This is likely due to how you implemented this.

    That being said, you can get the reaction time more easily, by subtracting the onset time of the form item from the onset time of the subsequent item (e.g. a sketchpad that follows the form). Onset times of items are automatically available as time_[item name] variables. Does that clear things up?

    — Sebastiaan

  • edited March 2023


  • Thank you very much, @sebastiaan. I will do that. 😊

Sign In or Register to comment.