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.31.0
- Typed expected output: a test of an exercise can have an expected output the teacher types instead of one computed from the solution.
- Import .svg: an SVG saved with Save as SVG opens again in the editor.
- Close the code panel: the Code panel of the editor can be closed and opened again with Show code.
- From 2.30.0: ranges and animated swaps in the Arrays panel, optional sound cues.
Core features
- Visual editor: Declare, Assign, Input, Output, If, For, While, Do...While, Break, Continue, Call, Return, Comment; several functions, records, undo / redo, drag and drop, copy and paste.
- Interpreter: Run / Step / Stop, console with input, variable watch, breakpoints, call stack, trace table, infinite-loop guard and clear error messages; optional strict initialization, as in C.
- Arrays panel and call tree: arrays as bars or boxes, matrices as a heat map, records as a table, counters of comparisons and swaps; every recursive call drawn as a tree.
- Step back and a timeline: a Back button (F8) and a slider take the run back to any earlier step.
- Turtle graphics and files: drawing blocks and Open, Read, Write and Close for text files.
- Code generation: pseudo-code and Python, C, C++, Java, C#, JavaScript, TypeScript, PHP, Pascal, Visual Basic .NET, Go, Rust and Kotlin; with the CodeLab plugins the code runs on Jobe or opens as a CodeLab example.
- Code to diagram: paste Python code and get the flowchart; lines with no block become comments.
- Editable images and files: the diagram is an SVG image that keeps its model (double-click to edit again), saved as SVG or PNG; Flowgorithm
.fprg import and export.
- Complexity: the algorithm runs for several sizes n, its steps are drawn beside n, n log n and n², and the best fit is named.
- Students edit and test: with filter_algorithm, students change their own copy and run the teacher's tests; the expected outputs come from the teacher's solution, and the teacher sees the class work as small diagrams.
- Quiz questions: with qtype_algorithm, automatic grading, Parsons problems, fill the gaps and Check order.
- AI hints (optional): through Moodle's AI subsystem, an explanation of an error or a hint for a failed test, never the solution.
- Templates: sorting, Binary Search, recursion and records among others.
The algorithm plugins
Requirements
- Moodle: 4.5 LTS to 5.3 (PHP as required by your Moodle version).
- Companion plugins (optional): filter_algorithm 2.20.0 (Run / Step, the student features and class work for readers), qtype_algorithm 2.26.0 (quiz questions with automatic grading), and tiny_codelab 1.12.0 or newer for Run the code.
Privacy
The editor and interpreter run in the browser. Only when the site has the CodeLab plugins and the user presses Run the code is the generated program, with its input, sent to the server set up in CodeLab. When the administrator turns on AI hints, the algorithm and the error are sent to the AI provider of the site through the AI subsystem of Moodle; nothing else 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, Serbian, German, French, Spanish, Italian, Portuguese, Polish, Croatian, Bosnian, Slovenian, Macedonian, Slovak and Czech.
Source, documentation and issue tracker:
github.com/blagojevicboban/moodle-tiny_algorithm
Licensed under the GNU GPL v3 or later.