Skip to content

Rohit72099/MCQ-Form-Django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCQ Quiz (Django)

A beautiful, professional, responsive multiple-choice quiz (MCQ) app built with Django 5 and Bootstrap 5. Supports single/multi-select questions, instant scoring, and detailed results with a modern UI and light/dark theme toggle.

Features

  • Single and multiple-answer questions
  • Instant scoring with per-question correctness breakdown
  • Modern responsive UI (Bootstrap 5 + custom CSS)
  • Light/Dark theme toggle with local storage
  • Admin interface for managing quizzes/questions/choices
  • Sample data seeding command

Quickstart (Windows / PowerShell)

  1. Create/activate virtual environment:
cd "C:\Users\Rohit Kumar\Desktop\Mcq-Form Django"
python -m venv .venv
.venv\Scripts\Activate.ps1

If activation is blocked:

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -Force
.venv\Scripts\Activate.ps1
  1. Install dependencies:
python -m pip install --upgrade pip
python -m pip install django==5.0.6
  1. Apply migrations and seed sample quiz:
python manage.py migrate
python manage.py seed_quiz
  1. Run the development server:
python manage.py runserver

Open http://localhost:8000 in your browser.

Admin (optional)

Create a superuser to manage quizzes:

python manage.py createsuperuser

Then visit http://localhost:8000/admin

Project Structure

Mcq-Form Django/
├─ mcqsite/                # Project settings/urls
├─ quiz/                   # App with models, views, admin, urls
│  ├─ management/commands/ # seed_quiz command
│  └─ migrations/
├─ templates/
│  └─ quiz/
│     ├─ home.html
│     ├─ quiz_detail.html
│     └─ result.html
├─ static/
│  ├─ css/quiz.css
│  └─ js/theme.js
├─ manage.py
└─ README.md

Customization

  • Add/edit quizzes in the admin or via the seed_quiz command
  • Theming: tweak static/css/quiz.css and static/js/theme.js
  • Templates: templates/quiz/*.html
  • Models: quiz/models.py (supports question order and single/multi types)

Common Issues

  • Template logic: prefer Django filters/tags like yesno and {% if %}
  • Port in use: python manage.py runserver 8001
  • Static not loading in dev: ensure DEBUG=True and STATIC_URL configured

Deploy Notes (summary)

  • Set DEBUG=False, configure ALLOWED_HOSTS
  • Serve static via collectstatic and a proper web server (e.g., Nginx)
  • Use a production DB (e.g., Postgres) and WSGI/ASGI server (gunicorn/uvicorn)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published