ai-quizgenie

ai-quizgenie

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.).

AIAUTOMATIONApify

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

Frequently Asked Questions

Is it legal to scrape job listings or public data?

Yes, if you're scraping publicly available data for personal or internal use. Always review Websute's Terms of Service before large-scale use or redistribution.

Do I need to code to use this scraper?

No. This is a no-code tool — just enter a job title, location, and run the scraper directly from your dashboard or Apify actor page.

What data does it extract?

It extracts job titles, companies, salaries (if available), descriptions, locations, and post dates. You can export all of it to Excel or JSON.

Can I scrape multiple pages or filter by location?

Yes, you can scrape multiple pages and refine by job title, location, keyword, or more depending on the input settings you use.

How do I get started?

You can use the Try Now button on this page to go to the scraper. You’ll be guided to input a search term and get structured results. No setup needed!