Installation method
Web
- Install and configure an available php server, such as apache, nginx, etc. Linux users recommend installing php extension sysvsem
- Install and start the mysql server, run
doc/init.sql to initialize the database, and modify the database connection information in web/code/inc/database.php - To display math formulas, download Mathjax and decompress to
web/assets/Mathjax/ - Copy all contents in the web directory to the website root directory to ensure that server users (such as www) have read and write permissions (770)
- Test whether you can access http://localhost/code/index.php
Daemon
Windows users:(Deprecated)
- Modify the data directory, mysql password and other information in
daemon/windows_binary/config.ini - Run
daemon/windows_binary/daemon.exe - If the prompt "Started successfully.Waiting for submitting...", it means that daemon is successfully started and submit a question test
Linux users:
- Installing the compilation tool, requirements:
- G++ >=4.6
- libmicrohttpd >= 0.9.21
- libmysqlclient corresponding to mysql version
Run in daemon/
make
If there is no error, modify the data directory, mysql password and other information in daemon/config.ini
Run in daemon/
./daemon
If the prompt "Started successfully.Waiting for submitting...", it means that daemon is successfully started and submit a question test
Configuration File
Daemon
####config.ini
- DATABASE_USER/DATABASE_PASS is the connection username and password of the mysql database, and the password can be left blank.
- datadir is the directory where the evaluation data is stored. This directory stores the directory named by the question number. Each directory named by the question number stores the test data for the question. The test data can be input and output file names paired, for example:
- /home/judge/data/1000/a1.in
- /home/judge/data/1000/a1.out
- /home/judge/data/1000/hello.in
- /home/judge/data/1000/hello.out
- /home/judge/data/1001/abc.in
- /home/judge/data/1001/abc.out
- /home/judge/data/1001/c2.in
- /home/judge/data/1001/c2.out
- [lang*] The allowed submission language and corresponding compilation options correspond to the web configuration lang_conf.php
Web
####lang_conf.php
- LANG_NAME Sets the display name for each language
- LANG_EXT Set source file extensions for various languages
####cookie.php
- Cookie_key sets a complex string to encrypt cookies. It must be modified when deployed in a production environment to avoid forgery of cookies
- cookie_expire cookie expiration time (used to remember to log in)
####checklogin.php
- REQUIRE_AUTH Whether global authentication is required, that is, you can only refer to OJ's questions after logging in, etc.
Update
You can test submit answer questions.
- Add method: Change
judge method to Submit in edit.php . - Update the input file downloaded by the user: Click the
Update button in problempage.php (If you want to add additional files, please put addition.zip in the directory of the test data).
Changed the sorting method of test data: the length of the input file is used as the first keyword and the dictionary order is the second keyword.
In the floating point comparison, we judge whether the user's output is nan .