Howdy, Stranger!

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

Supported by

Stop experiment after correct responses to N trials

edited October 2016 in OpenSesame

I am a novice and I need to design an experiment that stops the sequence, ending the experiment after correct responses to N=12 trials have been given.. I am guessing (wrongly?) that I should add a line to the "break if" field in the Loop item.

Comments

  • Hi,

    This could be an option. Assuming that you have a variable that keeps track of the number of correct responses, something like that (in the break_if field) will work:

    [no_correct = 12]
    

    Of course, if you have nested loops (e.g. a trial loop in a block loop), you would have the other loop as well.

    Does this make sense?

    Eduard

    Buy Me A Coffee

  • Yes, it makes sense. How do I create a variable that keeps track of the number of correct responses? I suppose I have to add some Python command.
    The script now looks like this:
    set break_if "[no_correct]=12"
    setcycle 0 target_digit 11
    setcycle 0 target_letter AA
    setcycle 0 correct_response S
    setcycle 0 no_correct ""
    setcycle 1 target_digit 99
    setcycle 1 target_letter AA
    setcycle 1 correct_response S

  • Hi guys,

    As of OpenSesame 3.1, you can also make use of the responses object, which keeps track of all responses. For example,responses.correct gives you a list with the correctness (0, 1, None) of all responses, where responses.correct[0] is the last response.

    So the following break-if statement would break the loop whenever the last three responses were correct.

    =len(responses.correct) >= 3 and None not in responses.correct[:3] and 0 not in responses.correct[:3]
    

    See also:

    Cheers!
    Sebastiaan

  • Great! It provides feedback and breaks the loop as I requested. However, the message pops up asking to press any key to continue, whereas the experiment should be over once a N number of correct responses has been achieved.

  • However, the message pops up asking to press any key to continue, whereas the experiment should be over once a N number of correct responses has been achieved.

    This seems pretty basic. Maybe give it try yourself first, and if you get stuck you can ask always ask again. What do you say?

  • That's right. Sorry I have been using OpenSesame for only a few days. I figured it out, I just had to repeat the cycle only once.

Sign In or Register to comment.