Why do you need two separate ternary operators that only have one half filled in? Why does it not work if you combine the two separate ternary operators into a single one?
How do I add a menu at the beginning where I could choose from different quiz categories? I tried to add it with Chat GPT but it was not able to fix it. Help? ;-;
Bhai me jab yeh simple sa bana rha tha muje 3 hours lag gye aur kuch bhi nahi bana . Bro logic hi nhi bann par rha tha . Bhai bahut demotivate ho jaata hu ek basic sa project nahi bann pata lekin jab koi videos dekhta hu toh pata lagta ha kitna basic logic tha me kyu nahi kr paaya
Sabse pehle dekh dekhkar hi banao, phir code ko samjho, pura logic, code flow, kaise kya ho raha hai. Uske baad khud se try karo bina dekhe, try karte raho jab tak bann nahi jata
Easy to understand and follow even for beginner. Thanks.
What an amazing explanation sir! Waiting for more videos on full stack dev projects. Thank you :)
Thank you so much.
Thank you so much! You are so great at explanation!!! Thanks a lot !
really excellent project for beginner like me. Thank u bro!
You can use the result ternary operator only one time. Instead of returning empty div while result is true ,you can return the score and reset button
For opening development server in browser, you can also just press 'o' and it will open in browser
I will try this shortcut, thanks for comment.
Thanks, really helped me understand different hooks in React
Excellent tutorial. but one good practice but not that much important , we can add setLock(true) after lock===false line, no need to repeat it.
Great tutorial: 10 out of 10! Many thanks.
useRef(0) while initialisation of Option(s) at 30:45
It didn't work o
Am the first to like on this helpful video. Please give me likes. ❤❤❤
Great tutorial, thanks!
thanks a lot bro, greetings from Argentina
Excellent 👍
finally, this is what I'm looking for, to cure my laziness
very easy to understand thank u so much
Why do you need two separate ternary operators that only have one half filled in? Why does it not work if you combine the two separate ternary operators into a single one?
You don't need 2 ternary operators, it works completely fine with one ternary operator.
i am curious. how you can determined the ans just by the number?
Nice to explain, Thanks
completed .waiting for next video of react JS
Great! Please check this React Project playlist: ruclips.net/p/PLjwm_8O3suyMMs7kfDD-p-yIhlmEgJkDj
33:03
Luv u brother❤
Thanks bro, Glad you liked this react project
The code is not working for correct answer color and wrong answer color
Import UseRef and UseState
Happy I saw this early. Thanks man
Glad you liked this React Quiz app tutorial
good vedio but inorder to change state in question we have to use useeffect
There is error appears after make option array it says expected an assignment or function call and instead saw an expression
Hey, did you ever figure out how to fix it I'm having the same problem.
Salam bro you're the best thanks for your help.
Please can you make us one video About Contact js and search js for our website...
Do you have a report and source code for this I have to make this for my college mini project?
why you use js instead of js + swc? can you explain this
How do I add a menu at the beginning where I could choose from different quiz categories? I tried to add it with Chat GPT but it was not able to fix it. Help? ;-;
which theme are you using in vs code
Thanks ❤️
Your tutorial are very helpful❤🇵🇰. Also make more content on react and next js
Thank you so much sir
Thank you brother ♥
why doesn't it work if I put npm ? What should I do?
Can anyone explain how he chosen correct and wrong option ?
23:00
Awesome tutorial.
Awesome App!
Do you share app code ? I looked google drive. I can see only questions.
there is my code bro:
import { useState } from "react";
import "./Quiz.css";
import { data } from "../../assets/data";
const Quiz = () => {
let [index, setIndex] = useState(0);
let [questions, setQuestions] = useState(data[index]);
let [lock, setLock] = useState(false);
let [score, setScore] = useState(0);
let [result, setResult] = useState(false);
const openCorrect = (index) => {
document.querySelectorAll("li")[index - 1].classList.add("correct");
};
const checkAns = (e, ans) => {
if (lock === false) {
if (questions.ans === ans) {
e.target.classList.add("correct");
setScore((prev) => prev + 1);
} else {
e.target.classList.add("wrong");
openCorrect(questions.ans);
}
setLock(true);
}
};
const clearAns = () => {
document.querySelectorAll("li").forEach((li) => {
li.classList = "";
});
};
const next = () => {
if (index === data.length - 1) {
setResult(true);
return;
}
if (lock === true) {
clearAns();
setIndex(++index);
setQuestions(data[index]);
setLock(false);
}
};
const reset = () => {
setIndex(0);
setQuestions(data[0]);
setScore(0);
setLock(false);
setResult(false);
};
return (
Quiz App
{result ? (
You scored {score} out of {data.length}
Reset
) : (
{index + 1}. {questions.question}
{
checkAns(e, 1);
}}
>
{questions.option1}
{
checkAns(e, 2);
}}
>
{questions.option2}
{
checkAns(e, 3);
}}
>
{questions.option3}
{
checkAns(e, 4);
}}
>
{questions.option4}
Next
{index + 1} of {data.length} questions
)}
);
};
export default Quiz;
@@volkan9799 Thanks this helped me
Thank a ton:)
how the correct answer just user number like 1, 5 4, and 2
what if .. I don't want to add the next button. it atomically switch to the next question when any answer I selected … please help
Where have source code for this project ?
Please send me an email, will send you the source code.
@@GreatStackDev i send but email is not send in comment
why we using let instead of const
36:27
Bhai me jab yeh simple sa bana rha tha muje 3 hours lag gye aur kuch bhi nahi bana . Bro logic hi nhi bann par rha tha . Bhai bahut demotivate ho jaata hu ek basic sa project nahi bann pata lekin jab koi videos dekhta hu toh pata lagta ha kitna basic logic tha me kyu nahi kr paaya
Bare problem ko chote chote problem me break karo fir un chote problem ko solve karne ki kosish karo.
Sabse pehle dekh dekhkar hi banao, phir code ko samjho, pura logic, code flow, kaise kya ho raha hai. Uske baad khud se try karo bina dekhe, try karte raho jab tak bann nahi jata
Perfect
how intresting if we you create in tsx
Error . useRef is not defined 😢
can we get the source code
For multiple li u can li*number of li u want
thanks for comment, it will help all viewers
thanks for this video. please provide at least css source code it will help us to save time
Nice video
Glad you liked it. 😊
can anyone provide me the Quiz.jsx code
How to make silent exploit using javascript
Thanks
we need your github page plse
I need all your code
Give me the Code
Please🥺🥺
Pchool nachooy
Why you don't give source code with project?😅
All source code is provided to those who join this channel 🧑💻
@@idevkr which channel???
@@zaynindiafans8503 youtube channel join button
@@zaynindiafans8503 definitely not the channel which posted this video
bhai source code dete to accha hota
How can I contact you
I want to talk to you regarding business purpose, how should I contact you...