accidentallygivenfuck's blog

By accidentallygivenfuck, 6 years ago, In English,

Hi all,

Currently I'm trying to write simple online judge. I'm having troubles in manipulating processes, detecting TLE, MLE, ... Maybe you can help me in some way, maybe by providing link to some open source online judge, or answering me here.

Thanks in advance.

EDIT : I mistyped the title Wri**n**ting Online Judge in PHP. I can't believe that I didn't notice :)

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it +10 Vote: I do not like it

Actually I found open source online judges here.

P.S. And what is up with xinlx19948 ?? :D LOL

»
6 years ago, # |
  Vote: I like it +8 Vote: I do not like it

hello, recently we have been making an online judge, for handling of resources we used 'saveexec' with some modifications. look https://github.com/in-silico/utpjudge, to see it. I recomend you look the folder judgebot too.

I hope this will usefull for you.

  • »
    »
    6 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    All the open source online judges I have seen so far are using .sh files. And the one you gave is one of them I think. The problem is .sh files can be runned only by following method in Windows (which is my OS when using PHP):

    shell_exec(file_get_contents("some_sh_file.sh"));
    

    And I think nobody uses it that way. AFAIK common way is :

    exec("bash some_sh_file.sh");
    

    So, I would be grateful if you give me some open source online judge which can be run in Windows.
    Or I will need to replace every exec("bash some_sh_file.sh") to shell_exec(file_get_contents("some_sh_file.sh")) which is realllly hard for someone as lazy as me :D

    EDIT : Actually shell_exec(file_get_contents("some_sh_file.sh")); won't help. I thought shell_exec() runs bourne shell scripts. :|

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +11 Vote: I do not like it

      Hi, really i'm not familiar with php, but i recommend you to separate the judgement of the web app.

      For example, you can provide some web responses for : - Id of problems without veredict. - Get test cases of a problem. - Get constraints of time/memory/.... - Update veredict after judging.

      And so on.

      In this way you don't need execute shell scripts from php, just need send http request from a 'judge bot'. And execute the .sh normally in your pc.

»
6 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Well, I've made an online judge recently for some regional contest. I implemented the judge itself in Python using subprocess ( http://docs.python.org/dev/library/subprocess.html ) to deal with TLE, MLE and the other possible results. That was the first version, that unfortunately did not prevent the server from being attacked by some tricky scripts ( Fork Bomb, System Calls, Writing on files ). So what I'm using now is a really good Sandbox written in C++ and Python that helps to secure the server and detect TLE, MLE, RF( Reserved Function calls ).

You can see it here: http://192.241.241.32/opijudge/#home

»
6 years ago, # |
Rev. 4   Vote: I like it +3 Vote: I do not like it

This answer was intended for this other question, I posted here by error and I can't delete my answer.

I've written a micro judge for a college assignment about web services, consists of two parts, a Web service in PHP and a client written in Ruby On Rails, it's very simple (and naive), but you can create users, create problems, send solutions, process solutions and report AC, WA and TLE.

MicroOJ The client.

MicroOJ_WS The server.

Tested in GNU/Linux.

»
2 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

I have made an online judge for my university RUET. it is totally open source. you can download it from my github : RUET OJ

Demo : View Demo

  • »
    »
    22 months ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    bro! your project was awesome. but if you trying out just 3 features then you will be get good enough price for this. please added. 1. Nth Test Cases, 2. test cases mark distributions about partial marking system and 3.problem marking. please added. Thank You.

    • »
      »
      »
      22 months ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Thanks for your positive feedback. I will try to restart this project

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Great

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    worse code i have ever seen ...