How to Build a Quiz App using React (for Beginners)
HTML-код
- Опубликовано: 7 июн 2024
- In this video, we are gonna be building a Quiz app in React.js.
We are gonna add features like input answers and multiple-choice questions, questions with timers, tracking scores, fetching questions from external API, saving results, and creating a leaderboard. All of that and much more!
This workshop is ideal for beginners or someone who just started learning React.js. So together we can build your first app, and you will have a chance to improve your skills by building this simple but very useful app!
Mock API: 644982a3e7eb3378ca4ba471.mock...
Final app: sloba-react-quiz-app.netlify.app
🧿 I discussed:
✔️ How to build a Quiz App using React
✔️ How to add a timer to the Quiz app
✔️ How to add MCQ and input questions to Quiz
✔️ How to fetch questions for a Quiz from API
✔️ How to create a score leaderboard for a Quiz
✔️ How to build and deploy the Quiz app
0:00 Intro
0:53 Project setup
7:35 Building Quiz component
57:25 Building and deploying the Quiz app
58:30 Project refactoring
1:04:00 Building Quiz timer
1:29:48 Adding input question type
1:39:12 Fixing the timer issue
1:42:32 Fetching Quiz questions from API
1:47:25 Building Quiz Leaderboard
2:14:04 Outro
************************************************************
👉 Patreon:
✔️ / codewithsloba
👉 Become a better developer with 2 minutes a day:
✔️codewithsloba.com
👉 Linkedin:
✔️ / slobodan-gajic
👉 Instagram:
✔️ / codewithsloba
This tutorial was awesome.
Great work.
Thank you 🙏
Just a quick point: babel is actually a JS transpiler instead of compiler (i.e transpile the lastets version of JS to the compatible JS version, usually ES5 ). But thanks for the effort and sharing this video, though!
I love it 😍 great point
Thanks for sharing 😊😊
It’s my pleasure
Bro really awesome explanation bro
Thanks I appreciate it!
Nice tutorial for learning code. Fixing the timer issue part would have been nice to see on screen what is going on.
Yes sorry for that issue. It was just matter of changing the css animation to 0.1s, and changing the counter increase by 100 instead of 1000 ms. Then you can remove timeout from onTimeUp function
Great guide thank you! is it possible to have a tutorial on how to also test the code?
Yes I'll add that one
🙏👍
thanks
im following along exactly and still getting different outcomes. why at 23:20 does your page say 167 at the top? mine does not and doesnt show 1/5 after you make more changes. can you explain what parts of your code would display the 167? thank you
Can you compare the final code?
@@CodewithSloba your final code does not work
you have errors in spelling in your final code and random semi colons where they shouldnt be
thanks I'll check
it has an issue.
If I selects a correct option and does not click next then it will be considered as wrong answer.
That's actually how I wanted it to behave. Next is like a submit button. But obviously you can change it
@@CodewithSloba what if I selects the correct option in last second and couldn't press next, it will be marked incorrect.
I don't think it's a good feature of a quiz platform 😕 🤔.
I request you to correct me if I am wrong.
@@vimal__dubey6646 To me you're just too late. You can increase time limit. It can go both ways
i had a problem when i filled input and click next, then i can click next on every questionwithout selected answer. I just needed to change disabled={}. This works for me in anyone else have a same problem:
disabled={(type === "FIB" && !inputAnswer) || (type !== "FIB" && answerIndex === null)}
Awesome solution
is the project on github ?
yes, check description
Very great. Thank you!
With timer bug, how about call clearTimeout on onTimeUp?
You can try that as well
The source code would be helpful
You have it on my patreon
Can you share the codes?
Code is available on my patreon
I found a bug in your 3D apple store tutorials please respond to my comment there
hey what's the bug
your way of writing css ... is just painful.
Source code would be helpful
there is on patreon, why it's painful?
@@CodewithSloba I'm not interested in the source code. Also, I'm not interested in supporting you. It's just bad CSS. That's it.
@@Faisal-qd1jcok I appreciate your feedback
@@Faisal-qd1jc Can you explain why the CSS is bad?