In the following exercise, the task was to employ web API's and local storage to create a functional online Javascript quiz that was time-based and could display high scores.
- Creating and accessing a storage for questions, answers, and the correct answer index.
- Having a start button that initiates a countdown and the next question.
- New questions and answer buttons generating each time a button is clicked.
- Assigning the correct answer index to respective buttons and implementing a condition for incorrect choices.
- Storing the remaining time as a variable to be used as a score and capturing user name input.
- Storing the name and score locally.
- Displaying the high score as a separate html page.
- Git clone the repository.
- Open
index.html
in a browser of your choice.
- Click on the "Start" button to begin.
- Click the corresponding button to input your choice.
- HTML
- CSS
- JavaScript
- https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Introduction
- https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector
- https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
- https://www.w3schools.com/js/js_timing.asp
- https://www.digitalocean.com/community/tutorials/js-json-parse-stringify
- https://www.geeksforgeeks.org/javascript-short-circuiting/