Stop experiment after correct responses to N trials
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_iffield) will work:Of course, if you have nested loops (e.g. a trial loop in a block loop), you would have the other
loopas well.Does this make sense?
Eduard
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
responsesobject, which keeps track of all responses. For example,responses.correctgives you a list with the correctness (0, 1, None) of all responses, whereresponses.correct[0]is the last response.So the following break-if statement would break the loop whenever the last three responses were correct.
See also:
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
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.
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?
Check out SigmundAI.eu for our OpenSesame AI assistant!
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.