hugox14's blog

By hugox14, history, 6 years ago, In English

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.

  • Vote: I like it
  • +5
  • Vote: I do not like it

| Write comment?
»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I found open source OJ

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

Link of Website : The online Judge

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

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.