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 a Jobe server or the CodeLab runner, and the grade is the weighted share of the tests it passes.
Live demo: try the CodeLab plugins on codelab.tsp.edu.rs. Look around as a guest (Python runs in the browser), or use the demo accounts teacher and student (password Demo-2026) to run every language, the debugger and SQL. Everything is reset every night.
What's New in v1.10.0
- Grading without Jobe: with CodeLab for TinyMCE 1.13 and CodeLab runner 0.8.0, questions are graded on the runner, your own or a hosted one. The setting Server for running and grading chooses Jobe, the runner, or Automatic, which moves a run to the runner when Jobe does not answer.
- Same limits everywhere: the time and memory limits of a question also apply on the runner.
- Never wrong by accident: when the server cannot check a program (busy, or a hosted runner over its quota), the answer is left for the teacher.
Core features
- Eight languages: C, C++, Python, Java, C#, JavaScript, Pascal and PHP.
- Tests: each test has an input, an expected output, a weight, and can be hidden. Students see only how many hidden tests passed. Empty expected outputs are filled in by running the model solution when the question is saved.
- Hidden code before and after the answer: for example the class and Main around a few statements.
- For the student: the code editor with typing help, Run with their own input, and Run the tests for the tests that are not hidden.
- Safe grading: the grade is computed on the server only. Results are cached, so a review or a regrade does not load the server again. When the server cannot check a program at the final submit, the answer waits for the teacher.
- Check with penalties in Interactive and Adaptive mode, and output compared exactly, without trailing spaces, as numbers with a tolerance or by a regular expression.
- Options: time and memory limits, and turning off typing help for tests. A question without tests is graded by the teacher.
- Parsons problems: students put the shuffled lines of the solution in order, with distractor lines; Python lines are indented by the student.
- Backup and restore keep all settings and tests.
The CodeLab plugins
- CodeLab for TinyMCE: inserts examples in the TinyMCE editor. The other two plugins use its editor and runner.
- CodeLab filter: turns examples into code editors that readers can edit and run.
- CodeLab question type (this plugin): programming questions graded with tests on Jobe or the CodeLab runner.
Requirements
- Moodle: 4.5 LTS to 5.3 (PHP as required by your Moodle version).
- tiny_codelab: version 1.13.0 or newer, installed first, with a Jobe server or the CodeLab runner in its settings.
Privacy
Answers are stored like any quiz answer. Programs and their input are sent to the server set by the administrator (Jobe or the CodeLab runner, own or hosted) to be compiled and run. The plugin implements the Moodle Privacy API.
Developed by Boban Blagojević. Languages: English and Serbian (Latin and Cyrillic).
Source, documentation and issue tracker:
github.com/blagojevicboban/moodle-qtype_codelab
Licensed under the GNU GPL v3 or later.