This is a simple C language judge system.
Only supports on NCCU-ghost(ghost.cs.nccu.edu.tw) currently.
Created by CTHua & Dark9ive.
Step 1. Clone the project to your own directory using the following command:
git clone https://github.com/CTHua/C.D_Judge.git
Step 2. Change directory into the cloned folder:
cd ./C.D_Judge
Step 3. Compile necessary files:
make
This project is NOT designed for general user and IS NOT EXPECTING ANY ONE EXCEPT DEVELOPERS TO EXECUTE!!
Running these compiled executable files may CAUSE DAMAGE TO YOUR PERSONAL FILES!!
SO MAKE SURE YOU KNOW WHAT YOU ARE DOING!!
DO EVERYTHING AT YOUR OWN RISK!!
You must encrypted your i/o file(s) with following commands:
1keycrypt test_date(YYYYMMDD) num_of_question(s)
Please make sure that you are in the same directory with your "main.c", then type:
/home1/student/stud108/s10829/judge/submit test_date(YYYYMMDD)
This is a simple judge system. Only supports NCCU-ghost(ghost.cs.nccu.edu.tw) currently.
Planned on making this a website version since we still need more SQL and HTML techniques.
hash.h is a C++ source code using crypt(1) and MD5 package from OpenSSL.
This file includes only one function, which can make a hash by giving a char array, then return the hash in another char array.
The Key is generated by the following process:
- Get MD5 hash of the input string.
- Transform the 128-bit hash result into 16 characters(8 bits per character).
- Take the first 8 digits of the transformed characters as the encrypt key.
- If there is any null byte (0x00) in the key, change it to 0x01.
1keycrypt is the C++ compiled executable of crypt.cpp. See further introduce below.
crypt.cpp is a C++ source code including hash.h.
The program uses the date to generate a special key, which is used on encrypting test files.
After the key is generated, the script will then encrypt the test data (input) and Answer (output) files using crypt command.
Although crypt(1) is considered not secure enough, we still use it as our encrypt tool because of its convienience. Plus, the key is hard to be brute-forced since there are about 264 combinations in total, and the examinees may only know that the key has something to do with the date. Despite of that, we still planned to add a feature of letting the user to set their own password rather than bind it with the date.
submit is the C++ compiled executable of public_judge. See further introduce below.
public_judge.cpp is a C++ source code including hash.h.
The judge will do these before grading your code:
- Make a ".judge" folder under your current directory.
- Make a copy of your code into ./.judge and compile it.
- Make a copy of your code to admins' folder.
- record submit time
And then start the grading process:
- If fails to read the compiled executable, gives CE (Compilation Error).
- Run the exectable. If runtime stays over 1 second, kill it with signal 9.
- If the exit code is 137 (kill signal 9), gives TLE (Time Limit Exceed).
- Other non-zero exit code, gives RE (Runtime Error).
- Check if the encrypted output file is the same as the encrypted answer, gives AC (Accept).
- Otherwise, gives WA (Wrong Answer).
The total score is calculated in the following formula:
For N equals to the total number of AC(s).
Last but not least, clean the trash, show the results and send them to the admins.
Please visit our website for current submission status.
- Custom password for each encryption.
- Website version(account create, identity verify, db management, etc...)