AI Quiz Crafter avatar

AI Quiz Crafter

Pricing

from $7.00 / 1,000 results

Go to Apify Store
AI Quiz Crafter

AI Quiz Crafter

AI-powered quiz generator that creates fact-checked multiple-choice and short-answer questions on any topic. Supports easy, medium, and hard difficulty with a built-in AI review pass. Exports clean, validated JSON for e-learning, trivia apps, and training assessments.

Pricing

from $7.00 / 1,000 results

Rating

0.0

(0)

Developer

Inus Grobler

Inus Grobler

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Share

AI Quiz Generator — Create Multiple Choice & Short Answer Questions Instantly

Generate structured, fact-checked quizzes on any topic in seconds using AI. This Apify Actor calls a large language model via OpenRouter to produce ready-to-use quiz questions — complete with answer options, correct answers, ideal answers, and explanations — exported as clean JSON.

Perfect for building e-learning platforms, trivia apps, training assessments, revision tools, and automated test sets.


Features

  • 🧠 Multiple question formats — multiple-choice (4 options + correct answer) and short-answer (ideal answer for grading), both with explanations
  • 🎯 Adjustable difficulty — Easy, Medium, or Hard. Hard difficulty actively filters and rewrites any questions that aren't genuinely challenging via a two-pass AI review
  • Two AI tiers — Standard (cost-effective) and Premium (faster, higher accuracy)
  • Validated output — every response is validated with Pydantic before being saved; failed batches are retried automatically
  • 🔄 Smart batching — large quizzes are split across multiple API calls to avoid token limits
  • 📦 Clean JSON dataset — flat, camelCase records ready to export as CSV, JSONL, or connect via the Apify API

Inputs

FieldTypeDefaultDescription
topicStringWhat the quiz is about. Be specific"Causes of World War I" gives far better results than "History".
total_questionsInteger10Total questions to generate. Min: 1, Max: 100.
multiple_choice_countInteger7How many questions should be multiple-choice. The rest will be short-answer. Must not exceed total_questions.
difficultySelectmediumeasy · medium · hard. On medium/hard, a second AI pass reviews and rewrites any under-difficulty questions.
quality_tierSelectstandardstandard (OpenAI GPT-4o Mini) or premium (Gemini 2.5 Flash Lite). Premium adds a small per-question charge.

Example Input

{
"topic": "The causes and key events of World War I",
"total_questions": 20,
"multiple_choice_count": 14,
"difficulty": "hard",
"quality_tier": "premium"
}

Output

Each dataset item is one quiz question. Multiple-choice and short-answer questions share the same flat schema — type-specific fields are null when not applicable.

Multiple-Choice Example

{
"questionNumber": 1,
"type": "multiple_choice",
"question": "Which event directly triggered the outbreak of World War I?",
"options": [
"The assassination of Archduke Franz Ferdinand",
"The sinking of the Lusitania",
"The invasion of Poland",
"The fall of the Ottoman Empire"
],
"correctAnswer": "The assassination of Archduke Franz Ferdinand",
"idealAnswer": null,
"explanation": "The assassination of Archduke Franz Ferdinand in Sarajevo on 28 June 1914 triggered a chain of diplomatic crises that led directly to the outbreak of World War I.",
"metaTopic": "The causes and key events of World War I",
"metaDifficulty": "hard",
"metaQualityTier": "premium",
"metaModel": "google/gemini-2.5-flash-lite",
"metaGeneratedAt": "2025-04-24T16:00:00.000000+00:00"
}

Short-Answer Example

{
"questionNumber": 15,
"type": "short_answer",
"question": "What was the name of the military alliance that opposed the Triple Alliance in World War I?",
"options": null,
"correctAnswer": null,
"idealAnswer": "The Triple Entente, consisting of France, Russia, and Great Britain.",
"explanation": "The Triple Entente was formed by France, Russia, and the United Kingdom. It opposed the Central Powers — the Triple Alliance of Germany, Austria-Hungary, and Italy.",
"metaTopic": "The causes and key events of World War I",
"metaDifficulty": "hard",
"metaQualityTier": "premium",
"metaModel": "google/gemini-2.5-flash-lite",
"metaGeneratedAt": "2025-04-24T16:00:00.000000+00:00"
}

