We built DEV3 AI Course Builder as a WordPress plugin in PHP with a React admin. The AI runs on the Google Gemini API with the site owner's own key; nothing it writes is saved without a click.
Key design decisions
- Blueprint first. A course is a JSON tree (course details, sections, lessons, topics, quizzes, questions, certificate text) stored in its own table. Nothing exists in the LMS until Create course.
- Normalise every input. AI outlines, pasted outlines, imported JSON and editor saves all pass through
Tree::normalize(), which assigns ids, clamps lengths and repairs questions per type (exactly one correct answer for single choice, True/False rebuilt, blanks marked with one placeholder).
- One adapter contract, three targets. Tutor LMS, LearnDash and a no-LMS pages adapter each implement
create_course, create_section, create_lesson, create_topic, create_quiz, finalize and cleanup, and declare what they support.
- Retry-safe build steps. The build is a background job of ordered steps. Each step records node id → post id in the blueprint before the next one runs, so a retried step finds its post and skips it.
- Undo by tag. Every created post carries the blueprint id and node id in post meta. Undo build trashes (or deletes) exactly those posts and removes Tutor's question rows.
- Works without AI. Outline parser for Markdown headings and lists, DOCX and PDF text extraction, templates, a manual tree editor and heuristic quiz questions.
Architecture
The admin app has a dashboard, a New course screen (topic, outline or PDF/DOCX source), the course builder, a courses list with JSON import and export, a quiz generator for existing lessons and a lesson rewriter with undo history. Lesson Markdown becomes native Gutenberg blocks. A Course Certificate block and shortcode print a certificate for learners who completed the course. The API client, background jobs, encryption and settings screens come from a shared core used across DEV3's plugins.