The issue is that if an option is click twice or more, the score will be increased.
I expect that scores should not go beyond 5, since there are 5 questions present.
You need an extra variable to keep track of the answers the player has given already, either a list of them or a count.
Also,call your scoring procedure from the submit button click event, to give the player a chance to change their mind And to help guard the scoring with limit checks.
Your first point: I don't really understand it.
Assumed I created an empty list; if a player takes an option, it will be added to the list, then if he changes his mind, then the first option should be replaced by the new option taken by the player. Is that what you mean?
Second point: The reason I put it in the options button is that each question page has a next button except for the last question, in which when the player clicks on an option, it will change to the submit button.
Probably, I should call the scoring procedure in both the next and submit button click event.
Another alternative is to disable ALL the answer buttons after one of them is clicked, and to leave them all disabled until they are reloaded with new answers.
I took this approach before, but it later occurred to me that a player may instantly change his mind after taking an option and locking other options won't allow him to take another.
Going by what you said previously,
Also,call your scoring procedure from the submit button click event, to give the player a chance to change their mind And to help guard the scoring with limit checks.
I have called the scoring function in both the next and submit events, and it works perfectly.
Thanks so much, @ABG .