-
Notifications
You must be signed in to change notification settings - Fork 11
Interactive Tasks
This guide will guide you through the process of creating an interactive task in kjudge!
- Download sample dataset
- Create problem
- Create test groups
- Prepare checker file
- Prepare build script
- The end
This guide uses an interactive problem called simurgh from IOI 2017 to help illustrate the steps of preparing an interactive problem. You can download the problem's dataset here.
After downloading and extracting the dataset, the simurgh
folder will look like this:
First, you need to add a problem to a contest in kjudge.
In this guide, a problem named simurgh
is added to the Weighted contest
to kjudge's test database.
After creating a new problem, you need to create test groups and add tests to each test group.
Follow the instructions in Hosting a contest to create test groups for the problem.
In this guide, simurgh
test groups in kjudge will look this:
The score of each test group is based on the score for each subtask in the original problem.
When preparing an interactive task, you need to implement a checker file.
Kjugde only accepts checker file named compare
and it follows CMS's checker style.
In the simurgh
folder, there is a folder named checker
which contains all the codes needed for the problem's checker:
To compile the problem's checker, run make
, which gives you a file named checker.exe
.
Note that you need to rename the checker file because kjudge only accepts checker file named compare
.
After that, you can upload the checker file to kjudge:
To grade an interactive task, you need to customize a build script for each programming language you want to support.
A build script must be named compile_[language].sh
- language
can be one of cc, go, rs, java, py2, py3
.
This guide will illustrate steps of writing a build script for C++
. Writing a build script for other languages is similar.
In the simurgh
folder, there is a folder named grader/cpp
, which contains files grader.cpp
and simurgh.h
to compile contestant's solution in C++
.
The C++
build script for simurgh
is g++ -O2 -static grader.cpp code.cc -o code
, which is put into compile_cc.sh
.
Note: in kjudge, contestant's submitted solution is named code.[language]
and the compiled binary file is code
.
After writting the build script, you can upload the build script and other required files (headers, provided libraries, ...) to kjudge:
In kjudge, the necessary files to grade simurgh
will look like this
To test whether you follow all steps correctly, you can try to submit a .cpp
code in simurgh/solution
folder.
You have completed all the steps to create an interactive task in kjuges. It's really simple, right?
Now, you can try to create your own interactive task in kjudge!