Open mpsijm opened 1 week ago
Thanks, looks like a good idea. Note that @eldering was also working on exporting a contest in the contest package format, but that doesn't include these files.
See also https://github.com/DOMjudge/domjudge/issues/2726 when implementing this.
Description of the enhancement request
It would be nice if the things that can be exported from the UI can also be exported from the API, to be able to do so automatically.
The goal you want to achieve
As jury, at the end of the contest, we would like to run some script that downloads the results of the contest. Most things we need can be retrieved as JSON from the API, but some things cannot, for example:
clarifications.html
What I've tried
In https://github.com/mpsijm/BAPCtools/commit/cc15a1200706d8af2f4811d20501848b503d2574, I've added some code that should download the scoreboard ZIP and clarifications HTML from
<domjudge_url>/jury/contests/<numeric_contest_id>/public-scoreboard.zip
and<domjudge_url>/jury/import-export/export/clarifications.html
. Instead, it downloads a login page, even though we passHTTPBasicAuth
at https://github.com/RagnarGrootKoerkamp/BAPCtools/blob/master/bin/contest.py#L96.(Note that the
../../
looks shady, but it actually works :stuck_out_tongue: The base URL incall_api
currently ends with/api/v4
, and the../../
removes this. If this wouldn't work, the server would respond with 404.)Expected behaviour
Either:
/jury
usingHTTPBasicAuth
.Anything else you'd like to add?
Accessing the static scoreboard zip from a script currently requires the numeric ID of the contest, even though all of the API has switched to external IDs :stuck_out_tongue: In general, perhaps the URLs of the jury pages should also switch from numeric IDs to external IDs (e.g.
/jury/contests/2
would become/jury/contests/bapc2024
).Tested at judge.bapc.eu, version 8.4.0DEV/ 2d6f4ff6a.