Could I set a correct answer when using button tool

Hi all, do you know if it is possible to set the correct answer in the button tool?
I have 17 buttons appearing at the same time, and the subject needs to choose 1 correct button from the 17 buttons. But when I looked at the data, I couldn’t see which button the subjects chose every repeat. And I couldn’t set the correct answer just like the keyboard tool. Could you please help me solve these problems?
Thank you all:)

My computer system is Mac OS Monterey 12.2.
The version of my software is PsychoPy version 2.3.

I haven’t tried the button tool myself (because it doesn’t work online) but doesn’t it allow you to run some code if pressed? The code to store data is


Thank you for your code:) I will try this code in my experiment. Thanks again.

You can have a try:

Ok! Thank you for your advice:) I am trying to do this now.