Skip to content

General Homework Feedback #1

@hynesy23

Description

@hynesy23

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)

const progressText = document.querySelector('#question')

I think you should have targeted #progressText here in order for this to work

localStorage.getItem('mostRecentScore', score)

You're never adding anything to localStorage so there will be nothing to get

return window.location.assign('/index.html')

This should bring us to a high-scores page

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions