I Built a Gemma 4 Course in 10 Minutes Using AI — Here's Exactly How
Sean
SubscribeSign in
I Built a Gemma 4 Course in 10 Minutes Using AI — Here's Exactly How<br>How I use Claude to generate complete Moodle courses with interactive activities, question banks, and H5P elements from a handful of URLs
Sean<br>Jun 06, 2026
Share
This week I decided to build a course about Google’s new Gemma 4 12B model for my Moodle dev platform. The course needed to be university-level CS content, include interactive activities, a quiz, and be ready to import directly into Moodle 5.<br>I had four URLs and a Tuesday afternoon. The course was live by lunch.<br>This isn’t a “look what AI can do” hype post. This is a practical walkthrough of a workflow I’ve built over several months at iLite, where we build and maintain eLearning platforms. I’m going to show you exactly how it works, what you need to set up, and what comes out the other end.
The problem with building Moodle courses
If you’ve ever built a Moodle course by hand, you know the pain. You’re clicking through a web interface, one activity at a time, formatting content in a WYSIWYG editor, configuring completion tracking, setting up quiz questions one by one. A decent 8-section course with a quiz and some interactive elements is a full day’s work at minimum — and that’s before you’ve written the actual content.<br>Moodle’s backup format (.mbz files) is technically just a tarball of XML files. Every page, every book chapter, every quiz, every section has its own XML file with specific structure requirements. Get one tag wrong and the restore silently fails — your course imports but shows up empty.<br>So I asked myself: what if I could give Claude the source material and get back a complete, importable .mbz file?
What you need before you start
The workflow relies on three things you prepare once and reuse forever:<br>1. A Moodle template file (.mbz)
This is a blank or minimal course exported from your own Moodle instance. It captures your site’s specific configuration — Moodle version, custom fields, enrolment methods, block layout. I use a template called course_template.mbz that I exported from our dev site.<br>Why this matters: Moodle’s XML structure changes between versions and sites. Custom fields (like CPD points, course duration, difficulty level) are site-specific. The template gives Claude the exact XML structure your Moodle installation expects.<br>2. A project prompt and skill file
These are instruction documents that tell Claude how to build Moodle courses. Think of them as a detailed specification:<br>PROJECT_PROMPT.md — The full XML conventions, required file structures, known failure modes, and the mandatory workflow (ingest → propose layout → wait for approval → build). This is the “rulebook.”
SKILL.md — A more concise version focused on the build steps, ID schemes, packaging commands, and output standards.
These encode everything I’ve learned from months of trial and error — which XML tags cause silent failures, what the displayoptions field needs to look like (it’s a PHP serialised string, and if it’s wrong, your page content vanishes), why you need after in book activities, and dozens of other gotchas.<br>I maintain these files and update them as I discover new edge cases. They’re the institutional knowledge of the workflow.<br>3. H5P template files (optional but recommended)
H5P framework for interactive content — flashcards, drag-and-drop exercises, word searches, accordion panels, dialog cards. Each H5P type has its own JSON structure inside a ZIP archive.<br>I keep one template .h5p file for each type I commonly use:<br>flashcards.h5p — Typed-answer recall cards
dialog-cards.h5p — Flip cards (front/back concept pairs)
drag-the-words.h5p — Fill-in-the-blank with draggable words
accordion.h5p — Expandable reference panels
h5p_word_search.h5p — Vocabulary grid puzzle
Claude inspects these templates to learn the exact JSON structure and library versions, then generates new ones with course-specific content.
The process: a real example
Here’s exactly what I did for the Gemma 4 course. I’ll walk through each step.<br>Step 1: Upload everything to Claude
I start a new conversation in Claude (with the Code Execution / file creation feature enabled) and upload:<br>course_template.mbz — my Moodle site template
PROJECT_PROMPT.md and SKILL.md — the build instructions
All five H5P template files
My prompt with the source URLs
Step 2: The prompt
My prompt is straightforward. I give Claude the source material and tell it what I want:<br>Using these URLs:<br>- [A Visual Guide to Gemma 4 12B - Maarten Grootendorst]<br>- [google/gemma-4-12B-it · Hugging Face]<br>- [Gemma 4 12B: The Developer Guide - Google Developers Blog]<br>- [YouTube video overview]<br>Build me a course using the above URLs.<br>Further expand the course by adding in any additional resources<br>for the content not included in the links.<br>Requirements:<br>- Use the templates provided to build the Moodle course<br>- Include where possible any of the...