For each language there are three separate 'wrappers' (class, explicit module or implicit module)
Next version:
The class will know nothing about the wrappers and, indeed, nothing about programming language.
It will make one of three API calls (in relation to code) to the Admin server: EvaluateExpression, SubmitCode, RunTests, passing up the necessary code entered by the user in the Input and/or Code panes (see #112), and the TaskId
The Admin server will do the wrapping, based on a single wrapper definition.
This wrapper code will be defined on the (new) Language object (see #115).
The new single wrapper could look like this
C
using static Wrapper.HiddenCode;
using static Wrapper.Helpers;
public class Wrapper
{
static void Main() {
System.Console.WriteLine(Display(<Expression>);
}
<StudentCode>
<HiddenCode>
<Helpers>
<Tests>
}
Note that in the StudentCode, functions or classes do not need to be declared public. The test runner also finds and runs the tests OK even though the Tests class is now defined within the Wrapperclass.
VB
Slightly different, as I do want the hidden functions to be loaded into the Task as Module, this module should be at peer level with the Testsclass, so I think it is clearest to also put the StudentCode (functions) into its own module at the same level
Module Program
Public Sub Main
Console.WriteLine(Display(<Expression>))
End Sub
End Module
<HiddenCode>
<Helpers>
Public Module StudentCode
<StudentCode>
End Module
<Tests>
Note that Imports (equivalent to the static usings) will need to be defined at project level
Python
This is easiest and the same as before: the Tests class, the hidden functions, and user code are all simply appended into one file, with no need for any code around it
At present:
Next version:
The new single wrapper could look like this
C
Note that in the StudentCode, functions or classes do not need to be declared
public
. The test runner also finds and runs the tests OK even though theTests
class is now defined within theWrapper
class.VB
Slightly different, as I do want the hidden functions to be loaded into the Task as Module, this module should be at peer level with the
Tests
class, so I think it is clearest to also put the StudentCode (functions) into its own module at the same levelNote that Imports (equivalent to the static usings) will need to be defined at project level
Python
This is easiest and the same as before: the Tests class, the hidden functions, and user code are all simply appended into one file, with no need for any code around it