The following project is a Code Quiz, designed to test a beginner's understanding of Javascript Concepts. The rules of the Quiz are as follows:
- The user has 30 seconds to answer 4 questions
- For each correct answer, the user's score will increment by 10 points
- If the user is unable to respond to a single question, the test resets to the Homepage, giving the user the option to retake it
- At the end of the Quiz, the user has the option to save their highscore and username
- Only the top 10 user scores will be displayed for others to see
In order to develop this quiz, the following technology was used
- Javascript
- HTML
- CSS
The following provides an overview of the functionality of each file:
Game.js File:
-
The questions were captured in a variable
-
The timer was set to 30 seconds
-
The startGame() was created which can: A. Generate questions in a random order from the given list; B. Recognize correct responses and increment the score accordingly;
Highscores.js File:
The saveHighScores() was created which can:
- Save the top 10 scores to local storage in order
- Retrieve the top 10 scores from local storage in order
End.js File:
- Maps the top 10 scores in order for users to see