From 0e5fcd8e6b126ece7251f84d160e335850075e70 Mon Sep 17 00:00:00 2001 From: Joshua Date: Fri, 2 Feb 2024 07:51:41 +0100 Subject: [PATCH] New changes --- end.js | 3 ++- html-quiz.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/end.js b/end.js index 22d9d13..ec0afc2 100644 --- a/end.js +++ b/end.js @@ -10,13 +10,14 @@ const mostRecentScore = localStorage.getItem('mostRecentScore'), finalScoreText = localStorage.getItem('finalScore'), selectedThemeEnd = localStorage.getItem('selected-theme'), selectedIconEnd = localStorage.getItem('selected-icon') + const theFinalText = finalScoreText scoreRemains.innerText = `Got ${theFinalText} out of ${MAX_QUESTIONS} questions` -finalScore.innerText = mostRecentScore +finalScore.innerText = mostRecentScore + 1 if (selectedIconEnd) { navBox.classList.toggle(selectedIconEnd) diff --git a/html-quiz.js b/html-quiz.js index 7da8ed9..5c62d51 100644 --- a/html-quiz.js +++ b/html-quiz.js @@ -45,7 +45,7 @@ fetch('questions.json') const CORRECT_BONUS = 5 let htmlQuestionsIndex = htmlQuestions.length let MAX_QUESTIONS; -console.log(MAX_QUESTIONS) + const startGame = () => { questionCounter = 0 score = 0 @@ -54,6 +54,7 @@ const startGame = () => { getNewQuestions() game.classList.remove('hidden') + localStorage.setItem('avaliableQuestions', availableQuestions) } const getNewQuestions = () => {