Howdy, Stranger!

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

Supported by

[solved] repeat cycle until keypress

edited April 2014 in OpenSesame

Hi guys,

We are making a change blindness experiment in OpenSesame. A picture is shown, then a gray field, followed with the picture with the change and then again a gray field. This continues until the participant notices the change. When the participant notices the change, he has to press space. The reaction time is measured in the logger. Then the cycle must stop and the participant has to tell us where the change in the picture was. The problem is that the cycle has to repeat until there is a keypress, but we don't know how to do this. Can anyone help us?

Thank you!

Comments

  • edited April 2014

    Hi,

    You could consider setting the repeat value of your change_blindness_loop very high, and using a break-if statement to break out of the loop as soon as a response has been collected.

    For example, let's assume that you have an image_sequence that consists of presenting an image (defined by the variable image) and a keyboard_response with a certain timeout (say 100 ms). The following loop will then do the trick: image1.png and image2.png will be alternately presented until the keyboard_response doesn't time out.

    image

    In addition, you will have to reset the response variable to None right before the loop. You can do this with an inline_script like this:

    # Reset the `response` variable to None
    exp.set('response', None)
    

    This may do the trick for you. Alternatively, if you need more flexibility, you could consider implementing everything with an inline_script.

    Cheers!
    Sebastiaan

  • edited 1:59AM

    Hi Sebastiaan,

    Thanks for the tips, you helped us a lot :)

  • edited 1:59AM

    Hi, we're back!

    Our experiment works! But now we have a problem with the logger (output).. We want to know how many cycles it took for the participant to see the change. We clicked 'correct' in the logger. First the output showed us a '0' or '1' for a correct response or not, only now it shows different values, such as '41', '0' or '23'. What does this mean? Is it a problem in excel or do we have to select different options in opensesame?

    Bye bye,
    Fenna

  • edited 1:59AM

    We got a tip from a friend it may had something to do with multiple keyboard response objects.. We have four keyboard responses in our experiment :ar!

  • edited 1:59AM

    Hi Fenna,

    Are you sure you're looking at the right column in the output? It kind of sounds like you're looking at the count_keyboard_response variable rather than the correct_keyboard_response.

    If this is not the case, could you post your script?

    Thanks!

Sign In or Register to comment.