Skip to content

Commit

Permalink
New changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaNwaizu committed Feb 2, 2024
1 parent 0e5fcd8 commit a1f8670
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion end.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const mostRecentScore = localStorage.getItem('mostRecentScore'),

const theFinalText = finalScoreText
scoreRemains.innerText = `Got ${theFinalText} out of ${MAX_QUESTIONS} questions`
finalScore.innerText = mostRecentScore + 1
finalScore.innerText = +mostRecentScore //+1

if (selectedIconEnd) {
navBox.classList.toggle(selectedIconEnd)
Expand Down
10 changes: 7 additions & 3 deletions html-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ fetch('questions.json')

htmlQuestions = loadedQuestions
MAX_QUESTIONS = htmlQuestions.length

startGame()

})

//GAME FUNCTIONS
Expand All @@ -53,8 +54,8 @@ const startGame = () => {
availableQuestions = [...htmlQuestions]
getNewQuestions()
game.classList.remove('hidden')

localStorage.setItem('avaliableQuestions', availableQuestions)

}

const getNewQuestions = () => {
Expand Down Expand Up @@ -120,6 +121,9 @@ const incrementScore = num => {

const incrementFinal = num => {
finalScore += num
if(htmlQuestions.length === htmlQuestions) {
finalScore++
}
console.log(finalScore)

}
Expand Down

0 comments on commit a1f8670

Please sign in to comment.