Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

### accidentallygivenfuck's blog

By accidentallygivenfuck, 7 years ago, ,

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.

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

• 0

 » 7 years ago, # |   +10 Actually I found open source online judges here. P.S. And what is up with xinlx19948 ?? :D LOL
•  » » 4 months ago, # ^ |   0 Not able to see the blog https://codeforces.com/blog/entry/6529
 » 7 years ago, # |   +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.
•  » » 7 years ago, # ^ | ← 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 :DEDIT : Actually shell_exec(file_get_contents("some_sh_file.sh")); won't help. I thought shell_exec() runs bourne shell scripts. :|
•  » » » 7 years ago, # ^ |   +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.
 » 7 years ago, # |   +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
 » 7 years ago, # | ← 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.
 » 3 years ago, # | ← 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 OJDemo : View Demo
•  » » 2 years ago, # ^ |   +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.
•  » » » 2 years ago, # ^ |   +8 Thanks for your positive feedback. I will try to restart this project
•  » » 16 months ago, # ^ |   0 Great
•  » » 9 months ago, # ^ |   +2 worse code i have ever seen ...
•  » » » 9 months ago, # ^ |   +2 true indeed ... worst code -_-