Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,12 @@ public static void createMedalAwards(Contest contest, List<IAward> goldList, Lis
}
int nextTeam = 0;
nextTeam = assignMedal(gold, nextTeam, teams, Messages.getString("awardMedalGold"));
contest.add(gold);
nextTeam = assignMedal(silver, nextTeam, teams, Messages.getString("awardMedalSilver"));
contest.add(silver);
assignMedal(bronze, nextTeam, teams, Messages.getString("awardMedalBronze"));
// Add them in reverse order, so we can display them in the correct order in the resolver
contest.add(bronze);
contest.add(silver);
contest.add(gold);
}
}

Expand Down Expand Up @@ -596,10 +597,10 @@ public static void createHonorsAwards(Contest contest, IAward template) throws I

// Determine how many problems the lowest medalist solved. We need this for the solvedTop/solvedBottom case.
int lowestMedalNumSolved = Integer.MAX_VALUE;
int numMedalists = 0;
Set<String> medalTeams = new HashSet<>();
for (IAward a : awards) {
if (a.getAwardType() == IAward.MEDAL) {
numMedalists += a.getTeamIds().length;
medalTeams.addAll(Arrays.asList(a.getTeamIds()));
for (String tid : a.getTeamIds()) {
IStanding s = contest.getStanding(contest.getTeamById(tid));
if (s != null && s.getNumSolved() > 0) {
Expand All @@ -608,6 +609,7 @@ public static void createHonorsAwards(Contest contest, IAward template) throws I
}
}
}
int numMedalists = medalTeams.size();

// find teams we're going to base this on

Expand Down Expand Up @@ -763,15 +765,14 @@ public static void createAllGroupWinnersAward(Contest contest, IAward template)
// Also keep track of all teams that have a group award
Set<String> groupWinners = new HashSet<>();
Set<String> medalWinners = new HashSet<>();
int numMedalists = 0;
for (IAward a : awards) {
if (a.getAwardType() == IAward.MEDAL) {
numMedalists += a.getTeamIds().length;
medalWinners.addAll(Arrays.asList(a.getTeamIds()));
} else if (a.getAwardType() == IAward.GROUP) {
groupWinners.addAll(Arrays.asList(a.getTeamIds()));
}
}
int numMedalists = medalWinners.size();

String citation = template.getCitation();
if (citation == null || citation.trim().isEmpty()) {
Expand Down