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

Автор hugox14, история, 6 лет назад, По-английски

Hi, I'm currently working on a project using PHP to develop a judge where my colleagues can send solutions to exercises that are typically from a basic programming course. All solutions must be written in python.

The code is executed in exec() and then the user's output is stored in a .txt file. Later the system reads that file and compares it with a .txt file that has the correct outputs.

The problem is that I can not know when TLE occurs. When a user sends a python file with an infinite buble for example, the web page hangs.

If you have some tip or similar experience I would appreciate it very much.

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

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

I found open source OJ

Link : https://github.com/shawon100/RUET-OJ

Link of Website : The online Judge

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

Hi hugox14!

As EbraM96 said, if you are planning to create a robust OJ you should take into account security. Basically you should run the submissions on a sandbox environment to avoid problems.

Anyway, an easy way to limit execution time is with the "timeout" command.