This project is a quiz application built with React. The application allows users to start a quiz, answer questions within a time limit, and view their results at the end.
- Start the quiz by clicking the "Teste Başla" button.
- 10 questions with multiple-choice answers.
- Each question has a 30-second time limit; if unanswered, it automatically moves to the next question.
- Displays quiz results with correct and incorrect answers at the end.
- Summary of all answers with details on whether the selected answer was correct or incorrect.
- React
- JavaScript (ES6+)
- CSS
To run this project locally, follow these steps:
- Node.js (v14 or higher)
- npm (v6 or higher)
-
Clone the repository:
git clone https://github.com/deerborg/Question_App.git cd react-quiz-app -
Install the required dependencies:
npm install
-
Start the development server:
npm start
-
Open your browser and visit
http://localhost:3000to view the quiz application.
- src/components/Start.js: The starting component of the quiz. Contains the start button and initial instructions.
- src/components/question/Question.js: Handles the main quiz logic, including displaying questions, handling user answers, managing the timer, and showing results.
- src/questions.js: A list of all questions, options, and correct answers for the quiz.
- Click on the "Teste Başla" button to start the quiz.
- Answer each question by clicking on the appropriate option. You have 30 seconds for each question.
- If you don't answer within 30 seconds, the quiz automatically moves to the next question.
- At the end of the quiz, a summary will be displayed with your correct and incorrect answers.
You can modify the quiz by editing the questions.js file:
const questions = [
{
question: "Sample question?",
options: ["Option A", "Option B", "Option C", "Option D"],
answer: "Option A",
media: "image.jpg", // Add media files in the `public/assets` folder
},
// Add more questions as needed
];
export default questions;- Add or remove questions by modifying the
questionsarray. - Replace
mediawith your images or media files located in thepublic/assetsfolder.