๐Ÿ”ฌ Generate structured exams from PDFs with OpenAI GPT-4o and HTML to PDF

โšก 123 views ยท ๐Ÿ”ฌ Document Extraction & Analysis

Description

๐Ÿš€ ExamForge AI

Automated PDF to Structured Exam Generator (MCQ + Essay + Answer Key)

Generate structured exams automatically from text-based PDF materials using AI.

ExamForge AI is a production-ready n8n workflow that transforms educational content into multiple-choice and essay questions with customizable difficulty and automatic answer key generation.


โœจ Features


๐Ÿง  What This Workflow Does

  1. Accepts PDF upload via Webhook
  2. Validates file size
  3. Extracts and cleans text content
  4. Estimates text length to prevent token overflow
  5. Validates required parameters:
    • mcq_count
    • essay_count
    • difficulty
    • language
  6. Sends structured prompt to OpenAI
  7. Parses JSON response
  8. Formats exam and answer key separately
  9. Converts both into PDF
  10. Sends results via Telegram or Webhook response

โš™๏ธ Requirements

Accounts Required

Environment


๐Ÿ”‘ Credentials Setup

1๏ธโƒฃ OpenAI

2๏ธโƒฃ Telegram (Optional)


๐Ÿ›  Webhook Configuration

Method: POST
Content-Type: multipart/form-data

Required Parameters

ParameterTypeRequiredDescription
fileFileYesPDF document
mcq_countNumberYesNumber of multiple-choice questions
essay_countNumberYesNumber of essay questions
difficultyStringYeseasy / medium / hard
languageStringYesOutput language

๐Ÿ“ฅ Example Request

curl -X POST https://your-n8n-domain/webhook/examforge \
  -F "file=@document.pdf" \
  -F "mcq_count=20" \
  -F "essay_count=5" \
  -F "difficulty=medium" \
  -F "language=Indonesian"

## ๐Ÿ”— Nodes Used

Webhook, Telegram, Extract from File, OpenAI

## ๐Ÿ“ฅ Import

Download [`workflow.json`](workflow.json) and import into n8n:
**Workflow menu โ†’ Import from File**

[๐Ÿ“– Importing guide](../../../docs/importing-templates.md) ยท [๐Ÿ”‘ Credential setup](../../../docs/credential-setup.md)