Howdy, Stranger!

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

Supported by

[solved] simple response recording

edited December 2015 in OpenSesame

Hi all,

I try to set up a simple detection experiment, and I need to record keyboard RT. I want the presentation time of the fixation dot, after the short stimulus, to be fixed at 1800 ms (the participant has to give an answer during this time window).
image

I can't do it simply with the interface, since the keyboard response module will pass to the next trial at keyboard pressing.

Can you guys help me with the inline_script module I need to implement ?

Thank you very much !

Raph

Comments

  • edited 1:41PM

    Hi Raph

    Set your second fixation to duration to 0, add an inline script with the following

    #create a keyboard
    my_keyboard = keyboard(keylist=['z', 'x'], timeout=10)
    #create an experiment variable
    var.my_result = 'None'
    #to get first response
    first = 0
    #get current time
    loop_start = clock.time() 
    loop_time = 0
    #wait 1800ms
    while loop_time < 1800:
        key, end_time = my_keyboard.get_key()
        #get current loop running time
        loop_time = self.time() - loop_start
        #first response is made
        if key != None and first ==0:
            first = 1
            var.my_result = key
    

    Change the keylist to match the desired response. The variable my_result will be available to the logger.

    This is written for Opensesame ver 3.

    For further details http://osdoc.cogsci.nl/python/

    Hope this helps

    Gary

  • edited 1:41PM

    Hi Raph,

    Gary's method works, but there's an even simpler way if you don't want to resort to inline_scripts. The duration of your post-stimulus fixation dot is set to 0ms, the keyboard_response is set to 1800ms, and after the keyboard_response you place another fixation dot sketchpad with duration set to 1800-[response_time]. That should do the trick!

    Cheers,

    Josh

Sign In or Register to comment.