How to change the output result of CodeRunner?

How to change the output result of CodeRunner?

by Zhang Jeremy -
Number of replies: 2

Hello there, I am a complete new beginner of CodeRunner on Moodle. I have downloaded the folder of CodeRunner from Github, but can't really understand how it works because there are so many folders and different files in it.

Here i have a question that what if I want to change the output result of CodeRunner from "Passed all tests" to something like "Passed 5/5 tests" when the code that the student submmit has passed all the 5 tests cases. And what if I want to change the result to "Passed 4/5 tests" when the code only passes 4 of the 5 tests cases.

I just have no idea of how and where to change the code of CodeRunner, can you give some help on how to do it or where or how I can try to understand the code?

In reply to Zhang Jeremy

Re: How to change the output result of CodeRunner?

by Richard Lobb -
Changing the feedback for a question should by done by the question author, not by altering the CodeRunner code.

I suggest you just install CodeRunner out of the box if you don't already have it, then write a few questions to get a feel for the question authoring form. Then read through the documentation and work your way up to writing questions that use Combinator Template Grading. That sort of question gives you complete control over the feedback, including arbitrary HTML or even images. 

This approach allows you to define your own question types, such as python3_with_feedback that delivers any sort of feedback you like.

But note that even out of the box you can allocate partial marks to each test case if you turn off all-or-nothing grading. There's a checkbox for that. Students will see ticks by the questions they pass and crosses by the ones they fail and their mark will be the sum of all passed tests. If you give 1 mark for each test, they'll get a mark like 4 marks out of 5 if they pass 4 of the tests, which would more or less give you what you want, wouldn't it?



In reply to Richard Lobb

Re: How to change the output result of CodeRunner?

by Zhang Jeremy -
Thanks for replying! So I guess that I should change the code of template in the customisation part in order to change the feedback string from "Passed all tests" to something else? And the code of template is written in a php template called "Twig"?