My loop isn't running as per my code

OS: Win11
PsychoPy version: 2023.2.2

I want the loop to end when the participant presses "space", moving on to the next step, otherwise the loop continues

Here’s my code

But the fact is that when the participant presses the "q", the cycle is over

To be honest,I can’t understand the error.I will appreciate it if you could help me!

Hi

I’m afraid you don’t have anything in your screenshots that show how the loop is terminated.

See Builder - terminating a loop — PsychoPy v2023.1.2

Best wishes
Yiannis