This was the original attempt at writing our judging platform. It was written in PHP (with no regards to standards), and was linked with the (now legacy) Grader server written in Node.
Don't forget to have a grader server too!
In order to run the UI, you must have Apache, MySQL/MariaDB, and PHP 7.x installed. Place these files in the html root directory. There is a supplied SQL file you can import into the database. Make to set the correct values in "Config/config.ini".
In production the Judge UI runs on Ubuntu 18.04 with Apache, PHP 7.2, and MySQL. It has been tested to work on both Mac OS X and Windows, and will probably run wherever there is a reasonably modern version of PHP (>5.6 or something like that).
- With a fresh Ubuntu Server installation, setup a LAMP stack as per this guide.
- Optionally install PHPMyAdmin to make database setup easier.
- Clone this repository somewhere (like home), and then copy the files to /var/www/html
- Create a new database on MySQL and import the bayviewjudge.sql file.
- Edit the Config/config.ini file with your MySQL and Webserver information.
There is a deploy_gnulinux.sh
script which will automatically git pull, copy the files to /var/www/html, and copy a config.ini from from ~/config.ini
Don't forget to AllowOverride All
in the Apache config.
- Download XAMPP and run the installer. Keep the default installation directories. You only need the Apache, MySql and PHP elements.
- Download this repository and unzip it into
C:\xampp\htdocs
. - Launch the XAMPP Control Panel with administrator privileges (I just toggle the run as admin property in the start menu shortcut so it always runs as admin by default. Note: You obviously need admin privileges for this.)
- On the lefthand side under
modules
in the Control Panel, you should seeService
. Click the ❌ and wait for it to change to a ✔️. - Go to 🔧
Config
at the top right of the Control Panel,User Defined Files
at the bottom left of the popu dialog and thenMySQL
. Under theConfig
box, put\htdocs\bayviewjudge.sql
. ✔️Save
twice. If you've done something wrong, ❌Abort
. - Now under
Actions
in the main XAMPP Control Panel, clickStart
for bothApache
andMySQL
. - Go to
localhost/
in your browser to see the site. There will be a bunch of errors. - Go to
localhost/phpmyadmin/
. Create a new database calledbayviewjudge
, with charsetUTF-8 (general)
. - Import
bayviewjudge.sql
(fromC:\xampp\htdocs
) into the newly created database. Refresh [localhost/] to see the site.
The judge accepts input and output cases in the form of a JSON array of test batch objects.
Consider the following input cases for a A+B problem:
[ { "cases": ["1 2", "4 5"], "points": 5 }, { "cases": ["7 5"], "points": 5 } ]
This example has 2 batches, with 2 test cases in the first batch and one in the second.
The corresponding output cases would look as such:
[ { "cases": ["3", "9"] }, { "cases": ["12"] } ]
Before adding a problem to the judge, make sure your input and output cases are valid JSON!