Output Field Reference

FieldTypeDescription
questionNumberNumberSequential position in the quiz (1-indexed)
typeString"multiple_choice" or "short_answer"
questionStringThe full question text
optionsArray / nullFour answer choices — multiple-choice only
correctAnswerString / nullExact text of the correct option — multiple-choice only
idealAnswerString / nullModel answer for grading — short-answer only
explanationStringWhy the answer is correct. Useful for learning and review.
metaTopicStringThe topic provided as input
metaDifficultyStringDifficulty level: "easy", "medium", or "hard"
metaQualityTierString"standard" or "premium"
metaModelStringOpenRouter model slug used to generate the question
metaGeneratedAtDateISO 8601 UTC timestamp

Difficulty Levels

LevelTarget AudienceHow It Works
🟢 EasyAnyoneWell-known facts. Distractors are clearly wrong to someone with basic familiarity.
🟡 MediumEnthusiastsRequires specific knowledge. Distractors need careful thought to eliminate. Includes an AI review pass.
🔴 HardExperts & specialistsNiche details, exact dates, minor characters, production trivia. Forbidden from asking any "famous" facts. Distractors must be real entities from the same domain. Includes a strict AI review and rewrite pass.

Quality Tiers

TierModelBest For
Standardopenai/gpt-4o-miniGeneral topics, high volume, cost-sensitive use
🏆 Premiumgoogle/gemini-2.5-flash-liteTechnical, academic, or specialised topics needing higher accuracy (+charge per question)

Setup

This Actor requires an OpenRouter API key. Add it as an encrypted secret environment variable in your Actor's settings.

Steps

  1. Get a free API key at openrouter.ai/keys
  2. In the Apify Console, go to your Actor → SettingsEnvironment variables
  3. Add a variable named OPENROUTER_API_KEY, paste your key, and toggle Secret

Environment Variables

VariableRequiredDefaultDescription
OPENROUTER_API_KEY✅ YesYour OpenRouter API key
OPENROUTER_MODEL_STANDARDNoopenai/gpt-4o-miniOverride the standard-tier model
OPENROUTER_MODEL_PREMIUMNogoogle/gemini-2.5-flash-liteOverride the premium-tier model

How It Works

  1. Validate inputs — fails immediately with a clear message if anything is misconfigured
  2. Plan batches — splits your question count into batches of ≤12 to stay within LLM token limits, distributing MCQ and short-answer questions evenly
  3. Generate — each batch is sent to the LLM with a structured system prompt at temperature 0.3 for factual accuracy
  4. Validate — every batch is validated with Pydantic; invalid batches are retried up to 3 times
  5. Critique (medium/hard only) — a second LLM call reviews the batch and rewrites any questions that don't meet the difficulty standard
  6. Push — validated records are pushed to the Apify dataset as flat, camelCase JSON

Use Cases

  • 📚 E-learning & LMS platforms — auto-generate quizzes for any lesson or module
  • 🎓 Student revision tools — create practice tests and flashcard-style question sets
  • 🧩 Trivia & quiz apps — bulk-generate questions across topics and difficulties
  • 📊 Corporate training & HR — build knowledge-check assessments at scale
  • 🤖 LLM benchmarking — generate domain-specific evaluation sets
  • 🧪 Research — create question datasets for NLP and education research

Tips for Best Results

  • Be specific with your topic. "Mitochondrial DNA replication in eukaryotes" produces much better questions than "Biology".
  • Use a 70/30 MCQ-to-short-answer split. A good default for most learning contexts.
  • Use Hard + Premium for specialist domains. Medical, legal, and highly technical topics benefit most from both settings.
  • Test with 10 questions first. Validate the quality before generating a full set of 100.
  • Run multiple times for variety. Each run generates a fresh set — useful for building large question banks.

Pricing

  • Standard tier — no additional charge beyond Apify compute fees.
  • Premium tier — a small Pay Per Event charge is applied per successfully generated question.

License

MIT