Loading ...
Sorry, an error occurred while loading the content.

Re: [phpXperts] help needed to wirte a judging script

Expand Messages
  • S. M. Ibrahim (Lavlu)
    ... No, using this functions, u can run compile , run and give answere. but if there is 100 submits in 1 sec, how the system will run ????? Nice to hear that,
    Message 1 of 3 , Jan 7, 2007
    • 0 Attachment
      On 1/8/07, mizanur rahman <rnslove@...> wrote:
      hi

      for this type of problem, you have to have the compilers (gcc, jdk and others) to be available from command prompt. if you have this option then rest is very simple. you can execute any command in shell. for better reference you can look at following PHP functions

      shell_exec()
      exec()
      system()

      read the php manual or other references in detail in order to execute them properly

      thanks
      Mizanur Rahman

      No,
      using this functions, u can run  compile , run and give answere. but if there is 100 submits in 1 sec, how the system will run ?????

       Nice to hear that, u are interested to make a online judge. I think u are starting ur project with wrong concept. PHP will not the main part on OJ (online judge). The OJ will work as a software , combinition of  gcc, shell programming and cron or at. Here u have to use multi-threading approch.

      PHP will only use to take input (submit) and display the output. For this project u have to be expert on linux.

      For better understand check this two links:

      http://acm.uva.es/problemset/scheme.html
      http://acm.uva.es/problemset/architecture.html

      If u want to know more, please let me know.


      Tahsin Sayeeda Moon <tahsin_sayeeda@...> wrote:

      Aas Salamu Aalaikum All

      & Eid Mubarak to everyone.

      We are going to implement a 'web based programming contest control system' with PHP . Now we need to write the judging script. The programs that are written in any language will be judged by our web based judging system and will give the result, yes or no, by checking the outputs of the programs. So definitely we need to run the compilers ( VC++ or gcc or jdk etc) in the web. We have no idea how to do it in PHP. The platform will be either windows or Linux according to users choice.
       
      Here I would like to add a few description of a programming judging system in this regard. There are several web sites for that like 
      acm.uva.es/p 
      topcoder.com etc.
      These sites offer online judging. They have some problems and any time any user can not use the site to judge their particular source code.  Sometimes these sites host real time programming contest for 5/6 hrs for the users.

      There is also an offline software, solely for real time programming contest, pc^2. It is implemented in java. Even in ICPC or world final, the judges use pc^2 software. But it is server based, not web based. The contestant must be sit together in one intranet connection using one server for the contest.
       
      So our project is to merge the features of the above two judges. It will be web based; any user could get judgment of some predefined problems and also could arrange a real time contest of his own using this site (no web administrator will be needed to arrange it). And it will be a module which can be  use as a component of  another site also.
       
      So this is some detail about our project.
       
      Now we need to write the judging script in PHP that will enable different compilers run in the web and will give the status of the given source code like "Accepted", "Wrong answer", "Output Format Error", "Time limit exceed", "Compile Error", "Run Time Error", "Memory limit exceed" etc.
       
      As we are novice in PHP we need some suggestions on what to read or what to learn to start this part of the project.

      Fee Amanillah



                  Allah grant me the serenity
          To accept the problems that I cannot solve
      The persistence to solve the problems that I can
          And the wisdom to know the difference

      Tahsin Sayeeda
      Student
      Dept of CSE, IIUC
      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com

      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com




      --
      S. M. Ibrahim (Lavlu)
      Home page: http://lavluda.tripod.com
      Blog: http://lavluda.tk
      Yahoo!! ID: lavluda MSN ID: lavluda Skype : lavluda
    Your message has been successfully submitted and would be delivered to recipients shortly.