So in the video, the answer to the challenge about changing the text when an incorrect answer is given was:
correctAnswerIndex = question.GetCorrectAnswerIndex();
string correctAnswer = question.GetAnswer(correctAnswerIndex);
questionText.text = correctAnswer;
However, since there was already a class variable called correctAnswerIndex, I had:
questionText.text = question.GetAnswer(correctAnswerIndex);
It worked!!!
And after thinking, I can’t understand why!!!
correctAnswerIndex should be 0 every time because I’m not initializing it!
I’m not feeding it the data from the SO. But I tested by changing the SO data and it worked!!! HOW???