Question Authors' Forum

Running C# in CodeRunner

Picture of Martin Zwerschke
Re: Running C# in CodeRunner
by Martin Zwerschke - Monday, 18 December 2017, 1:48 AM

Hi Richard,

although I am still interested in keeping the ideone-sandbox support alive or even adding a rextester-support, I started to
experiment with  jobe server as well.

As I noticed, the canterbury ouside jobe-server does not have Mono installed, so I could not test the C#-template instantly.

For getting into things, I installed my own jobe-server on an outdate private PC.

I finally got everything to run, and your C# template works.

But I noticed some problems and questions on my way :

  • Why exactly do you suggest to implement C# by a python3 script instead of adding it as an additional language to the jobe server?
    Wouldn't that make things easier?
  • Concerning the documentation of jobe, securing the jobe server as suggested is not possible using the given ufw-commands in my scenario:
    ufw default reject outgoing
    ufw allow out proto tcp to <some_useful_ip> port 80,443
    ufw allow in 22/tcp
    ufw allow in proto tcp to any port 80 from <your_client_ip>
    ufw enable
    Have I understood  correctly, that the ufw firewall to configure is the ufw on the jobe server? Or do you mean ufw on a separate firewall PC or a PC that is run as an internet router? Perhaps documentation could be clearer on this. I suggest a draft of the scenario for that the securing commands are valid.
    I guess <some_useful_ip> means the IP of our single (rented) moodle-server  and <your_client_ip> stands for the IP of my private jobe-server in my scenario. Perhaps that could be made clearer as well.

    My jobe server has got a private IP type 192.168.x.x as a reserved DHCP-lease given by the DSL-Router (a AVM-Fritz-Box in my case), which also serves as a NAT for the clients inside my LAN.
    The DSL-Router gets a dynamic IP from my DSL-provider. To be reachable from the Moodle-server I had to use a (free) DDNS-Service, that is updated regularly by the router and the DDNS service refreshs the DNS-subdomain for that.
    Inside the router's configuration I had to open an incoming port 80 to my jobe's 192.168.x.x-IP
    Yet the ufw commands do not support DNS names, but only fixed IPs.
    The Moodle server is a rented server and seems not to have a fixed IP as well, as I noticed this morning.
    The Server-IP shown inside the Moodle's Server-administration "php-info" has changed since yesterday.
    The moodle is reachable by it's DNS-name, not by a fixed IP-address.
    Thus I can not fill in the <some_useful_ip> field as well, nor in the ufw of my jobe server nor in the DSL-Router,
    that can not open a port for a special IP anyway, just open it for ouside access in general.

    Is it right, that opening in 22 tcp is only necessary, if the jobe server is not accessible physically with a mouse/keyboard and screen?

  • The C#-template seems not to include arguments for the mcs-compiler like the c-via-python-template does.
  • Special chars like 'ä' are not possible inside a C#-program - but that's a known bug already
  • Is there a way to inject keypresses as parts of the test cases? I tried to create a question using the C#'s Console.ReadKey()-command,
    but that could not work out, because the "stdin" only contains a string of chars, no key events.
  • You wrote:

      >For other question types, such as "write-a-C#-method", you will have to wrap the student submission in some extra code,

      > including that supplied in the >>{{TEST}} variable. If you need help with that, post back here.
      Could you please add a template for that? 
      How would a combinatator-question-template be done by the way?
      (I am not so sure to have understood the concept of that mechanism any way...
      Perhaps  a screenshot of a combinator-question in question author's and student's view would help.
      What exactly is the purpose of the cryptic SEPARATOR-string and why does it have to by customizeable?)