-
Notifications
You must be signed in to change notification settings - Fork 0
General Homework Feedback #1
Copy link
Copy link
Open
Description
Line 2 in bbd6f7e
| const choices = Array.from(document.querySelectorAll('.choice-text')) |
Rather than get all the answer
tags, you should get the answer containers themselves (choice-container) so whole div is clickable (at the moment you have to click on the text, not great UX)
Line 3 in bbd6f7e
| const progressText = document.querySelector('#question') |
I think you should have targeted #progressText here in order for this to work
Line 78 in bbd6f7e
| localStorage.getItem('mostRecentScore', score) |
You're never adding anything to localStorage so there will be nothing to get
Line 80 in bbd6f7e
| return window.location.assign('/index.html') |
This should bring us to a high-scores page
Line 108 in bbd6f7e
| let classToApply = selectedAnswer == currentQuestion.answer ? 'correct' : 'incorrect' |
selectedAnswer is a number and currentQuestion.answer is a string. You are comparing them so they will never be equal, hence classToApply will never be 'correct'. This is why a user never gets a correct answer (might have been better to compare the innerText of selectedChoice against currentQuestion.answer instead)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels