Forced click Response before proceed

OS (e.g. Win10): MacOS 10.14.6
PsychoPy version (e.g. 1.84.x): v.2022.1.1
What are you trying to achieve?:

For my experiment, participants will see three choices and I want them to choose one before they can click “exit” to proceed. They can change their choice before they click on “exit”.

What did you try to make it work?:

I read several post and now my design is as follows:

The mouse component:

The codes I have:

What specifically went wrong when you tried that?:
The click did not work when I clicked “exit” to end the routine. I think the problem may be in the mouse component, in which I set “End routine on press = never” . But later I tried to set up two mouse, one for choices and the other for “exit” (End routine on press = valid click), but this time I end the routine once I clicked on the choices.

Is there any problem with these codes? Do you have an idea on how to solve this problem? Thank you in advance!

I solved this problem with a different design!

In general, I have a code component, a mouse component, 2 button components (“exit” and “fake”) and three polygons for choices. The mouse properties are the same as the screenshoot above.

In the code component, I wrote “start = False” at the begin routine, and “if mouse.isPressedIn(choice_1), start = True”…in each frame. Then I set the start condition of “exit” button to be “$start==True”. And it works well!

A simple mistake that would have been stopping your original code from having any effect was the misspelling of the variable name continueRoutine.