Moodle CodeRunner
Scala, Haskell, SQL, Swift and more in CodeRunner
CodeRunner can grade any language its Jobe server runs. The built-in question types cover a handful; for the rest you write a question type of your own, and on your own Jobe you first install the language and fight its limits. Here is what each language takes, and a server where 46 languages already run.
By the OnlineCompiler.io team. Updated .
What CodeRunner has built in
Each built-in question type names the Jobe language it runs. With a Jobe server that has the language installed, these work out of the box:
| Question types | Jobe language |
|---|---|
c_function, c_program | c |
cpp_function, cpp_program | cpp |
java_class, java_method, java_program | java |
nodejs | nodejs |
octave_function | octave |
pascal_function, pascal_program | pascal |
php | php |
python3, python3_w_input | python3 |
sql | python3, calling the sqlite3 program |
Anything else needs a user-defined question type (a prototype) whose Sandbox language names
the language. CodeRunner's documentation recommends driving new languages from a python3 template
that calls the compiler, which works when the language is installed on the same Jobe server.
What it takes on your own Jobe
On a self-hosted Jobe, the language has to be installed, and then it has to fit Jobe's limits:
| Language | What people hit | Thread |
|---|---|---|
| Scala 3 | scala-cli writes to a home directory Jobe users don't have (AccessDeniedException: /home/jobe00/.cache), then the JVM runs out of threads (pthread_create failed). Scala 3 is not in apt. | jobe#92, open |
| Haskell | ghc: failed to create OS thread: Cannot allocate memory, until the memory limit is lifted. | jobe#83 |
| SQL | The built-in sql type needs the sqlite3 command-line program on the Jobe server, and only SQLite is supported. | jobe#41 |
| Octave | Pulls in X and GNOME on Ubuntu unless installed without recommends; libopenblas fails to load under a tight memory limit. | jobe#33, #38 |
| Swift | No Swift-specific advice; the answer was to read the docs on new languages and ask on the forum. | CodeRunner#268 |
| R | Not a Jobe language: install R on the Jobe server and drive it from a python3 template. | CodeRunner#283 |
The usual fix for the JVM languages and Haskell is a higher MemLimit and a numprocs above the default in the prototype's Parameters; for Scala 3 the maintainer also suggested
a longer time limit. Jobe's process errors covers the limits in more detail.
Already installed on a hosted Jobe-compatible server
OnlineCompiler.io answers CodeRunner in Jobe's format and runs 46 languages, each in its own
sandbox with the compiler already installed. Besides Jobe's own ids (c, cpp, java, nodejs, octave, pascal, php, python3), a question type can name any of these as its sandbox language:
| Sandbox language | Runs on |
|---|---|
ada | Ada (GNAT 15) |
bash | Bash (5.2) |
clojure | Clojure (1.12) |
cobol | COBOL (GnuCOBOL 3.2) |
crystal | Crystal (1.22) |
csharp | C# (.NET SDK 10) |
d | D (LDC 1.43) |
dart | Dart (3.13) |
duckdb | DuckDB (1.5) |
elixir | Elixir (1.20) |
erlang | Erlang (OTP 29) |
fortran | Fortran (gfortran 15) |
freebasic | FreeBASIC (1.10) |
fsharp | F# (.NET SDK 10) |
go | Go (1.26) |
groovy | Groovy (6.0) |
haskell | Haskell (GHC 9.12) |
julia | Julia (1.13) |
kotlin | Kotlin (2.4) |
lisp | Common Lisp (SBCL 2.6) |
lua | Lua (5.5) |
nasm | Assembly (NASM 3) |
nim | Nim (2.2) |
objectivec | Objective-C (Clang 21) |
ocaml | OCaml (5.4) |
perl | Perl (5.44) |
powershell | PowerShell (7.6) |
prolog | Prolog (SWI-Prolog 10) |
r | R (4.6) |
racket | Racket (9.3) |
ruby | Ruby (4.0) |
rust | Rust (1.93) |
scala | Scala (3.10) |
sqlite | SQL (SQLite 3) |
swift | Swift (6.4) |
typescript | TypeScript (Deno) |
vbnet | Visual Basic (.NET SDK 10) |
zig | Zig (0.17) |
These answers to "read n and print its square" were each sent through the Jobe API with input 7 on 2 November 2026, and printed 49:
@main def run() =
val n = scala.io.StdIn.readInt()
println(n * n)main :: IO ()
main = do
n <- readLn :: IO Int
print (n * n)let n = Int(readLine()!)!
print(n * n)n = scanf('%d', 1);
disp(n * n)The limits are fixed: 512 MB of memory and up to 16 processes per run, whatever
MemLimit and numprocs say, and the question's time limit up to 30 seconds. Scala
and Haskell run within them without extra settings.
Make a question type for a new language
This makes a haskell_program type: students write a whole program, and each test case gives it
standard input and checks its output. The same steps work for any id in the table above. They follow CodeRunner's documentation on user-defined question types.
- In the question bank where you keep prototypes (a category such as
LOCAL_PROTOTYPES; on Moodle 5, a question bank in the course), add a new CodeRunner question with question typepython3. - Name it, for example
PROTOTYPE_haskell_program. Its question text becomes the description teachers see under Question type details. - Tick Customise. Replace the template with just the student's answer, and untick Is combinator so each test runs on its own with its own standard input: Template
{{ STUDENT_ANSWER }} - Open Advanced customisation. Set Is prototype? to Yes (user
defined), Question type to
haskell_program, Sandbox language tohaskelland Ace language tohaskell. The sandbox language is free text and must match the server's id exactly. - Save. New questions can now choose
haskell_programas their question type; give each test case a Standard input and the Expected output.
CodeRunner's documentation adds a few rules: don't edit or copy the built-in prototypes, which are replaced on upgrade; export a prototype together with the questions that use it, because deleting it breaks them with "missing prototype"; and test cases on a prototype are not inherited by its questions.
SQL questions
The built-in sql question type is a python3 template that runs the sqlite3 command-line program. Attach exactly one .db file to the question as a support
file; for each test, the template copies a fresh database, then runs the test's extra commands, the student's
query and the test code, and shows the result in sqlite3's column mode. A server needs both Python and the sqlite3 program for this, and OnlineCompiler.io's Python sandbox has both.
For SQL that sets up its own tables, a user-defined type can use sqlite (SQLite 3) or duckdb as its sandbox language instead; the answer then runs as a script against an empty
database.
Keep your Jobe, send only some languages elsewhere
CodeRunner reads jobeserver and jobeapikey from a question's Parameters (under Advanced customisation), and a prototype passes its parameters on to the
questions built on it. So a lecturer can send just one question type, or one course, to another server without
changing the site settings:
{"jobeserver": "https://api.onlinecompiler.io/api", "jobeapikey": "YOUR_API_KEY"}We tested this on 2 November 2026 with Moodle 4.5 and CodeRunner 5.10.9: on a site whose own Jobe server was unreachable, a question with these parameters graded a right answer as right and a wrong one as wrong. The key sits in the question, so anyone who can edit or export it can read it; create a separate key for it on your API keys page, and deactivate it when you're done.
Get started
For a whole site, set CodeRunner's Jobe server to https://api.onlinecompiler.io/api and its Jobe API key to an OnlineCompiler.io API key; for one course, use the parameters above. The free
plan includes 100,000 runs a month. CodeRunner without a Jobe server has the full
setup and a first question, and the Jobe-compatible API page lists every difference from
Jobe, including that the built-in multilanguage type doesn't work. For questions to start from, the free CodeRunner question packs cover Python, Java, C and C++ with
CodeRunner's built-in types.
Frequently asked questions
Can CodeRunner grade Haskell, Scala, Swift, Go or Rust?
Yes, with a user-defined question type whose sandbox language is that language's id, and a Jobe server that runs it. OnlineCompiler.io's Jobe-compatible server runs 46 languages, including haskell, scala, swift, go and rust.
Why does a custom question type say the language is not known?
The Sandbox language field is free text and must match an id the Jobe server lists at /jobe/index.php/restapi/languages exactly. Check the spelling against the table on this page, or against that list on your own server.
Do CodeRunner SQL questions work without installing sqlite3?
The built-in sql question type runs a Python template that calls the sqlite3 command-line program, so the server must have it. OnlineCompiler.io's server does. Each question needs exactly one .db file attached as a support file.
Can I keep my own Jobe server and use another one for some languages?
Yes. CodeRunner reads jobeserver and jobeapikey from a question's Parameters, so a prototype with {"jobeserver": "https://api.onlinecompiler.io/api", "jobeapikey": "..."} sends only its questions to that server, without changing the site settings.
Do MemLimit and numprocs settings apply on the hosted server?
No. Every run there has 512 MB of memory and up to 16 processes, whatever the question says, and the time limit is the question's, up to 30 seconds. Scala and Haskell run within those limits without changes.