The Media Library
Upload images, PDFs, Word docs, and videos, or link to YouTube — and attach them to any module.
The Media Library at /admin/media is a central store for all files and external links you want to use in your modules.
Supported file types
| Type | Extensions | Extra features |
|---|---|---|
| Text extracted automatically for AI quiz generation | ||
| 📝 Word | .docx, .doc | Text extracted automatically for AI quiz generation |
| 🖼️ Image | .jpg, .jpeg, .png, .gif, .webp, .svg | Inline thumbnail preview |
| 🎥 Video file | .mp4, .webm, .mov, .m4v | Inline video player |
| ▶️ YouTube/Vimeo | URL | Auto-generates embed; inline iframe preview |
| 🔗 External link | Any URL | Stored and linked |
Uploading a file
- Go to Admin → Media Library.
- In the left panel, make sure ⬆️ Upload file tab is selected.
- Drag and drop a file onto the drop zone, or click to browse.
- The filename auto-fills the Title field — edit it if you want a friendlier name.
- Optionally add a description and link it to a module.
- Click Save.
Adding an external link
- Switch to the 🔗 External link tab.
- Paste any URL — YouTube, Vimeo, or any webpage.
- YouTube and Vimeo URLs are automatically detected and an embed iframe is generated.
- Add title and description, link to a module, click Save.
AI quiz generation from PDFs
If you've uploaded a PDF or Word doc and have an OpenAI API key configured, a 🎯 Gen quiz button appears on the media card. Click it to:
- Send the first 3,000 characters of extracted text to the AI.
- Get a multiple-choice question generated on the spot.
- Copy the question into the Quiz editor for the relevant module.
Attaching media to modules
When you upload or add a link, choose a module from the Attach to module dropdown. That media then appears in the 📁 Attached media panel on that module's edit page.
Storage
Uploaded files are stored in the uploads/ folder inside the project root. File names are randomised (UUID) to prevent conflicts. The media index is kept in data/media.json.