running non-python tests

Re: running non-python tests

by Jim Newton -
Number of replies: 2

Thanks Richard, this template is indeed helpful but there are still some questions in my mind.  The template mixes lots of different things together, and a debutante like me is easily confused.    Can you please comment on what some of the syntax in the template means?


  1. What does "| e('py')" mean?
  2. What does "STUDENT_ANSWER" mean?  It looks like some preprocess is going to substitute here what the student typed in a type-in widget?   Does this work independent of the escaping?  E.g., what if the student code contains """ somewhere? Or what if the student didn't close all parentheses?  Has the system manipulated the student input to add escape characters?  What if that escaping is not compatible with the target language, C# in your case, Scala in my case?
  3. Can I change the template so that the user "attaches/uploads" a file which he has written with his favorite editor?  How can I access the file from the template, and what can I do in the moodle question to allow/require the student to upload a file? test output with test/expected/got headers
  4. The template indicates that it runs ALL tests.  I have a script which compiles and runs all the tests.  What does my script need to do so that it will display separate tests as shown in the image above?
  5. This is perhaps a question about the moodle itself, maybe you can't answer, but my script to run the tests starts by calling "git update" (because from time to time I fix problems in the testing code).  How can the CodeRunner template access my personal reference data or testing code, which has not been installed by the system administrator?
  6. Using the template you provided, which executes my program using ```subprocess.call(...)```, it seems the script communicates with the system by what it prints to stdout and stderr?  How can it communicate the grade the student should get on the assignment.  Is it all or nothing, or can the script somehow communicate partial credit?

Attachment Screenshot 2020-01-20 at 22.21.13.png
In reply to Jim Newton

Re: running non-python tests

by Richard Lobb -

It sounds like you're trying to run before you can walk :)

I'd suggest you start by reading all the documentation. I think most of the questions are answered in there. 

In reply to Richard Lobb

Re: running non-python tests

by Jim Newton -

Could someone consider answering the questions I have posed either by pointing to the relavent section of documentation, or by commenting to the questions which are not answered in the documentation, or where the documentation is unclear?