Great, thanks Mark.
Since I last posted, I have been working on the latest release of CodeRunner and decided to include a folder of unsupported question types. I included an updated version of the dotnet C# file I posted to this thread earlier. It includes some functionality refinements and three template parameters; its documentation is as below.
I'd like to include your write-a-function version in the folder too, if that's ok? I'd add attribution at the start. But I wonder if you'd first like to extend it to include the extra functionality I've since added to the write-a-program question?
One other thing: did you notice that the question type can be sped up by building a template project on the Jobe server? This is documented within the prototype itself as:
Performance is also significantly improved (~ 1 sec less build
time) if a template project is built at location /home/jobe/dotnettemplate
by commands such as
sudo bash
mkdir /home/jobe/dotnettemplate
cd /home/jobe/dotnettemplate
dotnet new console --use-program-main
-- Richard
========================================
CodeRunner question type: csharpdotnet
A prototype for a C# question type that tests a C# "write-a-program" question using the dotnet framework. It runs all tests in a single Jobe run with a single compilation using a Combinator Template Grader.
Template parameters:
total_time_budget: the maximum time allowed (seconds) for the entire testing of the question (the compilation time plus all tests). Should be at least 1 second less than the maximum time limit set by the Jobe server, which is usually 50 secs. Default: 10.
per_test_timeout: the maximum time allowed (seconds) to run any one of the tests. It does not include the compile time, as compilation is done before the various tests are run. Default 3.
warnings_are_errors: true to treat any warning messages as errors. Otherwise, warnings are not displayed to the user unless there are also errors present. Default: true.
Example template parameter: {"total_time_budget": 20, "per_test_timeout": 5}
WARNINGS:
- You will need to have installed the dotnet package on your jobe server (sudo apt-get install dotnet-sdk-8.0).
- For improved efficiency, you should also install an empty console project at /home/jobe/dotnettemplate; see the template for the required terminal commands.
- This question type has had hardly any testing and has never been used in a production environment.
- Performance is very poor, because it takes around 2 seconds to compile a C# program. Hence, use of this question type in a test or exam is likely to overload the jobe server except with very small classes or when you have a large pool of Jobe servers.
- Dotnet does not play well with the usual Jobe 'ulimit' resource limitations, so the memory limit and disklimit (amount of disk i/o) have both been disabled. It is potentially possible for a rogue task to disable the Jobe server by exceeding these limits, although the watchdog timer should kill the job within around 10 seconds and the server should then recover. This theory has not been tested in practice.