Command line code grading system
Before using, please read the warning in server.py
Required Python modules:
colorama
tkinter
- Take the server file
src/server.py
and place it in an empty directory. - Run the server. You will be asked for an IP via stdin. Enter your local IP address.
- You may optionally put a file named
settings.json
in the same directory as the server with anip
key specifying the local IP of the server. - The server is set up. It will print messages when events occur, such as a client connecting.
- Run
src/client.py
. You may usesettings.json
in the same way as the server, stated above. - You will be asked whether you would like to quit or submit a solution.
- If you chose to submit, you will be asked for a language.
Python 3.8.0
,Python 2.7.17
, andC++ (g++ 7.5.0)
are the default ones. Adjust as needed to fit your system (this was developed on Ubuntu). You may also need to adjust the subprocess commands found inserver.Grader.grader
. - Next, select a problem ID. The client will contact the server to get avaliable problems and their IDs.
- Last, choose a file and you will see the server grade your submission.
They must be made with Python, due to the built in pickle module.
- Each problem is a Python dictionary pickled into a binary file. JSON support may be added in the future.
- The structure of each problem goes like this:
{
"name": "My Problem",
"pid": 1,
"difficulty": 5,
"cases": [
["in data\n for case one", "out data\n for case one"],
["indata for case2", "out data for c2"]
]
}
name
is the name of your problem.pid
is the problem's unique ID. If a PID comes up a second time, it will be skipped.difficulty
is a number to tell the contestants roughly how difficult the problem is. The difficulty value is not used by the server, and you can use any scale you like.cases
is a list of (input, output) strings, communicated via stdin/stdout. Each entry in the list is one case.