CodeLab: Runnable Program Examples in the VS Code Editor
Insert program examples in C, C++, Python, Java, C#, JavaScript, Pascal and PHP into any Moodle text, write them in the code editor of VS Code and run them on Jobe, on the CodeLab runner or in the browser.
Live demo: try CodeLab on codelab.tsp.edu.rs as a guest (Python runs in the browser), or sign in with teacher or student (password Demo-2026) for every language, the debugger and SQL. Reset nightly.
What's New in v1.23.0
- C and C++ compiler and standard selection: choose GCC, Clang or MSVC compatibility mode (Visual Studio headers and safe input/output helpers) and a C or C++ language standard per example or site-wide.
- Safe mode and heap leak detection: catches out-of-bounds access, null pointers, integer overflow and unfreed heap blocks in C and C++, highlighting the line in the editor and unfreed blocks in the Memory view in all 15 languages.
- Compiler error explanations: explains 40 common GCC and Clang compiler and linker errors in plain language with short examples directly under the compiler output in all 15 languages.
- Multi-file editor tabs and compilation: companion source, header and data files open as tabs above the Monaco editor with syntax highlighting by extension, and extra C, C++, Java and C# source files compile together.
- Peak memory forwarding: passes peak memory reported by CodeLab runner 0.13.0 or newer to test results.
Core features
- VS Code editor: Monaco with syntax highlighting, line numbers, bracket matching, search and multi-file tabs.
- Typing help and error help: code completion for every language (Jedi for Python), instant explanations for 40 common GCC and Clang errors, and optional AI explanations through Moodle's AI subsystem.
- Jobe or CodeLab runner: choose the execution server, with GCC, Clang or MSVC compatibility mode for C/C++, per-user limits and a server test page.
- Interactive runs and Python in the browser: live terminal input on the CodeLab runner (with Safe mode for C/C++) or in-browser Python via Pyodide with turtle graphics.
- Debugger and Memory view: breakpoints, Step over and out, call stack, call tree, step back timeline, pointer arrows down linked lists to NULL, and heap leak warnings.
- Complexity and Flowchart bridge: measure Python step growth against n, n log n and n², and exchange Python programs with the Algorithm flowchart plugins.
- Themes, accessibility and phones: Light, Dark and High Contrast themes, reduced motion, screen reader announcements and mobile-friendly input.
The CodeLab plugins
Requirements
- Moodle: 4.5 LTS to 5.3.
- Execution server: Jobe or the open-source CodeLab runner (github.com/blagojevicboban/codelab-runner). Browser Python needs Chrome or Edge 137+ and works without a server.
- Hosted runner (optional): paid monthly quota plan by Boban Blagojević (boban.blagojevic@tsp.edu.rs). Not required.
- CodeLab filter: install and enable it in Site administration, Plugins, Filters, Manage filters.
Privacy
Programs and input are sent to the configured Jobe or CodeLab runner server to compile and run; interactive sessions use a short-lived signed token with only the numeric user id and keep nothing after exit. Browser Python loads Pyodide from the configured URL without sending code. Optional AI explanations use Moodle's AI subsystem. Implements the Moodle Privacy API.
Developed by Boban Blagojević. 15 languages: en, sr_lt, sr_cr, de, fr, es, it, pt, pl, hr, bs, sl, mk, sk, cs. Bundles Monaco Editor (MIT).
Source and issues: github.com/blagojevicboban/moodle-tiny_codelab
Licensed under the GNU GPL v3 or later.