Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating an online judge from scratch

I've participated in a few online programming contests and found the online judges used quite remarkable in functionality.

Coming to the point of the topic, my college is also about to hold an online programming contest and I'm in charge of the event. I was evaluating my options for implementing an online judge. Sure I could make use of some already available judges like the one at SPOJ but it struck me that I and a few of my friends can as well try building one. If we fail, we can always fall back on these.

So can anyone please give me some outline or resources as to how do I get about it? It'd be also helpful if I get some idea about how the judges achieve 'sandboxing'. We got about a couple of months in hand.

UPDATE This is the outcome of my effort so far in 2 weeks after asking a couple of more questions on SO itself http://github.com/anomit/loki

like image 387
user108127 Avatar asked Jun 19 '09 19:06

user108127


Video Answer


1 Answers

I am not sure what an online judge is, but I assume it is a piece of software to evaluate programs for correctness.

I would use some build, test and analysis libraries for this. Examples would be Ant, JUnit, and Checkstyle.

You would take the code provided by the participant, and drop it into a file. Use the build tool to compile it.

  • build fails: 0 points
  • build succeeds with warnings 1 point
  • build succeeds without warnings 2 points

Then run some tests, that verify the correctness of the solution.

  • For each test passed: 1 point

Finally run some code analysis utility to judge the quality of the code.

  • minus 1 point for each complaint of the utility

Of course you might want to shift the point values to your needs.

like image 129
Jens Schauder Avatar answered Oct 13 '22 16:10

Jens Schauder