Question types ::: qtype_coderunner
Maintained by Richard Lobb, Tim at Lone Pine Koala SanctuaryTim Hunt
A question type that allows question authors to set programming questions in which the student answer is code in some programming language, which is graded by running it. More generally it can handle any question to which the answer is text that can be graded by a computer program written by the question author.
Latest release:
2116 sites
92 fans
Current versions available: 3

CodeRunner is a Moodle question type that allows teachers to run a program in order to grade a student's answer. By far the most common use of CodeRunner is in programming courses where students are asked to write program code to some specification and that code is then graded by running it in a series of tests. CodeRunner questions have also been used in other areas of computer science and engineering to grade questions in which many different correct answers are possible and a program must be used to assess correctness. 

Regardless of the behaviour chosen for a quiz, CodeRunner questions always run in an adaptive mode, in which students can click a Check button to see if their code passes the tests defined in the question. If not, students can  resubmit, typically for a small penalty. In the typical 'all-or-nothing' mode, all test cases must pass if the submission is to be awarded any marks. The mark for a set of questions in a quiz is then determined primarily by which questions the student is able to solve successfully and then secondarily by how many submissions the student makes on each question. However, it is also possible to configure CodeRunner questions so that the mark is determined by how many of the tests the code successfully passes.

CodeRunner has been in use at the University of Canterbury for over seven years, running millions of student quiz question submissions in Python, C , JavaScript, PHP, Octave and Matlab. Laboratory work, assignment work and mid-semester tests in the introductory first year Python programming course (COSC121), which has around 650 students in the first semester and 350 in the second, are all assessed using CodeRunner questions. The final exams for COSC121 have also been run using Moodle/CodeRunner since November 2014. Other courses at the University of Canterbury using CodeRunner include:

  1. ENCE260 Computer Systems
  2. ENCN305 Programming, Statistics and Optimisation
  3. EMTH171 Mathematical Modelling and Computation
  4. SENG02 Software Engineering I
  5. COSC261 Formal Languages and Compilers
  6. COSC 262 Algorithms
  7. COSC367 Computational Intelligence
  8. ENCE360 Operating Systems
  9. SENG365 Web Computing Architectures

CodeRunner is also being used at over 600 other sites worldwide.

CodeRunner currently supports Python2 (considered obsolescent), Python3, C, C++, Java, PHP, JavaScript (NodeJS), Octave and Matlab. The architecture allows easy extension to other languages.

CodeRunner can safely be used on an institutional Moodle server, provided that the sandbox software in which code is run ("Jobe") is installed on a separate machine with adequate security and firewalling. However, if CodeRunner-based quizzes are to be used for tests and final exams, a separate Moodle server is recommended, both for load reasons and so that various Moodle communication facilities, like chat and messaging, can be turned off without impacting other classes.

The CodeRunner question type can be installed on any modern Moodle system (version 3.0 or later), on Linux, Windows and Mac. For security reasons submitted jobs are run on a separate machine called the "Jobe server" or "Jobe sandbox machine". CodeRunner is intitially configured to use a small outward-facing Jobe server at the University of Canterbury, and this can be used for initial testing.  However, this is not suitable for production use, for which institutions will need to install their own Jobe server. Instructions for installing a Jobe server are given in the Jobe documentation. Once Jobe is installed, use the Moodle administrator interface for the CodeRunner plug-in to specify the Jobe host name and perhaps port number.

A single 4-core Moodle server can handle an average quiz question submission rate of about 60 quiz questions per minute while maintaining a response time of less than about 3 - 4 seconds, assuming the student code itself runs in a fraction of a second. We have run CodeRunner-based exams with nearly 300 students and experienced only light to moderate load factors on an 8-core Moodle server. The Jobe server, which runs student submissions (see below), is even more lightly loaded during such an exam.

The full documentation for CodeRunner, together with forums, questions banks and other resources, is at

Potential privacy issues

None that I'm aware of.


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7
Screenshot #8


