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.
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.
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
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 !
finally, this is what I'm looking for, to cure my laziness
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.
really excellent project for beginner like me. Thank u bro!
good vedio but inorder to change state in question we have to use useeffect
completed .waiting for next video of react JS
Great! Please check this React Project playlist: th-cam.com/play/PLjwm_8O3suyMMs7kfDD-p-yIhlmEgJkDj.html
Excellent 👍
useRef(0) while initialisation of Option(s) at 30:45
It didn't work o
why you use js instead of js + swc? can you explain this
Thank a ton:)
Do you have a report and source code for this I have to make this for my college mini project?
Great tutorial, thanks!
Am the first to like on this helpful video. Please give me likes. ❤❤❤
thanks a lot bro, greetings from Argentina
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.
very easy to understand thank u so much
Can anyone explain how he chosen correct and wrong option ?
which theme are you using in vs code
The code is not working for correct answer color and wrong answer color
Import UseRef and UseState
why doesn't it work if I put npm ? What should I do?
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...
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? ;-;
Thank you so much sir
Perfect
Thank you brother ♥
33:03
Luv u brother❤
Thanks bro, Glad you liked this react project
Awesome tutorial.
Thanks ❤️
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
Happy I saw this early. Thanks man
Glad you liked this React Quiz app tutorial
Error . useRef is not defined 😢
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.
Your tutorial are very helpful❤🇵🇰. Also make more content on react and next js
23:00
Nice video
Glad you liked it. 😊
how intresting if we you create in tsx
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
thanks for this video. please provide at least css source code it will help us to save time
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
Thanks
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
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
How to make silent exploit using javascript
36:27
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
can anyone provide me the Quiz.jsx code
Give me the Code
Please🥺🥺
Pchool nachooy
bhai source code dete to accha hota
I need all your code
How can I contact you
I want to talk to you regarding business purpose, how should I contact you...