Closed cubercsl closed 1 year ago
I wonder if this is something we want to handle, given it only happens if you have medals enabled only for specific categories in the same sort order. See this scoreboard:
I have set all medals to 4 and have only given 'Africa and the Middle East' medals. The 5d ranked team is from that category so according to this issue it should get gold, but it is now getting silver. The reason for this is that we look at the rank of the teams to determine the medals, as specified in https://ccs-specs.icpc.io/draft/ccs_system_requirements#scoring-data-generation (bullet 8).
With some non trivial code changes we could make this work (we need to keep track of how many ranks we have skipped because they are in different categories and add that to the rank comparison in the award service, but then reset this for a new sort order), but do we want this? Or do we maybe want to disallow selecting medal categories for only a subset of categories in a sort order (i.e. you have to either select the whole sort order or no categories in it)?
@DOMjudge/developers what do you guys think?
I have set all medals to 4 and have only given 'Africa and the Middle East' medals. The 5d ranked team is from that category so according to this issue it should get gold, but it is now getting silver.
I do mean that, it should have been awarded a gold medal. (teams from the Observers category are guest teams, they do not affect the prizes of the official participants but in a shared scoreboard in our regional contest, as described in #1742)
I know what you mean. I’m just wondering if this makes any sense? The UI is very weird and confusing if you only award to some groups of a sort order. For your contest, isn’t it an option to use separate sort orders? I mean, otherwise you would have gaps in the golden boxes which are not explained anywhere in the UI
For your contest, isn’t it an option to use separate sort orders?
Using a separate sort order for Guest Team would use a separate scoreboard, but we want these teams to be on one scoreboard rather than a separate scoreboard. However, Guest Teams should not be awarded under the rules.
I mean, otherwise you would have gaps in the golden boxes which are not explained anywhere in the UI
I think we will use a special way to mark these guest teams at the scoreboard. (A star *
in front of the team's displayname and a different background color means it is a guest team.)
This is an example: (The number after the rank should have been the school logo image, but I didn't import it when I migrated the data.)
I'm not a fan of this in general and it seems to be very prone to bugs (looking at how many we already have...), but if the rest believes this does make sense we can try to implement it.
It seems like a very specific business rule, and if you would chnage this, would not another use case pop up with an incompatible requirement? I would say that if you want a very specific ranking or medalling algorithm you can implement that since there's no guarantee that others would want it to work the same. For the ICPC rules we do have some expectation that there's a share interest in those specific rules.
I think the original setting rules should be followed, that is, to rank and award the teams in the Medal categories
, so we need to consider the number of each award and not just the ranking of the team to decide. This BUG was fixed in my previous PR-1742, but it seems to be covered by such COMMIT...
That commit was introduced, as Thijs suggested, because that is how we need to do it for the ICPC, which still is our main target audience. We need to look at rank for this reason: Imagine this scoreboard:
Rank Team Solved Score
1 A 8 100
2 B 8 110
C 8 110
4 D 7 80
5 E 7 90
And we want to give out 2 gold medals and 2 silver. Team C, which also has rank 2, will get a gold medal, while team D will get the only silver medal.
If you guys can come up with a way to incorporate both this logic and the logic of skipping teams from categories that are excluded, I would be willing to accept the PR. But I do think we then need a proper test for this (or extend the test we already have).
You are right. I have a new idea: while fixing the number of each medals, add some special judgments in each borderline case, that is, to judge whether the current team and the previous team have the same penalty time, and if they are the same, the same award will be used as the previous team. This could achieve the feature that the same penalty teams could get the same award. Anyway, I think we should use the filtered rank (exclude teams not in Medal categories
) to determine whether a team has won an award?
In the award service we do not know the filtered rank currently. I see that as a whole new feature, which anyone is welcome to implement. This would mean passing the filtered teams to the award service somehow.
Please check out #1983 for a potential fix for the original problem. I added a test that should catch both the rank issue and the skipping of categories issue. I hope this is indeed what you expect.
It works now. Your response speed is too fast, thanks a lot.
LGTM.
Description of the problem
The calculation of medals directly skips the teams not in
Medal categories
resulting in a decrease in the total number of medals.Your environment
Steps to reproduce
28, 56, 84
(i.e. 10%, 20%, 30% of total participants) for all teams from categoryParticipants
, and categoryObservers
is the same sort order asParticipants
.Expected behaviour
When the contest is running / After the contest is finished, there are 3 teams from
Observers
are ranked with 5, 13, 15 (in the gold medal area), gold medals should be awarded to 31st place, as these three teams do not give medals.Actual behaviour
The gold medal was still handed out to 28th place and the 29th place was given a silver medal, which resulted in the wrong number of gold medals. This problem also exists in the Silver and Bronze areas, and scoreboard and award API's are both wrong.
Any other information that you want to share?
It may be the same problem as https://github.com/DOMjudge/domjudge/pull/1742, and https://github.com/DOMjudge/domjudge/commit/09d25cbb1b27f60cb572d99799bd36e1103a606b should have fixed it (only in scoreboard), but the refactoring in https://github.com/DOMjudge/domjudge/commit/42daadc7b6fe8a773d78967854fc99dcff409226 introduces this issue again in 8.2.0.