Блог пользователя accidentallygivenfuck

Автор accidentallygivenfuck, 11 лет назад, По-английски

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 :)

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
11 лет назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Actually I found open source online judges here.

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

»
11 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

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.

  • »
    »
    11 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    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. :|

    • »
      »
      »
      11 лет назад, # ^ |
        Проголосовать: нравится +11 Проголосовать: не нравится

      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.

»
11 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

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

»
11 лет назад, # |
Rev. 4   Проголосовать: нравится +3 Проголосовать: не нравится

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.

»
7 лет назад, # |
Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

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

  • »
    »
    7 лет назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    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.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +2 Проголосовать: не нравится

    worse code i have ever seen ...