The code at the end of this section didn’t work as intended- the first question displayed showed an incorrect answer - after that, it worked fine. So I copied all the code from Git Lab for this section and the same error was present. After using debug messages printing out all the boolean flags and timers etc. across the two classes I found the issue.
There is a subtle bug in the way the timerValue is initialized and then first used. timerValue is declared with no value therefore it has a default value of 0; When the updateTimer() is first called, timerValue is set -ve with the line “timerValue -= Time.deltaTime;” then isAnsweringQuestion is set false because timerValue is not >0. This causes the Quiz Update() to execute “if (!hasAnsweredEarly && !timer.isAnsweringQuestion)” with a call to DisplayAnswer(-1) and therefore displays an incorrect answer.
Sorry if the above was not clear but it is difficult to explain. Setting the timerValue to 10 seconds when it is declared solves the issue because the first time through the UpdateTimers() it doesn’t go negative.
Not sure how the GitLab code could be the final version for this section.
So the above demonstrates that the code design with many public boolean flags and timers being used as state values isn’t the best design. It served its purpose by introducing the Unity UI and interaction with buttons, canvas, images etc. but it’s not best practice and probably shouldn’t be followed for larger projects.