Howdy, Stranger!

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

Supported by

[solved] Use response time to set fixation duration

edited October 2013 in OpenSesame

Hi all!
In my experiment each trial should have the same fix duration of 4000ms. This means that the duration of each trial depends on the participant's response time in this trial. Is there a way to use the response time of a participant? I know there is a variable [response_time] that I can save in the logger. However, OpenSesame tells me that this variable is not set in the sketchpad that I am using for the end fixation. Is there a way to set the variable for the sketchpad? I am using a keyboard_response item for the response collection, but the same error occured when I created a keyboard response using inline code (I used the exp.set function, which usually works in this case).
Thanks for any help! =)

Comments

  • edited 7:13AM

    The reason that you cannot use [response_time] as a duration for a sketchpad in your case is because the duration is already prepared before the response has been collected. This is related to the distinction between the prepare and the run phase:

    And at any rate, you want a duration of 4000 - [response_time], right? So using [response_time] for the duration wouldn't result in the expected behavior anyway.

    The easiest trick to pad the response time is probably to insert a simple inline_script after the keyboard_response. The following code waits for 4000 ms minus the previously collected response time. (You need to put this code in the run phase of the inline_script.)

    self.sleep(4000-self.get('response_time'))
    

    You can also take a look at this discussion about non-slip timing:

    Hope this helps!
    Sebastiaan

  • edited October 2013

    This was what I wanted, thank you!
    But I realized that I now have another question: What happens if no reaction is shown? The keyboard response is set to time out after 1700ms. So I would like the 'response_time' in the self.sleep function to be replaced by this 1700ms if no reaction is shown. How can this be done? Or is this automatically the case?

  • edited 7:13AM

    When a timeout occurs, response_time is set to the timeout value and response is set to 'None'. So in your case I think timeouts should work exactly as you want!

  • edited 7:13AM

    Perfect, thanks again!

Sign In or Register to comment.