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.27.0
- Class view on the projector: Hide names shows the students as Student 1, Student 2, a status bar shows the share of each status and filters with a click, and a new filter lists the students who have not started.
- Print, Web Lab and settings: printed pages show the code of each example, Web Lab errors link to their tab and line, and an Editor settings button is in every toolbar (tiny_codelab 1.42).
- From 1.26, Relational algebra: MySQL examples translate algebra expressions to SQL and run them (tiny_codelab 1.41).
- From 1.25, Plan and Transactions: MySQL examples show the plan of a SELECT and open two sessions on one database to try locks, COMMIT and ROLLBACK (tiny_codelab 1.39).
- From 1.24, SQL step by step: a button on MySQL examples shows the SELECT in the order the database works it out, with the table after each step (tiny_codelab 1.38).
- From 1.23, SQL help: completion with the tables and columns of the hidden setup, and beginner explanations of MariaDB errors under the console (tiny_codelab 1.37).
- From 1.22, Interactive SQL ER Diagram: the Tables panel on MySQL examples now includes a Tables | ER diagram switcher (Crow's Foot and Chen notations) with live JOIN highlighting, Schema Linter warnings, bidirectional editing for student tables, and SVG/PNG export (tiny_codelab 1.36).
- From 1.21: SQL Tables viewer for hidden setup scripts and Class view Show changes diff toggle.
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, C, C++, C# and Java with breakpoints, watches, Step back, timeline slider, call stack, call tree, pointer arrows, matrix heat maps 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.