running code that is NOT student code

running code that is NOT student code

de Jim Newton -
Número de respuestas: 4

Can I use CodeRunner for a different use case.    I want to create a question which gives the student an input file, and ask the student to write a program (in any language) which manipulates this data and produces a particular output file.  I want the student to then upload the output file.  I'd like CodeRunner then to check his answer by running a script which I have pre-specified, to determine whether his uploaded file is correct.

This *could* be interpreted as "compile the file the student uploaded".

En respuesta a Jim Newton

Re: running code that is NOT student code

de Richard Lobb -

It would seem most natural to use the multilanguage question type and get the student to submit their code, with you supplying the input data file as a support file to the question.

However, if you'd prefer to let students run the program offline you can write a question (with attachments enabled) where the student enters something arbitrary into the answer box (e.g. a comment, or a name and date) and attaches their output file. Your customised template code can then do what it likes with the supplied student file and print OK if it's correct or suitable error messages otherwise.

En respuesta a Richard Lobb

Re: running code that is NOT student code

de Jim Newton -

It seems like what I want is the grader template to process the students attached file, and print a json string to stdout something like this:

{'got': ..., 'comment': ..., 'fraction': ...}

As I understand the 'got' and 'comment' fields are allowed to have as many linefeeds as necessary. Is that correct? And this should create output like the following:



En respuesta a Jim Newton

Re: running code that is NOT student code

de Jim Newton -

However, it is still not clear for me, even after reading the documentation, how to setup a question like this.   Basically it should look like this:

1) display the question for the student, providing possible files he can download.

2) allow the user to upload a file containing his answer.

3) run an external program specific to this question (not written in python) which accesses the students uploaded file, grades the students answer contained therein, and then prints a json string describing the grading.


It seems to me that this ought to be pretty easy for the teacher to setup.   Right?