Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

interrupt after 5 consecutive incorrect responses

Hi, I want my experiment to interrupt after 5 consecutive incorrect responses.
Is there an easy way to implement this?


  • EvaEva Posts: 27

    I think so, one of the variables that opensesame logs normally is "counts" -- I normally don't have incorrect responses so I don't know the exact variable but I would assume that it counts the incorrect responses and what you would need to implement somehow is to say if count_incorrect = 5 --> quit.

    Easiest way to find the variable you're looking for is to run a quick experiment and then check the logger :)

  • eduardeduard Posts: 1,115

    Eva is right. To make it a little concrete, you can put an inline_script in your block sequence and put the following code in its run phase:

    # You need a variable that keeps track of the current trial count 
    if var.trial_no > 5: # make sure that at least 5 trials have passed 
        if sum(responses.correct[-5]) == 0:
            # code that will make your experiment halt. depending on what you want
            # there are different ways to implement it. Let me know what you want and
            # I can give you some advice

    This part of the documentation might also help: http://osdoc.cogsci.nl/3.1/manual/python/responses/

    Hope this helps,


  • Thanks for the suggestion! I'll work on it and let you know.

Sign In or Register to comment.