CodeLab Question Type: Programming Questions Graded with Tests
Students write a program in the code editor of VS Code. It is run on the teacher's tests on Jobe or the CodeLab runner, and graded by the weighted share of passed tests.
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). You can also preview CodeRunner XML migration in your browser at codelabedu.com/migrate.
What's New in v1.19.0
- Compare with solution (side-by-side diff): in quiz review, when Moodle review options allow showing the right answer, students can open a Monaco side-by-side diff comparing their code with the model solution (tiny_codelab 1.35).
- SQL Tables viewer in attempts: MySQL questions with hidden CREATE TABLE setup scripts show a Tables button with columns, PK/FK badges and sample rows.
- From 1.18: built-in CodeRunner Moodle XML importer (More → Import CodeRunner XML), static code constraints with penalties, and dark Moodle theme compatibility.
Core features
- 26 server-graded languages: C, C++, Python, Java, C#, JavaScript, TypeScript, Pascal, PHP, SQL (MariaDB), Bash, Go, Rust, R, Ruby, Lua, Kotlin, Perl, Octave, Julia, Scheme, Dart, Scala, Elixir, Swift and Haskell.
- Flexible tests: input, expected output, input files, function test code or unit-test assertions, weights and hidden tests; empty expected outputs are filled from the model solution on save, which must pass the tests.
- Output comparison: exact, ignoring trailing spaces, numbers with a tolerance, a regular expression, or lines in any order for SQL.
- Check with penalties: in Interactive with multiple tries and Adaptive mode each wrong Check costs the penalty; a time limit per test shows slow solutions.
- In the attempt: Run with live input and Step with the debugger for Python, C, C++, C# and Java (with Python also in the browser), plus Run tests on the visible tests.
- Hidden code before and after the answer: wrap student functions or statements cleanly without showing boilerplate.
- Safe cached grading: grades are computed on the server only, results are cached across reviews and regrades, and side-by-side output diffs highlight the first differing line.
- Parsons problems: shuffled solution lines with distractors, optional fill-in gaps and Check order with partial credit.
- Class work and Analysis: live student answer cards, test pass rates, common wrong outputs, frequent compiler errors, grade distribution and local similarity pairs.
- Options and backup: time and memory limits, optional typing help and AI error hints per question, a page that checks the solutions of all questions of a course, and full backup and restore.
The CodeLab plugins
Requirements
- Moodle: 4.5 LTS to 5.3.
- CodeLab for TinyMCE: version 1.25.0 or newer, installed first, with Jobe or the CodeLab runner configured.
- Hosted runner (optional): CodeLab Cloud by Boban Blagojević (boban.blagojevic@tsp.edu.rs), codelabedu.com: a free 30-day trial from a button in the settings, then a paid monthly plan. Not required.
Privacy
Answers are stored like any quiz answer. Programs and input are sent to the configured Jobe or CodeLab runner server to compile and run. Submission similarity runs locally inside Moodle. Implements the Moodle Privacy API.
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-qtype_codelab
Licensed under the GNU GPL v3 or later.