Give feedback for correct answers after incorrect answers

I’m doing a experiment about Greeble. The subject need to learn some greebles with names . In the experiment test, they need to judge whether these greeble in the picture have been learned. If they have learned this greeble, they have to press the first letter of the name of it. However, when their answer is wrong, the screen will show the correct name of the greeble which they see in the picture, ex: “its name is zax.”
If it is a greeble that has not been learned, the correct answer is"n". When their answer are wrong,the screen will show “its has no name.”.

I would like to ask how to write a code that can give corresponding feedback after the subject answers incorrectly?

How do you decide which Grebble is being shown? What kind of structure do you have? What type of randomization? What does your flow look like?

Thanks for your help!I have found another way to solve this problem.