CodeLab Viewer: Edit and Run Program Examples
Turns program examples inserted with CodeLab for TinyMCE into code editors that readers can edit and run, in pages, books, forums and quiz text.
Live demo: try CodeLab on demo.codelabedu.com as a guest: every language, the debugger and SQL run on CodeLab Cloud. Sign in with teacher or student (password Demo-2026) to edit pages and take the quizzes. The same demo has the Algorithm and AISim plugins. Reset nightly.
Video: https://youtu.be/BUF-3pVR1Rk (live coding, the visual debugger, safe mode and auto-grading in 2 minutes).
Important: after installing, switch the filter On in Site administration, Plugins, Filters, Manage filters.
What's New in v1.20.0
- Panels beside the code, as in VS Code: on a wide page Step, the variables, the input and the console of an example go to the right of the code; two buttons in the toolbar put them below or beside it, and a bar between the columns changes the widths (tiny_codelab 1.32). Narrow pages and phones keep the panels below.
- From 1.19: C and C++ typing help with the settings of the example: the editor tells the CodeLab runner 0.24+ the language standard and the compiler profile of the example, so the typing help of tiny_codelab 1.28 checks the code as it is compiled.
- From 1.18: 29 interface languages and the HTML / CSS / JS live preview in the viewer.
Core features
- Run and interactive terminal: compile and run on Jobe or the CodeLab runner with prefilled or live terminal input, or run Python directly in the browser.
- SQL and files: MySQL examples whose setup of tables stays hidden from readers; input files readers can view and edit, and files the program writes appear under the console.
- Typing and error help: code completion (Jedi for Python), explanations of compiler errors, and optional AI explanations of errors through Moodle's AI subsystem.
- Debugger and Memory view: Step for Python and C/C++ with Step back, timeline slider, call stack, call tree, pointer arrows and heap leak warnings.
- Tooltips, zoom, themes and phones: hover for variable values, keyword explanations and number bases; zoom with Ctrl and mouse wheel; full screen; light and dark themes; input from a phone keyboard; screen reader and keyboard friendly console.
- Flowchart and Complexity: draw Python examples as flowcharts with the Algorithm plugins, and chart Python step growth against n, n log n and n².
- Class view and synced copies: students' changes stay saved across reloads and devices; teachers see class copies as cards with status filters and projector view.
- Fast pages: editors load lazily as they scroll into view.
The CodeLab plugins
Requirements
- Moodle: 4.5 LTS to 5.3.
- CodeLab for TinyMCE: version 1.24.0 or newer, with Jobe or the CodeLab runner configured. Switch the filter On after installing.
Privacy
For Class view the filter stores each student's latest copy of an example and last run status; the Moodle Privacy API exports and deletes them. Copies are also kept in browser local storage. Programs and input are sent to the configured server in CodeLab for TinyMCE, or run locally for browser Python.
Developed by Boban Blagojević. 29 languages: en, sr_lt, sr_cr, de, fr, es, it, pt, pt_br, pl, hr, bs, sl, mk, sk, cs, tr, nl, ru, uk, ro, hu, bg, el, sq, ja, zh_cn, ko, ar.
Source and issues: github.com/blagojevicboban/moodle-filter_codelab
Licensed under the GNU GPL v3 or later.