Judge Script for Moodle-uploaded Codes
You should set up some parameters before using this judge.
EXE: name of executable file made after compiling the codesCOMPILER: compile command
You may use$EXEin the command.VERBOSE: boolean variable to show verbose diff usingVERBOSE_DIFF_TOOLon test failureDEST_DIR: path to extract downloaded zip from moodle (See below)TEMP_DIR: path to save outputs of compiled codesINPUT_DIR: path to read inputs of test-casesSOL_DIR: path to correct solutions of test-casesJUDGE_DIR: path to special judges (See below)INPUT_EXT: extension of inputs of test-casesSOL_EXT: extension of correct solutions of compiled codesOUT_EXT: extension of outputs of compiled codesJUDGE_EXT: extension of special judgesCODE_ADDR: address of code to judge
Default is$2for second argument.TIME_LIM: time limit for each test-caseVERBOSE_DIFF_TOOL: difftool to use on test failure whenVERBOSEistrueDIFF_TOOL: normal difftool to judge the answersHAS_SPECIAL_JUDGE: array of _question_name_s with special judge
For example, for default parameters, there should be a folder structure like:
.
├── data
│ ├── 0
│ │ ├── 1.in
│ │ ├── 1.sol
│ │ ├── 2.in
│ │ ├── 2.sol
│ ├── 1
│ │ ├── 01.in
│ │ ├── 01.sol
│ ├── 1.judge
├── judge.sh
└── temp
It's possible to use custom special judge instead of simple diff to judge the codes; e.g. in situations which there is many correct solutions.
Special judge should be an executable file which can be run like:
./judge <output_file> <solution_file>It should return (not print) 0 on Accept and 1 or any more-than-zero exit code on Wrong Answer. It should has got $JUDGE_EXT extension and should be on path $JUDGE_DIR.
Remember that in this case, solution_file can be any file, not necessarily a correct answer.
Remember to add question_name to HAS_SPECIAL_JUDGE to use special judge instead of $DIFF_TOOL.
- show help
./judge.sh -h
./judge.sh --help- unzip the file which is downloaded by Download all submissions button from Moodle Assignment
./judge.sh -u <codes_archive_addr>
./judge.sh --unzip <codes_archive_addr>- judge the code
./judge.sh <question_name> <code_file>Please see contribution guide to contribute to this project.