inline script - repeat incorrect response trial
in OpenSesame
When the participant gives an incorrect response in a trial, that meets a specific criterion, I want the trial to be repeated one time only, and not repeat ad eternum if the participant does not give the correct answer.
The inline script code is as follows:
if (self.get('correct') == 0 and self.get('reward') ==1):
exp.items['block1_sequence'].prepare()
exp.items['block1_sequence'].run()
With this code the trial is repeated successively until a correct response is given.
I want the trial to just repeat once. How to do it?
Thanks in advance!
Comments
Hi,
You can add another variable to your logical that is either
Trueif the the trial is not repeated andFalseif it is repeated (or the other way around). The tricky part here is to find the right spot where to initialize this variable that it is reset to 0 before a new trial starts, but not if the trial is repeated. Without knowing your experimental structure, it is quite hard to help you with that.So, your code would then look something like that:
Btw., from OpenSesame 3.0 on, you don't have to
getvariable values, thevarobject replaced it (see here).So, your code could also look like this:
Does this make sense?
Eduard