ai-quizgenie avatar

ai-quizgenie

Try for free

No credit card required

Go to Store
ai-quizgenie

ai-quizgenie

bala-ceg/ai-quizgenie
Try for free

No credit card required

ai-quizgenie is an Apify Actor that extracts content from webpages and PDFs to generate multiple-choice quiz questions (MCQs) using LLMs (GPT-3.5, GPT-4, etc.).

Developer
Maintained by Community

Actor Metrics

  • 3 Monthly users

  • No reviews yet

  • No bookmarks yet

  • 43% runs succeeded

  • Created in Mar 2025

  • Modified 2 days ago

AI Quiz Genie – Generate AI-Powered Quizzes

ai-quizgenie is an Apify Actor that extracts content from webpages and PDFs to generate multiple-choice quiz questions (MCQs) using LLMs (GPT-3.5, GPT-4, etc.).

Supports Web & PDF Extraction
Dynamic Model Selection (GPT-3.5, GPT-4, etc.)
LangGraph for Workflow Automation
Apify-Compatible for Deployment


📂 Project Structure

1/ai-quizgenie/
2│── src/
3│   ├── __main__.py       # Executes main.py
4│   ├── main.py           # Apify Actor Execution and Langgraph flow
5│   ├── tools.py          # Web & PDF Extraction
6│   ├── utils.py          # Quiz Generation Logic
7│   ├── models.py         # Pydantic Schema
8│── dataset_schema.json   # Defines Output Format
9│── requirements.txt      # Python Dependencies
10│── Dockerfile            # Containerized Deployment
11│── input.json            # Example Input
12│── README.md             # Documentation

🛠 Installation & Setup

1️⃣ Clone the Repository

1git clone https://github.com/yourusername/ai-quizgenie.git
2cd ai-quizgenie

2️⃣ Install Dependencies

pip install -r requirements.txt

3️⃣ Set API Keys (Optional)

If using OpenAI, set your API keys:

1export OPENAI_API_KEY="your-api-key-here"
2export OPENAI_API_BASE="your-base-url"

🚀 Running the Actor Locally

Run with Sample Input

apify run -i input.json

Example input.json

1{
2    "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
3    "num_questions": 5,
4    "difficulty": "Medium",
5    "model": "gpt-4-turbo"
6}

🔧 How It Works

  1. Extracts content from webpage/PDF
  2. Uses LLM to generate quiz questions
  3. Outputs structured MCQs in JSON format

📜 Example Output (dataset_schema.json)

1{
2    "model": "gpt-4-turbo",
3    "questions": [
4        {
5            "question": "Who is considered the father of AI?",
6            "options": ["Alan Turing", "John McCarthy", "Geoffrey Hinton", "Yann LeCun"],
7            "answer": "John McCarthy",
8            "explanation": "John McCarthy coined the term 'Artificial Intelligence' in 1956."
9        }
10    ]
11}

📦 Deploying to Apify

1️⃣ Push to Apify

apify push

2️⃣ Run on Apify Cloud

apify call ball-ceg/ai-quizgenie -i input.json

📜 Customization

  • Modify input.json to change the difficulty, number of questions, or LLM model
  • Edit utils.py to tweak the quiz generation prompt
  • Extend graph.py to add more processing steps

🤝 Contributing

Want to improve AI QuizGenie? Open a PR or suggest features! 🚀


Apify Screenshots

Screenshot 2025-03-07 at 9 43 06 PM
Screenshot 2025-03-07 at 9 39 04 PM
Screenshot 2025-03-07 at 9 41 08 PM