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.27.0
- Typed expected output: the teacher can type the expected output of a test instead of computing it from the solution, for example for a test the solution is not meant to pass.
- From 2.26.0, strict initialization: a new option of the question. Reading a variable, array element or field before it has a value is an error in the runs and in grading, as in C, C++ and Java.
- Requires tiny_algorithm 2.31.0 or later.
Core features
- Draw the algorithm: the same editor as in TinyMCE, with Run / Step, variable watch, the arrays panel, the call tree and generated code; records, turtle graphics and files are graded too.
- 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, record.
- Parsons problems and fill the gaps: students arrange the given blocks (with an optional Check order) or type only the emptied expressions of the solution.
- Efficiency and strict initialization: limits on steps, growth and blocks; optionally a variable must get a value before it is used.
- Class work and analysis: the teacher sees every student's answer as a small diagram and an analysis of the tests, errors and missing blocks.
- AI hints (optional): per question, an explanation of an error or a hint for a failed test through Moodle's AI subsystem, never the solution.
- 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.27.0 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. Only with the AI hints option, turned on by the administrator, the algorithm and the error or the failed test are sent to the AI provider of the site through the AI subsystem of Moodle. Test inputs and options are stored with the question. The plugin implements the Moodle Privacy API.
Developed by Boban Blagojević. Languages: English, Serbian, German, French, Spanish, Italian, Portuguese, Polish, Croatian, Bosnian, Slovenian, Macedonian, Slovak and Czech.
Source, documentation and issue tracker:
github.com/blagojevicboban/moodle-qtype_algorithm
Licensed under the GNU GPL v3 or later.