Skip to content

RoxanaTeodora/js-quiz-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I continued the js quiz that I did during Anjana Vakil's course, I added a new interactive style, progress bar and previous button

I made a deployment https://quiz-js-roxana-teodora.netlify.app/, was inspired by https://templates.seekviral.com/quiza/quiz/Quiz6/index.html and https://templates.seekviral.com/qzain/quiz/Quiz12/index.html

TODO 1: Declare & assign variables pointing to the corresponding element(s)

statement should be the "statement" div optionButtons should be all the elements within the "options" div explanation should be the "explanation" div

TODO 2: Declare & assign a variable called fact

Its value should be an object with a statement, true/false answer, and explanation

TODO 3: Set the text of the statement element to the fact's statement

TODO 4: Declare disable & enable functions to set or remove the "disabled" attribute from a given button element

disable(button) should set the button element's attribute "disabled" to the value "" enable(button) should remove the attribute "disabled" from the button element

TODO 5: Declare an isCorrect function that compares a guess to the right answer

isCorrect(guess) should return true if the guess matches the fact's answer

TODO 6A: Use a for loop to add a click event listener to each of the optionButtons

#TODO 6B: Within the event handler function, display the fact's explanation by setting the text of the explanation element

TODO 7: Within the event handler function,

Use a for loop to disable all the option buttons

TODO 8: Within the event handler function,

Get the guessed value from the clicked button Use a conditional to compare the guess to the fact's answer add the "correct"/"incorrect" class as appropriate

About

JavaScript Quiz using JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published