MathDoku (also known as KenKen) is a 9×9 numeric puzzle where each row and column must contain the digits 1–9 without repetition. Cells are grouped into cages marked with a thick border; each cage shows a target number and an arithmetic operation (addition, subtraction, multiplication, or division) that its cells must satisfy.
This plugin generates a unique, randomised puzzle for each student and each attempt. Students fill in the grid directly in the browser and submit for automatic grading.
- Randomised puzzles — every student/attempt combination gets a different puzzle, generated deterministically from a seed so results are reproducible.
- Three difficulty levels:
- Easy — additions and subtractions, cages of 1–3 cells, 2–3 given (pre-filled) cells.
- Medium — all four operations, cages up to 4 cells.
- Hard — some operations hidden, cages up to 5 cells.
- Auto-save — the student's progress is saved silently every 5 seconds.
- Configurable attempts — teacher can set 1 to unlimited attempts per student.
- Grade aggregation — best, average, last, or first attempt.
- Optional solution reveal — teacher can choose to show the correct solution after grading (only when incorrect).
- Gradebook integration — grades are pushed to the Moodle gradebook automatically.
- Privacy API — GDPR-compliant; supports data export and deletion per user.
- Real-time duplicate detection — cells that violate row/column uniqueness are highlighted in red as the student types.
| Component | Version |
|---|---|
| Moodle | 4.3 or later (tested up to 5.1) |
| PHP | 8.1 or later |
| Database | MySQL 5.7+ / MariaDB 10.4+ / PostgreSQL 13+ |
- Download the latest release ZIP from the Moodle plugins directory.
- In Moodle, go to Site administration → Plugins → Install plugins.
- Upload the ZIP and follow the on-screen instructions.
- Unzip the package.
- Copy the
mathdokufolder to<moodleroot>/mod/. - Log in as admin and go to Site administration → Notifications to trigger the database upgrade.
- In a course, turn editing on and Add an activity → MathDoku.
- Set difficulty, maximum attempts, grade method, and whether to show the solution after grading.
- Save. Students will see a new puzzle when they open the activity.
- The grid uses
role="grid"for screen readers. - Keyboard navigation: arrow keys and Tab move between cells.
- Duplicate-entry cells are highlighted in red (colour + text cue via reduced saturation on error state).
This plugin stores the following personal data per user:
- Attempt number, state (in-progress / finished), and timestamps.
- The student's submitted grid values.
- The grade and correctness of each finished attempt.
The puzzle solution is stored server-side and is never sent to the browser. All data is deleted when the activity or course is deleted. Full GDPR support via Moodle's Privacy API (data export and deletion on request).
The ZIP root folder must be named mathdoku (not mod_mathdoku):
cd /path/to/parent/of/mod_mathdoku
cp -r mod_mathdoku mathdoku
zip -r mathdoku-X.Y.Z.zip mathdoku --exclude "mathdoku/.git/*"
rm -rf mathdoku- Go to https://moodle.org/plugins/ → log in → open the sidebar (► toggle, top-right of content area) → Register a new plugin.
- Upload the ZIP. After the initial registration, fill in the plugin details page:
- Source control URL:
https://github.com/alvaretto/mathdoku(no.gitsuffix) - Bug tracker URL:
https://github.com/alvaretto/mathdoku/issues
- Source control URL:
- New versions can be uploaded at any time from the Versions tab — they do not require a new approval cycle.
- The initial approval (visibility in the public directory and Moodle's plugin installer) is tracked at CONTRIB-10468.
GNU General Public License v3 or later — see LICENSE.
Copyright © 2026 Álvaro Ángel Martínez <alvaroangelm@iepedacitodecielo.edu.co>