MCQ Generator is a Flask-based web application that generates interactive multiple-choice questions (MCQs) from PDF documents using natural language processing (spaCy). Users can upload PDFs, automatically generate exam-style questions, take the quiz in a modern interface, and review results with accuracy and performance breakdowns.
- 📄 PDF Upload → Drag & drop or select PDF documents (up to 500MB)
- 🧠 MCQ Generation → Creates multiple-choice questions using spaCy NLP
- 📝 Interactive Exam → Timer, progress bar, and question navigation
- 📊 Detailed Results → Score, accuracy, time taken, and review of answers
- 📱 Responsive UI → Works smoothly on desktop & mobile
- Backend: Flask (Python)
- NLP: spaCy (
en_core_web_sm) - PDF Processing: PyPDF2
- Frontend: HTML, CSS, JavaScript (served via Flask)
- Deployment: Render (free tier)
git clone https://github.com/Falguni35/mcq-generator.git
cd mcq-generatorpip install -r requirements.txtpython scripts/install_spacy_model.pypython app.pyOpen your browser and go to http://localhost:5000
- Upload PDF: Select a PDF document containing the material you want to study
- Set Parameters: Choose the number of MCQ questions (1-20)
- Generate Questions: The system uses NLP to extract key concepts and create multiple choice questions
- Take Exam: Answer the questions in an interactive exam interface
- Review Results: See your score and review correct/incorrect answers
The MCQ generator uses advanced NLP techniques to:
- Extract named entities (people, organizations, dates, etc.)
- Identify key phrases and concepts
- Create fill-in-the-blank questions
- Generate plausible distractors (wrong answers)
- Assess question difficulty levels
GET /: Main application interfacePOST /generate_questions_from_pdf: Generate MCQs from uploaded PDF
- Maximum file size: 500MB
- Question range: 1-20 questions
- Supported formats: PDF only
- Required: spaCy English model (
en_core_web_sm)
## 📂 Project Structure
mcq-generator/
├── app.py # Main Flask application
├── mcq_generator.py # Core MCQ generation logic
├── install_spacy_model.py # Script to install spaCy English model
├── requirements.txt # Python dependencies
├── Procfile # Deployment start command (for Render/Heroku)
├── README.md # Project documentation
└── __pycache__/ # Auto-generated cache
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you encounter any issues or have questions, please open an issue on GitHub.