A modern, full-stack web application for creating and taking quizzes online. Built with React.js frontend and Node.js backend.
- Create Quizzes: Build custom quizzes with multiple-choice questions
- Manage Questions: Add, edit, and remove questions with customizable marks
- Quiz Control: Open/close quizzes for student access
- View Results: See detailed student performance and statistics
- Dashboard: Manage all created quizzes from one place
- Take Quizzes: Attempt available open quizzes
- Real-time Scoring: Get instant results after submission
- Progress Tracking: View completed quizzes and scores
- One-time Submission: Prevent multiple attempts on the same quiz
- User-friendly Interface: Clean, intuitive quiz-taking experience
- React.js - User interface library
- React Router - Client-side routing
- Axios - HTTP client for API calls
- CSS3 - Styling and responsive design
- Node.js - Runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - Authentication and authorization
- bcrypt - Password hashing
Before running this application, make sure you have:
- Node.js (v14 or higher)
- npm or yarn
- MongoDB (local installation or MongoDB Atlas)
git clone <repository-url>
cd quizzycd server
npm installCreate a .env file in the server directory:
DATABASE_URL=mongodb://localhost:27017/quizzy
JWT_SECRETS=your_jwt_secret_key_here
PORT=3000Start the backend server:
npm startcd client
npm install
npm startThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3000/api
quizzy/
├── client/ # React frontend
│ ├── public/
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── App.js # Main app component
│ │ └── index.js # Entry point
│ └── package.json
├── server/ # Node.js backend
│ ├── controllers/ # Route controllers
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── middlewares/ # Custom middlewares
│ ├── config/ # Database configuration
│ ├── index.js # Server entry point
│ └── package.json
└── README.md
The application uses JWT (JSON Web Tokens) for authentication:
- Users register with email and password
- Passwords are hashed using bcrypt
- JWT tokens are stored in localStorage
- Protected routes require valid authentication
- Can create and manage quizzes
- View student results and statistics
- Control quiz availability (open/close)
- Can take available quizzes
- View their quiz history and scores
- Cannot retake completed quizzes
POST /api/auth/register- User registrationPOST /api/auth/login- User login
GET /api/quiz/- Get all quizzesGET /api/quiz/:id- Get specific quizPOST /api/quiz/create- Create new quiz (Teacher only)POST /api/quiz/:id/submit- Submit quiz answers (Student only)PATCH /api/quiz/:id/toggle-status- Toggle quiz status (Teacher only)
- Dynamic question addition with multiple-choice answers
- Customizable marks per question
- Real-time preview of created questions
- Form validation and error handling
- Question navigation with progress indicator
- Answer selection with visual feedback
- Submission confirmation and validation
- Automatic scoring and result display
- Detailed statistics for teachers
- Individual student performance tracking
- Score calculation with proper validation
- Responsive result display
Create .env files in both client and server directories:
Server (.env):
MONGODB_URI=your_mongodb_connection_string
JWT_SECRETS=your_secret_key
PORT=3000For support or questions, please create an issue in the repository.
Built with ❤️ using React.js and Node.js