- START QUIZ questions = [{}, {}, {}] questionIndex = 0 score = 0
- CLEAR HTML MARKUP
- RENDER OF THE CURRENT QUESTION
- CLICKING BY BUTTON "Відповисти"
- CHECKING THE CORRECTNESS OF ANSWERS checkAnswer
- FIND SELECTED BUTTON radio
- CHECKING IF THE SELECTED RADIO BUTTON IS FOUND: no => the user did not select the button => exit from the function checkAnswer (& back to the CLICKING BY BUTTON "Відповисти") yes => we finding out the number of the user's answer => IS THE ANSWER CORRECT? no => do nothing yes => INCREASE USER ACCOUNT score++
- WAS THAT THE LAST QUESTION? no => INCREASE INDEX => CLEAR PAGE => SHOW NEXT QUESTION (& back to the CLICKING BY BUTTON "Відповисти") yes => CLEAR PAGE
-
=> SHOWING THE RESULT
-
=> CHANGE THE BUTTON TO "Play Again"
-
=> WHEN YOU CLICK "Play again" - REFRESHING THE PAGE