DOMjudge / domjudge

DOMjudge programming contest jury system
https://www.domjudge.org
GNU General Public License v2.0
703 stars 249 forks source link

Allow relative (de)activate_time when importing contest.yaml #2072

Open mpsijm opened 1 year ago

mpsijm commented 1 year ago

Follow-up of #1807.

Description of the enhancement request

In contest.yaml, activate_time and deactivate_time now need to be full-blown ISO strings, but I would like to use relative times as well.

Details

When creating a contest via the web interface, the "Activate time" and "Deactivate time" are allowed to be relative times. However, in contest.yaml, these fields are required to be in ISO format: https://github.com/DOMjudge/domjudge/blob/main/webapp/src/Service/ImportExportService.php#L181-L195

And perhaps on a similar note, the duration field currently only allows relative times, whereas scoreboard_freeze_duration only allows relative times but has an alternative called scoreboard-freeze/freeze that only allows absolute timestamps. It would be nice if all of these are consistent, although perhaps it's a bad idea to deviate too much from https://ccs-specs.icpc.io/draft/contest_api#contests :stuck_out_tongue:

nickygerritsen commented 1 year ago

The spec is indeed the reason these are only allowed to be the way they are. I would not be opposed to add support for this though. The fields without _ are legacy and I think we should not change them