Algorithm Question Type
A quiz question in which the student draws an algorithm as a flowchart and can run it before submitting. With tests, the answer is graded automatically.
Live demo: try the plugin on algorithm.tsp.edu.rs. Log in as a guest, or use the demo accounts teacher and student (password Demo-2026). Everything is reset every night.
What's New in v2.4.1
- Default code language: the language the teacher chooses in the question form is the one students see first.
- Function tests with arrays and matrices: Sort([3, 1, 2]) is graded by the value and by the array it changed.
- Hide the code and the file tools: a new option keeps the generated code and the file import and export out of the attempt.
- Step with a failed test: the student steps through the algorithm with the input of a failed test.
- Safer grading: limits for recursion and output, typed input, and Random that gives the same numbers in every grading run; the upgrade computes the expected outputs again.
- With tiny_algorithm 2.4: breakpoints, the call stack, a trace table, Break and Continue, pseudo-code and eleven languages.
Core features
- Draw the algorithm: the same editor as in TinyMCE, with Run / Step, variable watch and generated code.
- Runnable review: the teacher can run and step through the submitted diagram while grading.
- Automatic grading: the teacher enters only the test inputs; the expected outputs are computed from the teacher's solution. Without tests the answer is graded manually.
- Flexible tests: weights, function tests that call one function, comparison options (capital letters, spaces, a tolerance for numbers), hints and several tries, statistics per test.
- Hidden tests and required structures: If, For, While, Do loop, array, matrix.
- Analyse an algorithm: put an interactive diagram in the question text (needs filter_algorithm).
The algorithm plugins
Requirements
- Moodle: 4.5 LTS to 5.3 (PHP as required by your Moodle version; tested on all of them).
- tiny_algorithm: version 2.4.1 or newer; filter_algorithm is optional (interactive diagrams in question text).
Privacy
The student's answer is stored by the Moodle question engine like any other answer; the diagram runs in the browser and, for automatic grading, on your Moodle server; nothing is sent to external services. Test inputs and options are stored with the question. The plugin implements the Moodle Privacy API.
Developed by Boban Blagojević. Languages: English and Serbian (Latin and Cyrillic).
Source, documentation and issue tracker:
github.com/blagojevicboban/moodle-qtype_algorithm
Licensed under the GNU GPL v3 or later.