Tiny Algorithm: Flowchart Editor
Draw algorithms as flowcharts right in the Moodle text editor, run them step by step and turn them into code.
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.15.0
- Class work: with filter_algorithm 2.15 the teacher sees the copies of an exercise the students are changing, as small diagrams with the result of the tests, refreshed every 10 seconds, and shows one large on the projector, with the names hidden when wanted.
- Parsons problems (2.14): with qtype_algorithm 2.14 a quiz question can give students the blocks of the solution in a random order, with a few wrong blocks, to arrange and nest; the editor then only moves and deletes blocks.
- Code to diagram (2.13): paste Python code and get the flowchart: functions, input and print, if / elif / else, while, for loops, lists and matrices, f-strings. Lines with no block become comments and are listed. The Python the plugin generates comes back as the same algorithm, and it now handles whole-number division and Boolean input correctly.
- Complexity (2.12): the algorithm runs for several sizes n, its steps are counted and drawn beside the curves n, n log n and n², and the growth that fits best is named, for example O(n²). A template such as Selection Sort can be measured beside it.
- Arrays panel (2.11): while the algorithm runs or steps, its arrays are drawn as bars or boxes and a matrix as a grid. The elements a block read are amber and those it wrote green, so comparisons and swaps can be seen, and the index variables point at their element.
- New templates (2.11): Bubble Sort, Selection Sort and Binary Search.
- Step back and a timeline (2.10): a Back button (F8) and a slider over the steps of the run take the algorithm back to any earlier step, with the variables, the console, the drawing and the files as they were then. Random numbers and the values entered stay the same; a new value can be entered when the algorithm is taken back before an Input.
- Run and Step wait for a value (2.10): pressing them while the algorithm asks for a value no longer ends the run with an error.
Also new since v2.5.3
- Files (2.9): Open, Read, Write and Close blocks and EOF(), as in Flowgorithm. The files are kept with the algorithm and edited in a Files panel; the files the algorithm writes can be downloaded. Python code reads and writes real files.
- Code language on three levels (2.8): a default and the offered languages for the site, a language for a course or an activity (filter settings), and a language for one algorithm; each can be locked for students.
- Turtle graphics (2.7): Forward, Turn, Pen with ten colours, Home and Clear, with a Drawing panel; Python code uses the turtle module.
- Full screen dialog (2.7): the editor dialog can fill the window, with the code in its own column.
- Help for the expressions (2.6): a table of the operators and functions with live examples, and a warning when a variable is declared twice.
Core features
- Visual editor: Declare, Assign, Input, Output, If, For, While, Do...While, Break, Continue, Call, Return, Comment; several functions, undo / redo.
- Drag, copy and paste: drag a block onto a + sign with the mouse or a finger; Ctrl + C, X, V and D copy, cut, paste and duplicate blocks, also between diagrams.
- Arrays and matrices: m[i, j] in the interpreter, the variable watch and the code in every language.
- Save as SVG or PNG: the whole diagram as a picture for handouts and slides.
- Interpreter: Run / Step / Stop, console with input, variable watch, infinite-loop guard and clear error messages; the current block and the branch each condition takes are marked.
- Arrows: every connection that enters a block, goes back to a loop condition or joins another line ends in an arrow.
- Flowgorithm files: import and export real
.fprg files.
- Code generation: pseudo-code and Python, C, C++, Java, C#, JavaScript, Pascal, Visual Basic .NET, Go, Rust and Kotlin.
- Editable images: the diagram is an SVG image that keeps its model; double-click to edit again. Zoom and per-diagram options included.
- Students edit and test: with filter_algorithm, students can change their own copy of a diagram in any content and run the teacher's tests.
- Tests from the solution: the teacher enters only the inputs; the expected outputs are computed from the teacher's solution. A test can also call one function and check the value it returns.
The algorithm plugins
Requirements
- Moodle: 4.5 LTS to 5.3 (PHP as required by your Moodle version).
- Companion plugins (optional): filter_algorithm 2.2.0 (Run / Step and the student features for readers) and qtype_algorithm 2.5.3 (quiz question type with automatic grading).
Privacy
The editor and interpreter run in the browser; nothing is sent to external services. The diagram is stored in the text you save. The plugin keeps two display preferences (code and variable panels) and the student's own copy of an editable diagram in the browser's local storage and implements the Moodle Privacy API (no personal data stored).
Developed by Boban Blagojević. Languages: English and Serbian (Latin and Cyrillic).
Source, documentation and issue tracker:
github.com/blagojevicboban/moodle-tiny_algorithm
Licensed under the GNU GPL v3 or later.