In this video I will be breaking down the entire process of building a quiz application using JavaScript. We will also be styling the entire application using modern styling practices. This video will not only teach you how to build a quiz application, but it will breakdown the steps you need to take when building any project.
We will be using modern JavaScript best practices to create this application. We will also be using CSS variables to make changing our site on demand incredibly easy. By the end of this video you will have an entire quiz application built which can be easily extended and customized.
๐ Materials/References:
CSS Box Model Explained: https://youtu.be/rIO5326FgPE
GitHub Code: https://github.com/WebDevSimplified/JavaScript-Quiz-App
CodePen Code: https://codepen.io/WebDevSimplified/pen/xNvaaz
๐ง Concepts Covered:
– How to dynamically show/hide elements
– How to remove child elements
– Array randomization
– Who the best YouTuber is ๐
– CSS variables
๐ Find Me Here:
Twitter: https://twitter.com/DevSimplified
Discord: https://discord.gg/7StTjnR
GitHub: https://github.com/WebDevSimplified
CodePen: https://codepen.io/WebDevSimplified
#QuizApp #WDS #JavaScript
Original source
35 responses to “Build A Quiz App With JavaScript”
it says build a quiz app with javascript but then it did not work with javascript then i found out thats html that your using
too fast ,,it is a show of force and not a helpful tutorial
I won't allow commit of your javascript, no design pattern and architecture used, hard to maintain and extend your code here.
Though you doing great in other videos
Hey man thanks alot for the tutorial. I am a beginner and I don't really what to do since I don't have a strong computer however i have been going while watching you and my thing couldn't work since my PC is only 2 GB Ram and 32GB storage as well I don't have internet otherwise I do appreciate you what you do.
Were you late for something?
Hey, great channel. Youโve helped so much! Could you possibly help with advice/video for adding a score and a database for this quiz?
Thank you!
Do you have a blog ?
How to upload on website?
Hey man, I really appreciate your efforts, thank you! Im having a little trouble ans as a beginner I am following without full understanding so I often encounter problems; normally due to simple typos but this time I dont know what Ive done wrong. I'm follow till around 20:13 and I go to test and I get an error in the console of the browser saying: "Uncaught TypeError: Cannot read property 'appendChild' of null". from what I gather it means the button is undefined but I cant see any difference in the code. If anyone has any suggestions please help.
I keep looking at your face until I forget the lesson. Just kidding but you handsome is real , Thank you for this video
You are awesome, buddy
Thanks a lot this was an astonishing tutorial. But, am wondering how can I let it to collect all the correct answers and project a result in the end. Like, if all answers are correct, it will show a text. But, if the all the chosen answers were wrong, it will show an other text. Can you please tell me?
How did you get vs code to do the boilerplate with just the exclamation point and enter? Mine wont do that. I may have messed with the settings. Can anyone help?
Thanks for the tutorial.
For those who want to add the score counter try this…
1. Declare a global variable (let countRightAnswers = 0;)
2. At the bottom of the function called selectAnswer(e) add this:
if (selectedButton.dataset = correct) {
countRightAnswers++;
// +1, change it if you need +10, +25 etc
}
3. At function startGame() add:
countRightAnswers = 0; // to reset the counter after the test started
4. Add something in .html like:
<span id="right-answers"></span>
5. in function function selectAnswer(e) at the bottom add this:
document.getElementById('right-answers').innerHTML = countRightAnswers; // span will show the score
Just curious about one thing in the JS, when you use the dataset property to create a boolean instead of a string, how would you display that as a score tracker?…i.e (1/5, 20/25, etc..)
Thank You So much. You video are awsome
what app r u using to write the code
awesome video, thanks a lot !
hey i am getting error in this line [–hue: var(–hue-neutral);] can you please guide me how to fix it. ERROR: EXPECTED REBRACEat line14, col 2. i am not getting proper output just because of this error.
I need help really badly, how can i add to this quiz at the end a score or results please help!
I learned Array.sort() today.
hay que tener mucho cuidado con ortografia… me salia error en element linea 14 y el error era bajo en la pregunta 2+2 escribi mal question me falto la s = questions
Thank you so much for this effort ๐๐๐๐๐๐๐๐๐
Is there a way to also randomise the order in which the Answers are displayed?
I need help with disabling the group of buttons once the user makes a selection. Currently, the user can make as many selections as they want without any limitation. I've tried to disable the class assigned to the buttons after the selection was made but it either disabled the buttons altogether preventing any selection to be made or it simply didn't do anything at all and the user can still choose multiple answers per question.
thanks for sharing bro, btw, your brain runs just as fast as a computer.
keep up the good work,you got our full support
thanks.
answer should be dev ed lol
How to modify it so that there can be more than one correct answer in each question?
very nice. I'm trying to learn this right now, only implementing some jquery as well.
Very complex
thank you 100%
the question.question part was a bit confusing.
Hlo sir in my program doesn't support hue tag what can I do