Creating programming questions using the Coderunner question type
Coderunner is a question type in the TeachCenter that allows students to write programme code, which is then graded depending on whether it passes previously defined test cases.
Please note: Coderunner is currently only available in the TeachCenter, not in TeachCenter Exam, because we have not collected enough data about its stability in exam settings yet.
CodeRunner supports the following languages: Python2, Python3, C, C++, Java, PHP, Pascal, JavaScript (NodeJS), Octave and Matlab (as of December 2024).
Coderunner is a question type in the TeachCenter, which means it can only be used within a quiz activity.
Students will always see a ‘Check’ button on Coderunner questions, which they can click to see if their code passes the predefined test cases. Students can submit their solution multiple times, usually for a point deduction.
To ensure that students are shown all the necessary information, the developers recommend setting certain options in the ‘Review options’ of the quiz settings:
Specific feedback: shows the table of test cases and whether they were passed. This view is enforced by Coderunner by default, even if it is deactivated in the test settings. You can reset the value to the test settings directly in the Coderunner question.
Right answer: shows the model answer. Deactivate this checkbox if you do not want students to see your model answer.
Whether correct: This checkbox should be deactivated if your quiz contains other questions than Coderunner questions, and you would not like students to directly see the correct answers to these questions. The non-hidden test cases of Coderunner questions are displayed in any case.
Review options for a Coderunner quiz used for practice, with points and feedback visible
Create a new quiz, go to an existing quiz or to the question bank to create a new question.
Choose the Coderunner question type and click Add.
Add Coderunner question
Question type: Choose the programming language. For a detailed description of the question types, see Github.
Answer box: Choose the size of the answer input field.
Precheck: deactivated by default. Precheck lets students check the test cases you have labelled as example before submitting their final answer. No points are deducted if the precheck does not pass test cases.
Stop button: Decide whether students can stop running the code.
Feedback: the default is "force show", which means that by default, students always see a table with the test cases and whether they have passed when they click "Check". If you want to hide this table completely, you can do that here. However, students will not be able to see the table of test cases and whether they have passed any at all. There is a different setting for "secret", hidden test cases in the interface for creating a test case.
Marking: Choose here how the question will be graded, e.g. all or nothing - all test cases must be passed to receive points.
Template params: empty by default. See the Github documentation for detailed instructions on how to use advanced features like templates.
Basic settings of Coderunner question
Add the question title and a question text / instructions.
Answer: Enter the expected model answer here. The input is tested for validity automatically. This is also the sample answer students might see if activated in the test settings.
Answer box preload: If the answer box should already contain code snippets or text, enter it here.
Test cases: Define test cases and their expected output here. Use as example: These test cases are shown to students as part of the instructions, including their expected answer.
Adding test cases and example test cases
Display: This setting allows you to hide test cases for students, in which case they would only see whether they have passed it or not, but not the test case itself.
In support files, you can provide additional documents to students.
Click save changes and continue editing to stay on the page and be able to start a preview.