How To Make A Quiz App In React JS | Build Quiz App Using HTML, CSS and React JS
HTML-код
- Опубликовано: 28 ноя 2023
- Learn How To Make A Quiz App In React JS | Build Quiz App React JS Project Step by Step.
❤️ SUBSCRIBE: @GreatStackDev
In this tutorial we will learn to make a quiz website or app using React JS. In this quiz app you can update your own questions and multiple options. This React JS Project Quiz app will display the score after submitting the answers for all questions.
Download the assets: drive.google.com/file/d/1UNqd...
👉 React Introduction Tutorial: • What Is React (React J...
👉 React Complete tutorial for Beginners: • React JS Tutorial For ...
#ReactJS #ReactJsTutorial #WebDevelopment #GreatStack
-------------------------------------
Build more React JS projects:
Complete Portfolio Website In React:
👉 • How To Make Portfolio ...
Build ChatGPT Clone In React:
👉 • Build ChatGPT In React...
Build AI Image Generator with OpenAI In React
👉 • Build An AI Image Gene...
Create Weather App In React
👉 • How To Create Weather ...
-------------------------------------
Recommended Videos:
Learn Complete HTML and CSS from basics:
► • HTML And CSS Tutorial ...
Make A Complete Website for college using HTML & CSS:
► • How To Make A College ...
How to make personal resume website step by step:
► • How To Make A Website ...
How to make an Ecommerce Website Design:
► • How To Make eCommerce ...
How to make travel website design with HTML CSS Bootstrap:
► • How To Make A Website ...
-------------------------------------
Connect with me:
👉 linktr.ee/iamavinashkr
Connect with GreatStack:
Instagram: / greatstackdev
Twitter: / greatstackdev
Facebook: / greatstack
Easy to understand and follow even for beginner. Thanks.
Thank you so much! You are so great at explanation!!! Thanks a lot !
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.
Great tutorial, thanks!
Thanks ❤️
Thank you brother ♥
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.
thanks a lot bro, greetings from Argentina
Excellent 👍
Perfect
Happy I saw this early. Thanks man
Glad you liked this React Quiz app tutorial
Luv u brother❤
Thanks bro, Glad you liked this react project
completed .waiting for next video of react JS
Great! Please check this React Project playlist: ruclips.net/p/PLjwm_8O3suyMMs7kfDD-p-yIhlmEgJkDj
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...
which theme are you using in vs code
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
good vedio but inorder to change state in question we have to use useeffect
Am the first to like on this helpful video. Please give me likes. ❤❤❤
Your tutorial are very helpful❤🇵🇰. Also make more content on react and next js
There is error appears after make option array it says expected an assignment or function call and instead saw an expression
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? ;-;
why doesn't it work if I put npm ? What should I do?
thanks for this video. please provide at least css source code it will help us to save time
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
Bro... I tried to do it but the Last question for is not allowing to choose option and move to next score page ? Please help
I tried it and it’s working.
You should recheck your code
how intresting if we you create in tsx
Can anyone explain how he chosen correct and wrong option ?
How to make silent exploit using javascript
For multiple li u can li*number of li u want
thanks for comment, it will help all viewers
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.
can we get the source code
can anyone provide me the Quiz.jsx code
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
Give me the Code
Please🥺🥺
Pchool nachooy
I need all your code
How can I contact you
I want to talk to you regarding business purpose, how should I contact you...