Skip to content

PhilC7/code-quiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Quiz

Here is a multiple choice code quiz about JavaScript. Using localStorage to set and get users results.

The criteria for this is as follows:

  • Upon clicking "Start Quiz" the game starts.
  • A timer starts counting down, if it hits 0, game over.
  • User answers 1 question at a time.
  • After each answer, it displays if you selected the correct or incorrect answer, relevant sound plays to let user know the result.
  • After all questions have been answered or time hits 0, user inputs their initials (max 3 characters).
  • Score and user initials are stored to local storage.
  • Highscore page loads up with user scores displayed in a list.

Useage

The website can be accessed here

How to play the game:

  • Open the link up in the browser.
  • Click "Start Quiz" button.
  • Answer each question, 1 at a time.
  • When quiz ends, input your initials (max 3 characters).
  • Click "Submit" button. This will redirect you to the highscores page and show your current highscores.
  • Click "Go Back" button to try again or click "Clear Highscores" button to clear all existing scores.

This is how the page should look.

Start Game

start-game

During Game

during-game

Submit Score

submit-score

Highscores View

highscore-page

Credits

Here are a few references that helped me to further understand localStorage, sort() method and how to add audio to the game.

Websites

  • To further understand how to use localStorage.

  • How to sort highscores order using the sort() method.

  • How to add audio files to webpage - w3schools.

License

Please refer to the LICENSE in the repo.

About

A multiple-choice quiz about coding.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published