Generate intelligent quizzes from any PDF document using AI Agents
A sophisticated quiz generation system that transforms PDF documents into educational assessments, leveraging AI agents to create high-quality multiple-choice and true/false questions with detailed explanations.
Quiz Generator is an AI-powered application built using CrewAI that automatically creates educational quizzes from PDF documents. The system employs specialized AI agents working together to extract content, generate questions, and provide comprehensive answer explanations. Perfect for educators, content creators, and students looking to create assessment materials or test their understanding of technical content.
demo.mp4
- π€ AI Agent-Powered: Utilizes specialized CrewAI agents for different aspects of quiz generation
- π PDF Processing: Extracts and processes text from PDF documents
- π§ Multiple Question Types: Generates both multiple-choice and true/false questions
- π Quiz Analysis: Provides detailed explanations for correct and incorrect answers
- π Quality Control: Ensures questions are relevant and pedagogically sound
- π₯οΈ User-Friendly Interface: Clean Streamlit web interface for easy interaction
- π± Responsive Design: Works across different screen sizes and devices
Quiz-Generator/
βββ __init__.py
βββ app.py # Streamlit web application
βββ requirements.txt # Project dependencies
βββ .gitignore # Git ignore file
βββ assets/ # Static assets
β βββ live_demo.mkv # Demo video
βββ config/ # Configuration files
β βββ __init__.py
β βββ agents.yaml # Agent definitions
β βββ config.py # Global settings
β βββ tasks.yaml # Task definitions
βββ data/ # Sample PDF documents
βββ output/ # Generated quiz JSON files
β βββ mcq_quiz.json # Multiple-choice questions
β βββ quiz_analysis.json # Detailed explanations
β βββ tf_quiz.json # True/false questions
βββ src/ # Core application code
β βββ __init__.py
β βββ crew.py # CrewAI agent setup
β βββ pydantic_models.py # Data models
β βββ quiz_pipeline.py # Main processing pipeline
β βββ utils.py # Helper functions
βββ .devcontainer/ # Development container config
βββ .vscode/ # VS Code settings
-
Clone the repository
git clone https://github.com/Fawzy-AI-Explorer/Quiz-Generator.git cd Quiz-Generator
-
Set up a virtual environment
python -m venv .venv # On Windows .\venv\Scripts\activate # On macOS/Linux source venv/Scripts/activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
Create a
.env
file in the project root with:PROVIDER=your_llm_provider MODEL=your_model_name BASE_URL=your_base_url TEMPERATURE=0.7
-
Start the Streamlit application
streamlit run app.py
-
Using the application
- Upload a PDF document through the web interface
- Click the "Generate Quiz" button
- Review generated multiple-choice and true/false questions
- Explore detailed explanations for each question
-
Running the pipeline directly
cd "Quiz generator" python -c "from src.quiz_pipeline import run_pipeline; run_pipeline('path/to/your/file.pdf')"
Contributions are welcome and appreciated! Here's how you can contribute:
-
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
Please ensure your code follows the project's coding style and includes appropriate tests.
This project is licensed under the MIT License - see the LICENSE file for details.
Thanks to all the amazing people who have contributed to this project!