Tiny Algorithm: Flowchart Editor
Draw algorithms as flowcharts right in the Moodle text editor, run them step by step and turn them into code.
Features
- Visual editor: Declare, Assign, Input, Output, If, For, While, Do...While, Call, Return, Comment; several functions, undo / redo.
- Interpreter: Run / Step / Stop, console with input, variable watch, infinite-loop guard and clear error messages.
- Flowgorithm files: import and export real
.fprg files.
- Code generation: Python, C, C++, Java, C#, JavaScript and Pascal.
- 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.
What's new in 2.0.0
- 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 from one diagram to another. A right click on a block opens a menu with Move to and Copy to: click the + sign where the block should go. Alt + arrow moves the selected block.
- Matrices: a Declare block with two sizes is a matrix, used as m[i, j] or m[i][j], in the interpreter, the variable watch (a small table) and the code in all seven languages.
- Function tests: a test can call one function with arguments and check the value it returns.
- The dialog asks before closing with changes that are not inserted; the fields are locked while the algorithm runs; the editor works better on phones (larger + signs, two fingers zoom).
- One storage format: everything the viewer needs is in the SVG of the diagram, and the alt text says how many functions and blocks it has. Diagrams from 1.x keep working.
- Generated code: C arrays start from zeros, Java writes whole numbers without .0 and string arrays start empty, C# writes Reals with a dot on every computer, Python array sizes keep their parentheses.
Requirements
- Moodle 4.5 LTS to 5.3 (PHP as required by your Moodle version).
- Companion plugins (optional): filter_algorithm 2.0.0 (Run / Step and the student features for readers) and qtype_algorithm 2.0.0 (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).
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.