π¬ Generate interactive MCQ quizzes from PDF textbooks with Google Gemini, UploadToURL and Gmail
β‘ 90 views Β· π¬ Document Extraction & Analysis
Description
This workflow transforms any textbook PDF into a fully interactive quiz β automatically.
Users upload a PDF, choose difficulty & number of questions, and the system:
- Extracts content
- Generates MCQs using AI
- Builds an interactive quiz webpage
- Uploads it online
- Sends a shareable link via email
β¨ Key Features
- π₯ Form-based PDF upload
- π€ AI-generated MCQs (with explanations)
- π― Custom difficulty & question count
- π Interactive HTML quiz (instant feedback)
- π Public shareable link
- π§ Automated email delivery
- β‘ Fully automated workflow
π§© Workflow Breakdown (Node-by-Node)
π’ 1. Get-Details (Form Trigger)
What it does:
Acts as the entry point of the workflow.
How it works:
- Displays a form to the user
- Collects:
- Name
- PDF file
- Number of questions (10 / 20 / 30)
- Difficulty (Easy / Medium / Hard)
- Once submitted β triggers the workflow
π£ 2. Extract from File
What it does:
Extracts text from the uploaded PDF.
How it works:
- Takes the uploaded PDF (binary data)
- Uses n8nβs built-in PDF parser
- Converts PDF β plain text
- Passes extracted text to the AI node
π΅ 3. Generate-MCQ (AI Node)
What it does:
Converts textbook content into MCQs using AI.
How it works:
- Receives extracted text
- Reads user inputs:
- Number of questions
- Difficulty level
- Sends structured prompt to Google Gemini
- Forces AI to return strict JSON format
- Output includes:
- Question
- 4 options
- Correct answer
- Explanation
π‘ 4. Template (Code Node)
What it does:
Builds a fully interactive quiz webpage.
How it works:
1. JSON Parsing
- Cleans AI response
- Converts string β JavaScript object
- Handles parsing errors safely
2. Personalization
- Fetches userβs name
- Adds it to quiz header
3. HTML Generation
- Creates styled quiz layout
- Includes:
- Questions
- Multiple choice options
- Answer + explanation
4. Interactivity (JavaScript)
- User clicks an option β
- Shows correct/incorrect
- Displays explanation
- Locks answer
Output:
- Generates a
.htmlfile
π’ 5. Upload a File (UploadToURL) β
What it does:
Uploads the generated quiz and creates a public shareable link.
How it works:
- Takes the HTML file from previous node
- Uploads it to the internet
- Instantly returns a public URL
π₯ Why this node is powerful:
- No hosting required
- No backend setup
- Instant file sharing
- Perfect for automation workflows
π UploadToURL - Turn Files into Shareable Links
- Turn any file into a live URL
- Share instantly with anyone
π 6. Send a Message (Gmail)
What it does:
Sends the quiz link directly to the user.
How it works:
- Uses email collected from form
- Personalizes message with user name
- Inserts public quiz URL
- Sends a clean, clickable email
Result:
User receives their interactive quiz instantly π§
π― Use Cases
- π Students β Practice from textbooks
- π¨βπ« Teachers β Generate quizzes instantly
- π§ EdTech β Build learning tools
- π Creators β Convert content into interactive experiences
π Nodes Used
Gmail, Basic LLM Chain, n8n Form Trigger, Extract from File, Google Gemini Chat Model
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File