Skip to content

VPriya100code/Exam_paper_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ AI Exam Paper Generator

An AI-powered system that generates university-level exam question papers using modern AI techniques like RAG (Retrieval-Augmented Generation) and Agent-based logic.


πŸš€ Features

  • 🧠 Generate exam papers from syllabus input
  • 🎯 Difficulty control (Easy / Medium / Hard)
  • πŸ“ Automatic marks distribution (2, 5, 10 marks)
  • 🏫 Anna University-style question paper format
  • πŸ“Š Auto total marks calculation
  • πŸ“„ Export as PDF and DOCX
  • 🎨 Modern glassmorphism interface

🧠 How It Works

  1. User Input

    • Subject, syllabus, difficulty, marks pattern
  2. RAG (Retrieval-Augmented Generation)

    • Extracts relevant topics using FAISS
  3. AI Agent

    • Decides paper structure (sections & marks)
  4. LLM (Groq API)

    • Generates structured question paper
  5. Export Tools

    • Converts output to PDF and DOCX

πŸ›  Tech Stack

  • Frontend: Streamlit
  • Backend: Python
  • AI Model: Groq (Llama 3.1)
  • RAG: FAISS + SentenceTransformers
  • PDF: FPDF
  • DOCX: python-docx

πŸ“ Project Structure

exam_generator/
β”œβ”€β”€ app.py
β”œβ”€β”€ config.py
β”‚
β”œβ”€β”€ rag/
β”‚   └── rag_engine.py
β”‚
β”œβ”€β”€ agent/
β”‚   └── planner.py
β”‚
β”œβ”€β”€ llm/
β”‚   └── generator.py
β”‚
β”œβ”€β”€ tools/
β”‚   β”œβ”€β”€ pdf_tool.py
β”‚   └── docx_tool.py
β”‚
β”œβ”€β”€ .env
└── requirements.txt

βš™οΈ Installation & Setup

1. Clone the Repository

git clone https://github.com/yourusername/ai-exam-generator.git
cd ai-exam-generator

2. Create a Virtual Environment

python -m venv venv
venv\Scripts\activate   # Windows

3. Install Dependencies

pip install -r requirements.txt

4. Add Your API Key

Create a .env file in the root directory: GROQ_API_KEY=your_api_key_here

5. Run the Application

streamlit run app.py

🎯 Usage

  1. Enter subject and syllabus
  2. Select difficulty level and total marks
  3. Provide exam details (year, time, duration)
  4. Click Generate Question Paper
  5. Download as PDF or DOCX

πŸ† Key Highlights

  • πŸ€– Combines RAG + Agent + LLM for intelligent generation
  • πŸ“š Real-world education use case
  • πŸ—οΈ Clean and scalable architecture
  • 🎨 Interactive UI with modern design

πŸ”’ Security Note

  • .env file is excluded from version control via .gitignore
  • API keys are never exposed in the codebase

πŸ‘©β€πŸ’» Author

Priyadharshini V
Computer Science Engineering Student


⭐ Future Improvements

  • πŸ“Š Question difficulty tuning slider
  • 🧠 Save & history of generated papers
  • 🌐 Deploy as a web app
  • πŸ”Š Voice-based input

About

πŸ“ƒAn AI-powered system that generates university-level exam question papers using modern AI techniques like RAG (Retrieval-Augmented Generation) and Agent-based logic.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages