| Reference | Downloads | Github

Pressing three keys instead of one

Hi everyone. In my experiment I need participants to listen to an audio file saying two numbers for example 2,9 and then they should enter these two numbers. At the experiment I’ve attached here the voice is just a note but it will be replaced with a human voice saying two numbers. As long as they enter it incorrectly, this will keep repeating. But the only way I can do this is through putting two routines including keyboard components?
My more important question is how make this loop repeated if they press wrong keys?
What I’ve done is like this:
keys.psyexp (13.4 KB)
As you can see in my .psyexp file, this is the code I’ve used to make the loop repeat again but it just loops one time as I’ve defined NN=1 in the begin experiment. So I don’t know why increasing NN by 1 to make the loop be executed again doesn’t work!

I would appreciate your help in this.

You can’t change the value of nReps once a loop has started. What I do is put nReps as a large number (e.g. 999) and then use loopName.finished = true to end the loop when the appropriate criteria is met.

You are right. thank you!