Skip to content

Commit

Permalink
fix result calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Headary committed Dec 19, 2024
1 parent d0f0761 commit 6079447
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Components/ResultsPanel/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ function generateSQL(points: ReturnType<typeof useTeamPoints> | null) {

for (let i = 0; i < sorted_participated.length; i++) {
const team = sorted_participated[i];
const rankTotal = i + 1;
const rankCategory = sorted_participated.slice(0, i).filter(t => t.team.category === team.team.category).length + 1;
const state = disqualified.includes(team.team.teamId) ? 'disqualified' : participated.includes(team.team.teamId) ? 'participated' : 'missed';
const rankTotal = sorted_participated.slice(0, i).filter(t => !disqualified.includes(t.team.teamId)).length + 1;
const rankCategory = sorted_participated.slice(0, i).filter(t => t.team.category === team.team.category && !disqualified.includes(t.team.teamId)).length + 1;
addTeam(team.team.teamId, state, state == 'participated' ? team.points : null, state == 'participated' ? rankCategory : null, state == 'participated' ? rankTotal : null);
}

Expand Down

0 comments on commit 6079447

Please sign in to comment.