Project "Javascript Quiz" is a quick quiz of up to several questions that is made through Javascript DOM manipulation. Site is responsive and will react to different screen widths (within limits). Site will also save high scores into localstorage and retrieve them as needed, with optional reset.
http://github.com/kschang77/javascript-quiz
Any Javascript-capable browser
No installation required
// read back the arrHighScores from local storage
function retrieveHighScores() {
var rawData = localStorage.highScores;
// console.log(rawData);
if (rawData != null) {
var highScoresStored = JSON.parse(rawData);
// console.log(highScoresStored)
arrHighScores = [];
for (var i = 0, len = highScoresStored.length; i< len ; i++) {
var highScoreSingle = new Object();
highScoreSingle.name = highScoresStored[i].name;
highScoreSingle.seconds = highScoresStored[i].seconds;
arrHighScores.push(highScoreSingle);
// console.log(highScoreSingle)
}
}
// console.log(arrHighScores)
}
- Random order of questions
- Random order of answers
- Sort High Score Table
- Other cosmetic touches
https://kschang77.github.io/javascript-quiz
Kasey Chang
This project is licensed under the MIT License
- Hat tip to Jerome, Kerwin, Mahi, and the UCBEx Coding Bootcamp March 2020 cohort