Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow medal in contest setting categories when export results #2638

Merged
merged 4 commits into from
Aug 11, 2024

Conversation

cubercsl
Copy link
Contributor

When export the result, follow medal categories in contest setting. This will be consistent with the results generated by the award API.

cubercsl added 2 commits July 30, 2024 23:01
When export the result, follow medal categories in contest setting.
This will be consistent with the results generated by the award API.

Signed-off-by: cubercsl <[email protected]>
Add every group in medal category
@cubercsl cubercsl marked this pull request as ready for review July 30, 2024 16:28
@vmcj
Copy link
Member

vmcj commented Jul 30, 2024

I think this config is only used with your contests,

Can you extend @nickygerritsen his tests with a ranking of your contest (with teams in the same sortorder with some eligible for medals?), otherwise we always get this kind of PRs.

@meisterT meisterT requested a review from nickygerritsen August 3, 2024 10:36
Copy link
Member

@vmcj vmcj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we merge this I would like a specific test for such a scoreboard.

@cubercsl
Copy link
Contributor Author

cubercsl commented Aug 8, 2024

The test data are based on AwardServiceTest.

Also, I moved the existing wf data to a subdirectory so that I could use different datasets in my tests.

// Now generate some scores. We will create the following solves:
// (a numbers is the solve time or an x means not solved)
//
// Team | A B C D
// -----+-----------
// A | 1 5 10 20
// B | x 2 3 x
// C | x 2 3 x
// D | x x x 12
// E | x x x 13
// F | x x x 14
// G | x x x 15
// H | x x x x
// I | x x x x
//
// This means A is the overall winner, will get a gold medal and is the winner
// of category A. It is also first to solve problem A.
// B is second, so it also gets a gold medal. It is also first to solve problem B and C
// C scored the exact same as B, so it also gets the same medals
// D is the first to solve problem D and is the winner of category B. But will not get any medal.
// E and F will get no awards at all.
// G is the winner of category C and will get a bronze medal.
// The reason G doesn't get silver is that C would get silver if it was ranked differently,
// but it is not.
// H and I didn't solve anything, so it will not get any medals at all

It is a rare situation that medals cannot be distributed completely.

It is almost impossible for medals to be awarded to a team didn't solve
anything in a real contest. However, this is indeed the case in the test
data.

Signed-off-by: cubercsl <[email protected]>
10001 1 Gold Medal 4 36 20 Sample Group A
10002 2 Gold Medal 2 5 3
10003 2 Gold Medal 2 5 3
10004 4 Highest Honors 1 12 12 Sample Group B
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really defined what order this file should be in, nor what should happen when some categories have no medals. It looks a bit weird like this, but I think this is the best we can do,

Copy link
Member

@vmcj vmcj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests were added so I'm fine with it.

@vmcj vmcj added this pull request to the merge queue Aug 11, 2024
Merged via the queue into DOMjudge:main with commit ec5d9c5 Aug 11, 2024
26 checks passed
@cubercsl cubercsl deleted the export-follow-medal-categories branch September 24, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants