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
- Email
- 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:
š¢ 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