Why Moodle can’t read your PDF directly
Moodle has no importer for .pdf files. Its Question bank › Import flow only understands structured interchange formats — most commonly QTI 2.1, GIFT, or Moodle XML. A PDF is a fixed layout of pages, not a question model; it tells Moodle nothing about which line is the stem, which lines are the options, or which letter is correct. Worse, a PDF’s text often flows oddly — columns, page breaks and tables can scramble the reading order.
So the job is to translate your document into Moodle’s question model. The reliable way is a two-stage conversion: first extract text and parse the PDF into discrete, classified questions (number, stem, options, answer key, type), then serialize that into a Moodle-ready file. The first stage — getting clean text out of the PDF — is where almost all of the real work lives.
The workflow at a glance
- PDF → classified questionsExtract the text, then break the document into one question per unit — number, stem, options and answer key — and tag each with its type (MC, MR, T/F, short answer…).
- Classified questions → Moodle fileSerialize the same question set into QTI 2.1, GIFT or Moodle XML — whichever your workflow prefers.
- Moodle file → MoodleUpload it via Question bank › Import and the questions appear in your chosen category.
Step 1 — How ExamParser reads your PDF
Before anything else, the text layer has to be recovered. A PDF exported from Word usually has selectable text and reads cleanly; a scanned image-only PDF needs OCR. Once text is available, the parser treats each question as a unit, extracting four things and classifying the type and answer from the structure:
| Part | What it captures | Example |
|---|---|---|
| Number | The question reference shown in Moodle (handy for tracking). | Q20 |
| Stem | The question prompt / body text. | What is 7 × 8? |
| Options | The answer choices, in order (a, b, c, d…). | a) 54 b) 56 c) 63 d) 49 |
| Answer key | The correct option(s), resolved to a 1-based index. Multiple correct answers become a multiple-response (MR) item. | 2 → option b; "2,4" → options b & d |
| Type | Classified from structure — MC, MR, T/F, short answer, etc. | MC, MR |
How do you actually run this conversion?
Typing hundreds of items into the Moodle editor by hand is slow and error-prone. The practical move is a tool that does both stages: extract your PDF, classify every question, and export a Moodle format. ExamParser (pdf2moodle) is built for exactly this — upload a PDF (or a PDF/DOCX pair) and it returns the classified questions you can audit and the Moodle-ready QTI 2.1 / GIFT / XML file.
Step 2 — Choose a Moodle format: QTI 2.1, GIFT or XML
Moodle imports all three cleanly; they differ mainly in readability and portability:
| Format | Best for | Notes |
|---|---|---|
| Moodle XML | Full fidelity | Preserves categories, feedback and question metadata. The most complete export. |
| GIFT | Quick review | Plain text, the most human-readable — easy to spot-check or hand-edit before importing. |
| QTI 2.1 | Cross-LMS portability | Best if you also move questions between Moodle and other LMS platforms. |
Because all three come from the same parsed question set, you lose nothing by picking one — switch formats anytime without re-extracting the PDF. ExamParser exports the format you select in the same pass.
Step 3 — Import the file into Moodle
- In your course, open More › Question bank › Import.
- Choose the import format you exported — Moodle XML, GIFT, or QTI 2.1.
- Select the file from Step 2 and pick the destination category.
- Click Import and review the summary of questions added.
- Find the items under Question bank; preview, reorder, or add them to a quiz.
One tool for the whole pipeline: ExamParser (pdf2moodle)
ExamParser is built for this exact job — PDF document to Moodle. The part that makes it different is the middle step: it doesn’t just dump your PDF into an export. It first classifies every question — number, stem, options, answer key and type — and only then serializes that set into the Moodle format you choose. You can review the classified questions before exporting, so what lands in Moodle is exactly what you approved. No manual re-typing, no copy-paste, no silent mis-keying.
Turn your PDF questions into a Moodle file
Upload a PDF and get Moodle-ready QTI 2.1, GIFT or XML — with the classified questions to review first.
Try ExamParser →Common pitfalls (and how to avoid them)
- Image-only / scanned PDFs. These have no text layer and need OCR first. If you can’t select text in the PDF, expect lower extraction accuracy — review the classified questions carefully.
- Text reflow from columns or tables. Multi-column layouts and tables can scramble reading order. Check items where options or answer keys look out of sequence.
- Answers written as letters, not positions. An answer key like “a” must map to the 1st option. Let the tool resolve letters to 1-based indices; don’t hand-edit.
- Hyphenation across line breaks. Extracted text may keep hard hyphens (e.g. “ques- tion”). Spot-check stems and options for broken words.
- Mixed question types in one file. That’s fine — the type is detected per question. Just keep the formatting consistent so detection stays reliable.
- Encoding issues. Accented characters and special symbols can shift during extraction. Export UTF-8 where possible; Moodle XML and GIFT both handle UTF-8 cleanly.
Can Moodle import a PDF file directly?
No. Moodle’s question bank imports structured interchange formats — QTI 2.1, GIFT or Moodle XML — not PDF documents. A PDF first has to be extracted into text, the questions identified (number, stem, options, answer key), and then converted into one of those formats.
Which Moodle format should I export — QTI 2.1, GIFT or XML?
All three import cleanly. Moodle XML is the most complete (it preserves categories, feedback and question metadata). GIFT is the most human-readable and easy to spot-check. QTI 2.1 is the best choice if you also work across multiple LMS platforms. ExamParser exports all three from the same parsed question set, so you can pick whichever your workflow prefers.
Do scanned / image-only PDFs work?
Only if the text can be recovered. Image-only PDFs have no selectable text, so they need OCR first. If your PDF was exported from Word or a typesetting tool it usually contains a real text layer and imports fine. When in doubt, try selecting text in the PDF — if you can, ExamParser can read it.
My PDF mixes multiple question types. Will it work?
Yes. Moodle accepts mixed question types in a single import file. ExamParser classifies each question from the extracted text and writes the correct element for each type into the exported file, so a document with MC, MR, T/F and short-answer items imports as one batch.
Where do the imported questions end up in Moodle?
They land in the question bank category you choose at import time (Question bank › Import). From there you can preview them, move them between categories, or add them to a quiz.
MoodleQTI 2.1GIFTMoodle XMLPDF to MoodleExamParser