Instructions for PC^2 Lite Judging Environment

Getting Started

Download PC^2 Lite and install in home directory.
Download Judging scripts and install in home directory.

After you've done this you should have two directories: pc2 and scripts.

To start a server

Edit pc2/pc2v7.ini to change the server to the name of your local machine. (All clients will have to do likewise.) Don't change the Site Id which is "Waterloo."

Copy some boilerplate contest database files to your home directory:

   cp -r scripts/db.std8 db
   cp -r scripts/r_db.std8 r_db

Start the registry and server:

   pc2/registry
   pc2/server

Start several clients:

   pc2/client
Each client will bring up a login screen. Log in as the following:
   pc2     (passwd pc2)
   judge1  (passwd judge1)
   board1  (passwd board1)
   team1   (passwd team1)

Configuring problems and judging

Use the pc2 account to edit the problem descriptions. You can set the problem names. You can add new problems (if there are more than 8) but you can't delete them. So if you need fewer than 8 the easiest thing to do is to set the problem name to blank and ignore it.

For judging you have two choices:

If you want to read from standard input, just leave the input file blank. If you want to read from a file name, you have to fill it in using the pc2 account. Although the contents of the file are irrelevant, you cannot fill in a filename unless the file exists! So if you want input to come from "blah.in" just create an empty file "blah.in" and select it.

The judge script should be "jj". If you need to create more than 8 problems you'll find a copy of "jj" in scripts/jj.

Judging Data

All judging data must be in the directory ${HOME}/data. Problems are always labelled A, B, C, .... in the order created.

You may test the program with several input files. Each input file should have the name X.*.dat where X is the problem name and * is anything you please. If you have a correct output file for comparision, it is named X.*.diff where of course the substitution for * matches that for the .dat file. If you have a judging program rather than a correct output file, it is named X.*.cmd and must be executable. The return code from running this script is used to determine the suggested judgement. When this script is run, argv[0] is the full pathname to the script in the data directory, and argv[1] is the full pathname of the contestant's output file.

The above comments (.dat, .diff, .cmd files) apply whether the programs read from standard input or a specific filename. If programs are to read from filename this fact is specified by the existence of a file: X.filename.inp

Archiving and storing configurations

If you have gone to all the trouble of configuring the contest, you may want to try it out to see if it works. Unfortunately lots of things you might do (like submitting problems) are essentially irreversible in PC^2. So you want to take a snapshot of the system. Here's how to do it:

Taking a snapshot of the system

Restoring the system from a snapshot

Scoreboard

The scoreboard is yet another kludge. Here goes: Note: PC^2 only updates the scoreboard when a problem is judged "correct". This is stupid so I decompiled it and fixed it. To apply the patch, just download and install this tar file in your home directory. Then you have to go to pc2/pc2/Board and execute:
   javac ScoreboardFrame.java

Killing Zombie Logins

At some point, somebody will manage to kill their pc^2 client and be unable to login again.

What else?

In trying to cut to the chase, I've probably omitted something. Let me know. The judging stuff is derived from Howard Cheng's PC2+E: A PC2 Add-on Environment so you might find answers there or at the PC^2 Web Site. PC^2 Lite is based on PC^2 version 7.6.