Richard Lobb (Lead maintainer)
Tim at Lone Pine Koala Sanctuary
Tim Hunt: Co-developer from December 2016
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Sat, Jun 20, 2020, 5:08 PM
    I installed coderunner in Moodle 3.4.
    I upgraded to 3.8 with no issues
    However when I upgraded to 3.9 It showed coderunner along with several other plugins to be missing on disk errors and would not continue the installation. At that point of time i thought on uninstalling coderunner and later to reinstall. So I uninstalled coderunner and then the upgrade went fine. Later when I tried to reinstall, it gave that error.
  • Sat, Jun 20, 2020, 5:34 PM
    Can you clarify how you uninstalled coderunner, please? CodeRunner doesn't have an Uninstall button, so how did you do it?
  • Sat, Jun 20, 2020, 5:43 PM
    I removed the coderunner and adaptive folders by moving them elsewhere. That is how I uninstalled. They was no other way. I did not edit anything in the database.
  • Sat, Jun 20, 2020, 6:16 PM
    Doing it again. I reverted to 3.8 backup and with coderunner already installed in 3.8 version i checked out the 3.9 stable branch of moodle. I then restarted the site and it asked to upgrade to 3.9 which I clicked on continue. After that it said:

    2020012500 Additional Missing from disk!

    Similar errors are there for many other plugins including Attendance etc. whiever were not supported for 3.9.

    I clicked then on "Upgrade Moodle Database Now"

    it stppoed at
    Plugin "mod_attendance" is defective or outdated, can not continue, sorry.

    More information about this error

    ×Debug info: Missing version.php
    Error code: detectedbrokenplugin
    ×Stack trace:
    line 750 of /lib/upgradelib.php: plugin_defective_exception thrown
    line 565 of /lib/upgradelib.php: call to upgrade_plugins_modules()
    line 1917 of /lib/upgradelib.php: call to upgrade_plugins()
    line 711 of /admin/index.php: call to upgrade_noncore()

    I removed attendance by removing its older and so on for every plugin including coderunner and then it installed fine.

    Later when i try to reinstall coderunner i get the error I sent earlier.
  • Sat, Jun 20, 2020, 6:31 PM
    This time i installed from github as you said instead of from Moodle plugins. It worked!
  • Thu, Jul 9, 2020, 9:30 PM
    Hello Richard,

    Do you know of anybody that has used the Coderunner plugin with Stata or could you tell me whether it is possible to set it up for Stata?

    Many thanks
  • Sat, Jul 11, 2020, 1:59 PM
    No, sorry Michael. In fact I'd never even heard of Stata until you posted. You could try a posting to the question authors' forum on There aren't a lot of permanent subscribers but it does get lots of Google hits so in time someone might answer. To be honest, though, most Moodle/CodeRunner users want software that's free and open source, so I wouldn't expect a lot of enthusiasm. As to whether it's possible it set CodeRunner up to use it: I'd be pretty confident the answer is yes but it would require a high level of CodeRunner expertise, particularly if you want to be able to deal with charts and graphs. You could start by reading how to interface to new languages at
    If you want to get back images, see (though that doesn't let you grade them - just look at them).
  • Wed, Jul 15, 2020, 6:42 PM
    Hello fellow educators,

    Can anyone help me fix the CodeRunner Question Type? it does have the drop down choices of programming languages.
    it will only display --> Undefined

    Thank you in advance!
  • Thu, Jul 16, 2020, 5:51 AM
    Could you post your question to the question authors' forum on, please, detailing the steps required to replicate the problem.
  • Sudeep
    Mon, Jul 20, 2020, 10:52 PM
    Can we add another programming language in this plugin like Sphere Engine?
  • Tue, Jul 21, 2020, 6:43 AM
    Please see If you have further questions, please post them on one of the forums at
  • Sat, Sep 19, 2020, 12:04 AM
    Hello, It's a great plugin and so helpful. How can i add other programming languages to run in CodeRunner?? Like ideone has many other programming languages support.
  • Sat, Sep 19, 2020, 9:51 AM
    Please see If you have further questions, please post them on one of the forums at
  • Sun, Mar 21, 2021, 12:45 PM
    Hi. We're experiencing an issue when attempting to upgrade from v3.7.9+ to v4.0.1, which is that the upgrade process reports a failure to locate the 'Adaptive adapted for coderunner' question behaviour plugin dependency - when in fact this plugin is installed (v1.3.7) and is working fine with v3.7.9+ of CodeRunner. We've attempted the upgrade process several times both via the UI and command line, but always with the same result. Not sure if this is a bug, but any suggestions on how to resolve this would be very much appreciated.
  • Sun, Mar 21, 2021, 4:08 PM
    My apologies Roland. When adding the most recent version of CodeRunner to the repository I forgot that it required an updated version (v1.3.9) of "Adaptive adapted for coderunner", which was available on github but which I hadn't loaded into the repository. I've now added it, so you should be good to go. Please let me know if not.

    Thanks for reporting.
1 2 3
Please login to post comments