Howdy, Stranger!

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

Supported by

[open] how to flush responses on serial response box

edited September 2014 in OpenSesame

Hi,

I'm having a problem with using the serial response box (the one from psychology software tools) in OpenSesame:
I designed a simple experiment in which two stimuli are shown in a subsequent order with a blank screen in between. After every stimulus (projected using a sketchpad item) a response on the response box is collected using the following script in Inline:

exp.srbox.start()
buttonlist, timestamp=exp.srbox.get_button_press(allowed_buttons=1,5], timeout=3000)
exp.srbox.stop()

For some reason, if you would press a button twice during the first stimulus, the second response is used as the response for the second stimulus. I know with the keyboard you can flush responses and this has worked in previous version of this task, but I don't know how to solve this for the response box.

Any ideas?

thanks in advance!
Tamara

Comments

  • edited 6:49PM

    Hi Tamara,

    The SRBox plug-in flushes automatically when you call the start() function, so that is unlikely to be the problem here. What comes to mind is that the first button may, on occasion, still be pressed when the script is executed, thus triggering a response. The SRBox plug-in doesn't require a new button to be pressed, but will also respond to buttons that were already pressed when get_button_press() was called.

    Could that be it?

    Cheers,
    Sebastiaan

  • edited 6:49PM

    Hi Sebastiaan,

    Thanks for your quick reply!
    Your explanation makes sense. However, I would very much like the SRBox plug-in to respond only to button presses that are started after the script is executed. Is that possible?

    thanks,
    Tamara

  • edited 6:49PM

    Hi Tamara,

    You could pause the experiment while any button is pressed, at some point before you collect the response. This will require a bit of Python inline_scripting. I don't have an SRBox here to test, but something like this should do the job:

    # Loop until no button is pressed
    while True:
        t, l = exp.srbox.get_button_press(timeout=1)
        if l == []:
            break
    

    See also:

    Note that any delay due to waiting for a button release will not be taken into account in the response time as determined by the srbox plug-in!

    Cheers,
    Sebastiaan

Sign In or Register to comment.