CodeRunner as an inline compiler ?

CodeRunner as an inline compiler ?

by Pierre FACON -
Number of replies: 11

Hello,

Sorry for double posting the previous question.

Does CodeRunner can be used as an lineline compiler ?

For example, can we write a program, let the server makde ir's job, and get the response, without comparing the result with any test case ?

Simply replacing fo example Eclipse by CodeRunner ?

Thank you 

Pierre, France

In reply to Pierre FACON

Re: CodeRunner as an inline compiler ?

by Richard Lobb -

I don't think I understand the question well enough to answer it properly. Can you give a more specific use case, please?

A few general comments that might be relevant:

  1. CodeRunner is a Moodle question type, so fundamentally has to come up with a mark. The teacher may of course choose to ignore that mark.
  2. The mark is usually obtained by comparing the program's output with the expected output from the set of test cases.
  3. There is always a result table, showing a row for each test case except when using a combinator template grader. Test cases are then unnecessary and the combinator template grader code may not even choose to display a result table. It might just output some html.

I have written a question that simply invites students to plot a graph using python+matplotlib. There are no test cases and no result table - simply the output from the program (text + graph). Whatever the student does gets a mark of 100%. But questions of this sort do require extensive understanding of CodeRunner. Check out the documentation.

In reply to Richard Lobb

Re: CodeRunner as an inline compiler ?

by Pierre FACON -

Hello Richard,

Very kind of you for this reply.

We want to use CodeRunner both for Evaluate our students (CodeRunner is for us a good response), and we would like to use CodeRunner a a compiler, and simply receive on a console (or equivalent) the output of the program.

Here is a simple example below , here we entered "RodeRunner" in input variables, and just have the console output.

Our question is : is it possible easily to do it with CodeRunner , or do we have to use another solution for it (for example Sphere Engine).

Very kind of you for Reply !

Pierre

Paris, France

example of eclipse simple program runn and it's output

In the documentation, you wrtite :

"A per_test_template is essentially a program with "placeholders" into which are inserted the student's answer and the test code for the test case being run. The expanded template is then sent to the sandbox where it is compiled (if necessary) and run with the standard input defined in the testcase. The output returned from the sandbox is then matched against the expected output for the testcase, where a 'match' is defined by the chosen validator: an exact match, a nearly exact match or a regular-expression match."

Is it possible to send the program to the sandbox, to compile it, and simply return  the output, without checking with the testcases ?

Thanks too much for help!

Pierre

In reply to Pierre FACON

Re: CodeRunner as an inline compiler ?

by Richard Lobb -

Certainly you can have a question that has no test cases and just runs the student's code, displaying the output. See the example below. In your example, though, you seemed to be passing command line arguments to the run and that requires two separate entry fields - one for the code to be run and one for the command line arguments. Then there's the question of providing standard input - which seems to require an additional input field (which would have to be preloaded as CodeRunner can't do an interactive run). In the example below I allow standard input via a file attachment but that's a bit clumsy.

You use use the Table UI instead of Ace to enter the three things separately but then the student would have just a raw text field rather than a proper code editor for entering their code. 

I'm still not totally clear what your use case is, but my guess is that there are probably better tools for the job than CodeRunner which is primarily designed simply as a quiz question type, not an IDE.

An example of a job-runner question.

In reply to Richard Lobb

Re: CodeRunner as an inline compiler ?

by Pierre FACON -

One again, very kind of you for your  reply.

Our use case is to create, under moodle, online training with videos, theorical parts, sketches, and the possibility for people  :

1 to compile some easy programs -without assessment- and without leaving moodle to go to eclipse, just to see if the code is running and printing what they want

2 to assess people and evaluate then at the end of each chapter.

I belive that we can do it with coderunner.

But i don't how to go to the page you gave me, 

"write a program of yout choice" 

What "coderunner question  type" do i have to take in order to have your UI ?

Or is there any other menu to choose ?

Thanks a lot.

Pierre, Paris


In reply to Richard Lobb

Re: CodeRunner as an inline compiler ?

by Pierre FACON -

Hello Richard,

I found that "multilanguage" test case alllows to create the program you want.

But the system obliges me (mandatory) to create at least one test case.

How to i do ?

Another question : may we create javascript programs, because except node.js, javascript is not proposed.

Thanks a lot !

You are big help

Pierre

In reply to Pierre FACON

Re: CodeRunner as an inline compiler ?

by Richard Lobb -

Sorry, I should have explained that the image I showed was of a custom question type that I wrote just to show what was possible. I attach an export of that question type (program_runner) and the example test that uses it. This question type has had negligible testing and probably has bugs - you'll have to learn about custom question types to fix them and/or customise the question type further to fit your needs :)

Neither the multilanguage question type nor the attached program_runner question type support JavaScript out of the box but you can add any languages you want to those question types by editing the prototype. You simply add the language to the list of languages in the Advanced Customisation Ace language entry field and then add an appropriate block of code to the template to handle the added language. Although when I say "simply" I mean that it's easy once you know what you're doing! 

Note that nodejs is part of the standard Jobe install so you won't need to update Jobe to use it.

In reply to Richard Lobb

Re: CodeRunner as an inline compiler ?

by Pierre FACON -

Thank you very much Richard !

In order to create my own question types, can you tell me what is the best documentation to read, best resources ?

Thanks you so much for help

Pierre

In reply to Pierre FACON

Re: CodeRunner as an inline compiler ?

by Richard Lobb -

HI Pierre.

I'd suggest you start with my youtube video on creating your own question types.

Then you should check out the documentation: firstly the section on the architecture of CodeRunner, then the section on user-defined question types.

Lastly, there's a lot of in-line help in the question authoring form, available by clicking the various question-mark icons, in particular: Customisation/Grading and Advanced customisation/Prototyping.

Combinator template graders are the most difficult examples of all, unfortunately, and the example I sent you is one of those. I hope to get around to making a video about those in the next few weeks, as they're invaluable. See the documentation section on grading with templates. Studying the template code in the example prototype I included in the last posting should help a lot.

Have fun!

Richard


In reply to Richard Lobb

Re: CodeRunner as an inline compiler ?

by Pierre FACON -

Hello Richard,

I tried new question type you sent me, but ad that response, shown below.

(cpu time exceeds max allowed)

Can you help ?

Another question :

Do you "sell" your help for projects ? is it possible to have an customer/supplier agreement ?

Thanks a lot !

Pierre


Attachment error.png
In reply to Pierre FACON

Re: CodeRunner as an inline compiler ?

by Richard Lobb -

Sorry, the xml question I sent you has the line

    <cputimelimitsecs>120</cputimelimitsecs>

which is more than the default Jobe server allows.  [I have increased the time on our Jobe server so the question works as-is for me.]

To fix, open the prototype in Moodle, expand the "Advanced customisation" panel and edit the Sandbox TimeLimit (secs) field to, say, 30.

Advanced customisation panel

Note that the actual question timeout is managed within the prototype, defaulting to 10 secs, but settable via a template parameter. The sandbox timeout has a different role: if it's exceeded, the job is abruptly terminated, with no chance to return its results to CodeRunner. It protects against faulty prototype code.

Thanks for the offer of some sort of payment, but for small things like this it's not worth accounting for my time, income tax etc.

Richard

In reply to Richard Lobb

Re: CodeRunner as an inline compiler ?

by Pierre FACON -

Thanks for helps,

It's running.

Pierre from Paris