MetalUp / Express

Integrated Learning Environment
1 stars 0 forks source link

Change whole approach to wrapper class #109

Closed richardpawson closed 1 year ago

richardpawson commented 1 year ago

At present:

Next version:

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

print (display(<Expression>))

<StudentCode>

<HiddenCode>

<Helpers>

<Tests>
richardpawson commented 1 year ago

Completed