DOMjudge / domjudge

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

Consider displaying award information on the scoreboard? #1102

Closed shuibinlong closed 3 years ago

shuibinlong commented 3 years ago

In the competition held for our school, it is required that the top 13 be the gold medal, the top 20 be the silver medal, and the top 40 be the bronze medal. In order to increase the look and feel of the rankings, I modified the scoreboard.twig file to realize the three colors of gold, silver and bronze for the template winning teams in the first column of the ranking, as shown in the figure below. 1 3 2 As we all know, there are also gold awards, silver awards and bronze awards in the algorithm competition (especially in ICPC, there are 10% teams for gold, 20% teams for silver, 30% teams for bronze). Why not consider adding this feature to domjudge?

thijskh commented 3 years ago

Hi! Indeed, DOMjudge already has support for determining the awards. It's currently only exposed in the API and hardcodes the amount of gold and silver medals. See: https://github.com/DOMjudge/domjudge/blob/master/webapp/src/Controller/API/AwardsController.php

It's probably not so hard to move this to a service so also the web UI can use it, make the number of medals configurable and then display it in the templates. A pull request for that would be great.

nickygerritsen commented 3 years ago

There are currently two problems with this idea, and a third upcoming one:

However, as Thijs said, I think we can easily overcome these issues, except the second one. For the second I would just ignore this strange rule. The last issue can later be integrated into this service.

If someone wants to work on this, I do think we need to put this behind a flag in the db-values.yaml configuration. I'm fine with enabling it by default but I can image some people do not want it (for example for the ICPC World Finals case).

I have never heard of a contest that used percentage values for awards by the way. Do you know of any?

shuibinlong commented 3 years ago

There are currently two problems with this idea, and a third upcoming one:

  • The number of gold, silver, bronze awards is very different per contest. DOMjudge is hardcoded to use 4 gold, 4 silver and 4 bronze in its API, since those are the most common values. However, if we want this feature, we probably need to be able to set these numbers, either on the contest or as global configuration.
  • During the ICPC World Finals there is this very odd rule that the number of bronze medals is only determined after the contest has ended. It is always at least 4, but if the team ranked 13th is very close the the 12th team, it can be 5. It can also be higher if more teams are close.
  • At some point we will probably implement POST/PUT/DELETE support for the awards API endpoint. If someone posts gold, silver, bronze medals we need to ignore our own logic and take that into account.

However, as Thijs said, I think we can easily overcome these issues, except the second one. For the second I would just ignore this strange rule. The last issue can later be integrated into this service.

If someone wants to work on this, I do think we need to put this behind a flag in the db-values.yaml configuration. I'm fine with enabling it by default but I can image some people do not want it (for example for the ICPC World Finals case).

I have never heard of a contest that used percentage values for awards by the way. Do you know of any?

Hello, actually I am a Chinese ICPC algorithm competition contestant. The Chinese ICPC competition is awarded according to the percentage of the participating teams (10% is a gold medal, 20% is a silver medal, and 30% is a bronze medal). Therefore, there were as many as 500 participating teams in the just-concluded Yinchuan Regional. A total of 50 gold medals, 100 silver medals and 150 bronze medals were awarded. Some unpleasant things happened during the competition :( , which also caused dissatisfaction among many domestic players. Related discussions It can be found here http://codeforces.com/blog/entry/90897.

At present, my version's medal awards number is fixed for 13/20/40, so I agree with your suggestion. The backstage should provide an interface for setting the number of medals and the categories participating in the awards. I will be very honored if I have the opportunity to participate in the development of this issue.

nickygerritsen commented 3 years ago

So just to double check, if you would have had exactly 100 teams, the first 10 would get gold, then the next 20 get silver and the next 30 get bronze. Meaning only 40 teams do not get a medal?

I'd say these percentages can indeed be converted to numbers by the admins (for now). Feel free to try to implement this feature. If you need any help we are available for help, preferably on Slack.

shuibinlong commented 3 years ago

So just to double check, if you would have had exactly 100 teams, the first 10 would get gold, then the next 20 get silver and the next 30 get bronze. Meaning only 40 teams do not get a medal?

I'd say these percentages can indeed be converted to numbers by the admins (for now). Feel free to try to implement this feature. If you need any help we are available for help, preferably on Slack.

Yes, in chinese ICPC/CCPC algorithm competition use percentage values for awards (It means the first 10 would get gold, then the next 20 get silver and the next 30 get bronze). But I agree with you that converting these percentages to to numbers by the admins is more flexible. Thank you for your approval, I will try to join the Slack lately.