I'm glad to announce a series of improvements in the Codeforces::Gym subproject. Many people faced the following problem as they prepared problems in this section: to add a problem or edit an existing training a little bit, one had to parse and repackage the whole contest from the scratch in the Wizard. Another variant was manually editing the files on FTP. Both these ways added unreasonable challenges.
From now on you can create contest patches in the Wizard. Want to add a problem? There's no need to repackage the whole contest. Update the standings, add resources or statements? The procedure is simplicity itself. All you've got to do is to run the Wizard in the update mode and add only the really necessary changes. The Wizard will assemble the contest.zip package and mark it as a patch. You can upload the package into Taskbook in the usual manner.
Let's take a closer look at how the patch updates the contest.
The problem from the patch completely replaces the problem of the contest with the same index, otherwise it appears as a new problem. The problems from the contest's sandbox that don't occur in the patch, are left unchanged. To add problems to the contest, you need to run Wizard, create and parse one or several problems and assemble the package.
You can replace the problem statements and resources in the similar manner. A statement replaces the one that exists for this language, whatever the file name is. A resource replaces an existing one if they have the same names, otherwise a new resource is added.
File with standings of ghostly participants (contest.dat) replaces the existing one, if the new one contains at least one submit. If there is no such submit and the problems of the patch are a subset of the existing problems of the contest (in the sandbox), then contest.dat remains unchanged. Otherwise, a new contest.dat is generated (without submits) which joins together the sets of the contest problems and the patch problems. To update the results of the ghostly participants, you must parse the new standings in the Wizard, skip all problems by clicking Skip problem button, and pack.
Applying a patch assumes that the data of the patch and the current state of the sandbox are consistent. For this both the patch and the sandbox have a validation. This validation is similar to the one that occurs when you release a training, but is a bit simplified. When you download the full package of the contest, such validation does not occur, the archive unpacks as is and is checked only when the contest is released. The patch is applied only if both validations are completed successfully. Otherwise, the patch file is simply removed, and a new record in error.log of the training can tell you what went wrong.
The improvements also affected Taskbook, namely the validation system: if the problem was not changed since the last release of the contest, its validation won't be performed. This will dramatically speed up the process of releasing the training in the case of minor changes. If no file of the training was changed, then release will not happen, and the user will get the corresponding message.
As a little bonus we have made many improvements in the Wizard's interface. In particular, we added hotkeys for most actions (the details are in tooltips to the buttons), we have also improved a lot of dialogues:
We've accelerated launching the multiple file selection dialog in the Windows OS by hiding the Network element. The item can be returned by pressing a special button.
We've added a button that allows you to save the contest.dat, not assembling the full package.
We've changed the mechanism of launching open and save file dialogs. It had almost no impact on their look, but it let us add a number of enhancements, such as setting up a default file name and saving the current directory in the subsequent uses of the dialogue.
If saving the contest package fails, the user will be suggested to try to do it again. No need to re-validate the contest and re-assemble the package.