CodeRunner

Question types ::: qtype_coderunner
Maintained by Richard Lobb, TimTim 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:
3451 sites
1k downloads
136 fans
Current versions available: 4

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 http://coderunner.org.nz


Potential privacy issues

None that I'm aware of.

Screenshots

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

Contributors

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

Comments RSS

Show comments
  • Ravi Shankar Singh
    Fri, Jun 30, 2023, 5:59 PM
    Hi I am not able to install coderunner in moodle version 4.1 so can any one help me out how can I install this plugin?
  • Richard Lobb
    Sat, Jul 1, 2023, 7:17 AM
    @Ravi Shankar Singh: Please specify the series of steps you have taken to install CodeRunner and give details on what goes wrong.
  • Mystic Robo
    Wed, Sep 27, 2023, 6:36 PM
    I installed coderunner on Moodle 4.2 and I even installed the jobe server. I can confirm that the jobe server is running, but whenever I add a new question using coderunner and I try to save my question the "answer" field will diplay "Failed to run tests". Is there a fix for this, should I downgrade my moodle?
  • Richard Lobb
    Thu, Sep 28, 2023, 5:14 AM
    Coderunner V5.2 works fine with Moodle 4.2. You probably have an issue with the Moodle HTTP security settings or a networking problem of some sort. I've posted some things to try on this coderunner.org.nz forum Failed to run tests: https://coderunner.org.nz/mod/forum/discuss.php?d=637. Please respond there.
  • Mystic Robo
    Thu, Sep 28, 2023, 11:42 AM
    Thank you @Richarb Lobb, turns out it was because all outgoing curl requests were blocked in the Http security settings. Thank you so much, I'm really grateful to you
  • Iroshini Ratnapala
    Wed, Dec 13, 2023, 2:37 PM
    Thank you for the great tool. I am going to install it in our Faculty Moodle site.
  • Gus Hagelberg
    Wed, Jul 3, 2024, 9:39 PM
    Any dates about updating the plugin to Moodle 4.4?
  • Owain Jones
    Mon, Jul 8, 2024, 4:10 AM
    Has anyone tried installing CodeRunner on Moodle 4.4, by downloading it and then installing it? If so, how is it working? Thanks!
  • Richard Lobb
    Fri, Jul 12, 2024, 11:10 AM
    I've run the CodeRunner test suite for both the master and the development branch on Moodle 4.4 + PHP 8.1. Both are giving clean runs. I've also run the bulk tester with the development branch on the 1600-odd questions in our introductory Python programming course and while there are several failures they're just related to things like pylint and timeouts - nothing that suggests any issues with CodeRunner + Moodle 4.4. So although we haven't used CodeRunner with Moodle 4.4 on a production server I think it's unlikely that there are any significant issues.
  • Stuart Hector
    Fri, Jul 12, 2024, 12:52 PM
    Also interested in when it may be available for Moodle 4.4
  • Richard Lobb
    Fri, Jul 12, 2024, 4:42 PM
    For those asking about Moodle 4.4, please see https://coderunner.org.nz/mod/forum/discuss.php?d=697. Though if you're in a real hurry, you could just pull the master branch from github - see above.
  • Andreas Schenkel
    Mon, Sep 9, 2024, 3:11 PM
    The versions V5.2.2, V5.3.0, V5.4.1 in github are not puplished on moodle.org. So I do not know which would be the best version to use. Should I use Version V5.2.1 from moodle.org-page or master-Branch with Version V5.4.1?
  • Richard Lobb
    Tue, Sep 10, 2024, 4:30 AM
    Sorry about the delay in updating moodle.org. We're about to do so. We merged the development version into master and pushed to github 4 days ago, as v5.4.1. We're now running that version on our production server. We like to run new versions on our production server for a full week before publishing them on moodle.org. So unless a significant issue is found in the next few days (very unlikely) we will publish v5.4.1 at the end of this week. I think you can safely use that version.
  • Thomas Reggelin
    Mon, Nov 11, 2024, 11:18 PM
    First of all - THANKS!!! This tool is great and I'm glad this module is added to the LMS for schools in Hamburg.
    I tried to write an own template grader and in general it is working as I print "print(json.dumps({"fraction":points, "got": output, "abort": False, "comment": comment}))".
    If i try to avoid error messages in the pre_check I don't know what to print? I do think, I've overseen some important hints in the documentation and I'd be pleased to get some help.
  • Richard Lobb
    Tue, Nov 12, 2024, 7:25 AM
    That's a great question, thanks. It seems I hadn't documented the Precheck functionality very well at all. So, I've just added a new section to the documentation and reported on it in the question author's forum on coderunner.org.nz (which is the best place to post queries of this sort). See https://coderunner.org.nz/mod/forum/discuss.php?d=718
1 2 3 4 5 6
Please login to post comments