A disposable Moodle 4.4 environment for exercising the LB Planner 2.0 read-only sync API. It creates native Moodle courses, groups, assignments, quizzes, submissions, attempts, completion state, and activity classifications, then verifies the four token-scoped sync resources.
Destructive demo only: every configuration apply deletes every Moodle course and every non-admin user. The image is based on the archived Bitnami 4.4 image and must not be used as production infrastructure or exposed without access controls.
The example environment is ready for direct local access:
cp .env.example .env
docker compose up --build -dOpen http://localhost:420. Local mode accepts only loopback HTTP origins (localhost or 127.0.0.1) and automatically disables Moodle's reverse-proxy and SSL-proxy flags. Switching an existing named-volume installation between local and proxy modes rewrites its persisted canonical origin on startup; deleting volumes is not required.
Compose always builds the demo image from this checkout and the adjacent LB Planner build context. It does not pull or push an eduplanner-demo application image. Docker still downloads the pinned Moodle, MariaDB, Composer, and Dockerfile frontend base images when they are not already cached locally.
For HTTPS reverse-proxy testing, set DEMO_BASE_URL to the public HTTPS origin. The proxy should forward it to http://127.0.0.1:420, set the upstream Host to an internal name (for example 127.0.0.1:420), and set X-Forwarded-Proto: https. Moodle 4.4 rejects the public host on the upstream request when reverse-proxy mode is enabled. TLS terminates at the proxy, and Moodle generates canonical URLs from DEMO_BASE_URL.
On every image start the container automatically:
- installs or upgrades
local_modcustomfields, LB Planner, and the two demo companion plugins; - enables REST web services and token creation;
- validates YAML and regenerates JSON schemas;
- populates Moodle when the config/populator hash changed; and
- watches both config files and reapplies valid changes once they settle.
No Moodle administration clicks, Hatch shell, manual plugin copy, filesystem chmod, or container-user switch is required.
To remove the complete disposable environment:
docker compose down -vThe image installs one executable:
docker compose exec moodle demo status
docker compose exec moodle demo validate
docker compose exec moodle demo schema
docker compose exec moodle demo apply --force
docker compose exec moodle demo doctor
docker compose exec moodle demo credentialsapplyskips an unchanged hash;--forcealways performs the destructive reset.doctorobtains a real user token and calls identity, courses, assignments, and quizzes through Moodle REST.credentialsis the only command that deliberately prints the shared password. Normal and verbose logs redact passwords and tokens.- Interactive terminals get progress spinners and timings; container logs receive timestamped stage, count, duration, and error lines.
Only config/courses.yml and config/users.yml remain. Plans and slots were removed in LB Planner 2.0 and have no demo representation.
Course activities use the sync resource type and optional LB Planner classification:
courses:
- name: Mathematics
tasks:
- name: Midterm Exam
description: Exam on limits and derivatives.
due: 10
type: quiz
classification: TESTUsers declare their native Moodle enrolments explicitly. Student classes become real Moodle groups in every enrolled course. Missing task status means pending.
password: "1234"
users:
- name: Alice Johnson
role: student
class: 1AHIT
courses: [mathematics]
task-status:
mathematics.midterm_exam: completedValid activity types are assignment and quiz. Valid classifications are GK, EK, TEST, M, or an omitted/null value. Valid explicit task states are submitted and completed.
The watcher validates the complete candidate before deleting data. Invalid edits leave the currently populated Moodle data intact and appear in demo status.
The Moodle login page contains a demo-account selector. It lists configured demo users, never admin or guest, and fills the normal username/password fields without submitting the form.
Site administrators can open Site administration → Plugins → Local plugins → EduPlanner demo configuration for a structured courses/users editor. Saving is validated through a constrained Unix-socket agent, updates the YAML and schemas atomically, and queues one watched apply. Moodle's existing admin session protects the editor; there is no second identity provider or webserver.
Local builds use ../lb_planner_plugin as a named Docker build context. Override it when necessary:
LBPLANNER_CONTEXT=/absolute/path/to/lb_planner_plugin docker compose build moodleThe resulting image contains that source and its production Composer dependencies, so PHP changes require an image rebuild. CI checks out the plugin repository and provides the same named context.
Python tests can be run with any Python 3.11+ environment:
python -m pip install -e . pytest
pytest
demo --config config --schema-dir schema validate