/**
- Navigate to the app directory:
cd app - Install dependencies and start the dev server:
npm install npm run dev
- Navigate to the backend directory:
cd backend - Install dependencies:
pip install -r requirements.txt
- Start the Flask server:
python app.py or venv/Scripts/python app.py
If you encounter issues, use a virtual environment:
python --version
python -m venv venv
source venv/Scripts/activate # On Windows: venv\Scripts\activate
pip install google-generativeai flask flask-cors sentence-transformers reportlab python-docx mysql-connector-python
python app.py
pip freeze > requirements.txtYour app will be running locally once both servers start.
Intelligent, automated question paper generation powered by AI and Bloom's Taxonomy alignment.
QPG Flow is an intelligent question paper generation platform that eliminates manual paper creation. Teachers and examiners input a syllabus, specify parameters, and AI instantly generates balanced, high-quality question papers with zero repetitionβeach paper is unique, difficulty-scaled, and aligned with Bloom's Taxonomy cognitive levels.
The platform automates:
- Intelligent question generation using NLP & AI
- Bloom's Taxonomy alignment (Remember β Understand β Apply β Analyze β Evaluate β Create)
- Balanced difficulty distribution (Easy, Medium, Hard)
- Format variety (MCQ, Short-answer, Case-based, Essay)
- Automatic answer key generation with evaluation rubrics
- PDF export of complete papers
Educational institutions face several pain points:
- Manual, time-consuming paper creation (hours/days per paper)
- Question repetition across exams (compromising exam integrity)
- Inconsistent difficulty scaling and cognitive level distribution
- No systematic rubrics for evaluation
- Limited customization options for different courses/levels
QPG Flow addresses these by:
- β Reduce creation time from hours to minutes
- β Guarantee zero question repetition using AI deduplication
- β Automatic Bloom's Taxonomy alignment for cognitive rigor
- β Balanced difficulty distribution matching exam requirements
- β Multi-format support (MCQ, subjective, case-based, etc.)
- β Generate complete evaluation rubrics automatically
- β Secure, role-based access for institutions
- Framework: React 18, Vite (dev server)
- Routing: React Router v6
- Authentication: Firebase (Email/Password + Google Sign-In)
- Styling: Tailwind CSS + custom CSS
- State Management: React Context API
- Validation: HTML5 form validation
- Framework: Flask (Python)
- Server: Gunicorn (production)
- Database: Supabase (PostgreSQL)
- AI/NLP: Groq API (Llama 3.3-70B for generation)
- PDF Generation: ReportLab
- API: REST with CORS enabled
- Environment: Python 3.8+
- Frontend Hosting: Vercel / Docker
- Backend Hosting: Render / Docker
- Containerization: Docker & Docker Compose
- CI/CD: GitHub Actions
- Version Control: Git + GitHub
Backend: flask, flask-cors, groq, supabase, reportlab, python-dotenv, gunicorn
Frontend: react, react-router-dom, firebase
Papers consist of:
- Metadata: Subject, teacher, department, class, semester, exam type
- Sections: Multiple configurable sections with:
- Question count & marks per question
- Bloom's cognitive level
- Difficulty (Easy/Medium/Hard)
- Question format (MCQ/Subjective/Case-based)
- Attempt rules (Attempt All / Attempt X of Y)
- Auto-generated: Answer keys, scoring rubrics, difficulty metrics
User Input (Syllabus + Parameters)
β
AI Question Generation (Groq API)
β
Deduplication & Quality Check
β
Bloom's Taxonomy Alignment
β
PDF Compilation (ReportLab)
β
Download & Archive
- Node.js 16+ & npm
- Python 3.8+
- Git
git clone https://github.com/your-username/qpg-flow.git
cd qpg-flowcd backend
pip install -r requirements.txt
# Create .env file
cat > .env << EOF
GROQ_API_KEY=your_groq_api_key
SUPABASE_URL=your_supabase_url
SUPABASE_SECRET_KEY=your_supabase_secret
FLASK_ENV=development
FLASK_DEBUG=True
EOF
# Start server
python app.py
# Runs on http://localhost:5000cd app
npm install
# Create .env file
cat > .env << EOF
VITE_FIREBASE_API_KEY=your_firebase_key
VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_API_URL=http://localhost:5000
EOF
# Start dev server
npm run dev
# Runs on http://localhost:3000# From project root
docker-compose up
# Frontend: http://localhost:3000
# Backend: http://localhost:5000Complete Workflow:
-
Login β Sign up with email or Google
-
Dashboard β Go to
/dashboard -
Step 1 - Setup:
- Enter subject, class, department
- Paste syllabus content
- Specify total marks
- Choose paper type
-
Step 2 - Create Sections:
- Add sections (A, B, C, etc.)
- Configure each section:
- Question count & marks
- Bloom's level
- Difficulty
- Format (MCQ/Short/Case Study)
- Attempt rules
-
Step 3 - Generate:
- AI generates questions matching configuration
- View live progress
- System validates total marks
-
Step 4 - Preview:
- Review paper layout
- Check answer keys
- Edit if needed
-
Step 5 - Export:
- Download PDF (paper + answers + rubric)
- Share with students
- Archive for records
- View assigned papers
- Attempt papers with timer
- View answers after submission
- Monitor usage analytics
- Manage institutions
- Configure AI settings
- Groq LLM for high-quality content
- Context-aware based on syllabus
- Automatic difficulty scaling
- Zero repetition guarantee
All 6 cognitive levels:
- Remember (Recall facts)
- Understand (Explain concepts)
- Apply (Use knowledge)
- Analyze (Break down topics)
- Evaluate (Make judgments)
- Create (Generate new ideas)
- Multiple formats: MCQ, Subjective, Case-based, Essay
- Unlimited sections: Create custom paper structure
- Auto-validation: Ensure marks match total
- Attempt rules: Selective or mandatory questions
- Secure email/password login
- Google Sign-In integration
- Persistent sessions
- Role-based access
- Formatted PDF papers (academic style)
- Automatic answer keys
- Scoring rubrics
- Print-ready design
npm install -g vercel
cd app
vercel
# Connect GitHub and deploy- Create account at render.com
- Create Web Service
- Connect GitHub repo
- Build Command:
pip install -r requirements.txt - Start Command:
gunicorn app:app - Environment Variables:
GROQ_API_KEY=<your_key> SUPABASE_URL=<your_url> SUPABASE_SECRET_KEY=<your_key> FLASK_ENV=production FLASK_DEBUG=False - Deploy
β οΈ Important: Always setFLASK_DEBUG=Falsein production (security)
qpg-flow/
βββ app/ # React Frontend
β βββ src/
β β βββ components/
β β β βββ landing/
β β β βββ dashboard/
β β β βββ ProtectedRoute.jsx
β β βββ pages/
β β β βββ Landing.jsx
β β β βββ Login.jsx
β β β βββ Signup.jsx
β β β βββ Dashboard.jsx
β β βββ config/
β β β βββ firebase.js
β β β βββ authUtils.js
β β βββ context/
β β β βββ AuthContext.jsx
β β βββ main.jsx
β βββ package.json
β βββ vite.config.js
β
βββ backend/ # Flask Backend
β βββ app.py
β βββ db.py
β βββ generators/
β β βββ question_generator.py
β β βββ answer_generator.py
β β βββ paper_builder.py
β βββ routes/
β β βββ subjects.py
β β βββ paper.py
β β βββ answers.py
β βββ utils/
β β βββ bloom_classifier.py
β β βββ pdf_builder.py
β β βββ similarity_checker.py
β βββ requirements.txt
β βββ Dockerfile
β
βββ notebooks/ # ML Experiments
β βββ gemini_testing.ipynb
β
βββ docker-compose.yml
βββ README.md
POST /api/papers Generate new paper
GET /api/papers/:id Get paper details
POST /api/generate AI generation
GET /api/subjects List subjects
POST /api/export/pdf Export as PDF
GET /api/answers/:paper_id Get answer key
See AUTHENTICATION_SETUP.md for Firebase auth details.
| Issue | Solution |
|---|---|
ModuleNotFoundError: supabase |
pip install -r requirements.txt |
| Firebase not initialized | Verify VITE_FIREBASE_* in .env |
| Port 3000/5000 in use | Change port or kill process |
| PDF not generating | Check ReportLab: pip install reportlab |
| AI responses repetitive | Increase Groq temperature (0.7 β 0.9) |
Contributions welcome! Please:
- Fork repository
- Create feature branch:
git checkout -b feature/your-feature - Commit changes:
git commit -m 'Add feature' - Push:
git push origin feature/your-feature - Open Pull Request
- π Bug fixes
- β¨ New question formats
- π Analytics
- π¨ UI/UX improvements
- π Documentation
MIT License - see LICENSE file for details
Made with β€οΈ for educators worldwide π