Skip to content

utkarshjain45/Quiz-app

Repository files navigation

Quiz-app

My First React Project

GitHub Repo

Description

This is a simple quiz application built with React. It presents a series of multiple-choice questions with a timer, tracks the user's score, and displays the results at the end. The quiz also provides a feature to review the answered questions and their correctness.

Features and Functionality

  • Quiz Presentation: Displays questions with multiple-choice options.
  • Timer: Each question has a 30-second timer. If the time runs out, the quiz automatically moves to the next question.
  • Answer Selection: Allows users to select an answer for each question.
  • Navigation: Provides "Next" and "Previous" buttons for moving between questions. A "Skip" button allows skipping questions.
  • Progress Tracking: Displays the current question number and overall progress with a visual progress bar.
  • Results Display: Shows the final score and allows users to review their answers.
  • Closing Quiz: Implemented confirmation before closing the quiz to prevent accidental data loss. Attempts to close the window and falls back to reloading the page if window.close() fails.
  • Quiz Restart: Allows the user to restart the quiz from the results page.
  • Start Screen: Includes a start screen with quiz details and a button to begin the quiz.

Technology Stack

  • React: A JavaScript library for building user interfaces.
  • Vite: A build tool for fast development.
  • Tailwind CSS: A utility-first CSS framework.
  • Radix UI Primitives: For accessible UI components (specifically used in the Button component).
  • class-variance-authority: For styling React components with variants.
  • clsx: For conditionally joining class names.
  • tailwind-merge: For merging Tailwind CSS classes.

Prerequisites

  • Node.js (version >= 16)
  • npm

Installation Instructions

  1. Clone the repository:

    git clone https://github.com/utkarshjain45/Quiz-app.git
    cd Quiz-app
  2. Install dependencies:

    npm install

Usage Guide

  1. Start the development server:

    npm run dev

    This will usually start the application at http://localhost:5173/.

  2. Open the application in your browser.

  3. Click the "Start Quiz" button to begin.

  4. Answer the questions within the given time frame.

  5. Use the "Next" and "Previous" buttons to navigate through the questions.

  6. Once finished, the results will be displayed.

  7. You can restart the quiz from the results page. You can also close the quiz at any time using the "Close" button.

API Documentation

Not applicable, as this project does not use any external APIs. The quiz questions are stored locally in src/questions.js.

Contributing Guidelines

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with descriptive messages.
  4. Push your changes to your forked repository.
  5. Submit a pull request to the main repository.

License Information

No license specified. All rights are reserved by the author.

Contact/Support Information

For questions or support, please contact:

Utkarsh Jain - jainutkarsh096@gmail.com

About

My First React Project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors