Skipping a routine based on response

Hello,

I have a loop with 3 iterations. On each iteration, participants can press 1,2,3,4, or 5. I want to make it so that if a participant clicks ‘3’ on the last iteration of the loop ‘trials’, they go to the routine ‘yay’, but if they press any other key, they go to the routine ‘oops’.

To do that, I am using ‘mycount’ to iterate the loop (I am using code to iterate because this is a part of a bigger experiment, in which a loop can only be iterated with code) and attcheck to store the key press.

My problem is that the code is not storing the key press as attcheck=1, I think CatchQResp.keys != 3 is the wrong thing to write.

Below are screenshots of my experiment and code.

image

image

image

image

image

image