How to get text from array or in bool?

Hi everyone. i am try to make a quiz game and i want to show the correct answer if the player hits the wrong answer. can you someone help me?

I have a script that holds the correct answers

public class AnswerData
{
    public string answerText;
    public bool isCorrect;


}

and array by this script

public class QuestionData
{
    public string questionText;
    public AnswerData[] answers;
    public AudioClip[] questionAudio;
    
}

and called in my game controller script if the answer is correct

 public void AnswerButtonClicked(bool isCorrect)
    {
        if (isCorrect) 
        {
            
            playerScoreOne += currentRoundData.pointsAddedForCorrectAnswer;
            scoreDisplayText.text = "Score: " + playerScoreOne.ToString();

            rightAnswerPanel.SetActive(true);
            questionDisplay.SetActive(true);
            StartCoroutine(TimeBetweenQuestions());
           
        }
        else
        {
            wrongAnswerPanel.SetActive(true);
           
            StartCoroutine(TimeBetweenQuestions());
        }

Simply use Array.Find to retrieve the correct answer, or simply make sure the correct answer is always the first one in your answers array.

if (isCorrect) 
{
    // ...        
 }
 else
 {
     AnswerData correctAnswer = System.Array.Find( answers, answer => answer.isCorrect ) ;
     if( correctAnswer != null )
     {
         // Show text using correctAnswer.answerText
     }
     wrongAnswerPanel.SetActive(true);
    
     StartCoroutine(TimeBetweenQuestions());
 }