Skip to content

Commit 18a1a46

Browse files
committed
Judging system updates
* Change the max to 5 judges per team. * Let us know the number of needed rounds.
1 parent 57229f1 commit 18a1a46

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

src/app/dashboard/judging/JudgingAdminClient.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default function JudgingAdminClient() {
1111
const [tableCount, setTableCount] = useState(0);
1212
const [judgeCount, setJudgeCount] = useState(0);
1313
const [collisionCount, setCollisionCount] = useState(0);
14+
const [neededRounds, setNeededRounds] = useState(0);
1415
const [warnings, setWarnings] = useState<string[]>([]);
1516
const [errorMessage, setErrorMessage] = useState<string | null>(null);
1617

@@ -26,6 +27,7 @@ export default function JudgingAdminClient() {
2627
setTableCount(result.tableAssignmentsCount ?? 0);
2728
setJudgeCount(result.judgeAssignmentsCount ?? 0);
2829
setCollisionCount(result.collisionCount ?? 0);
30+
setNeededRounds(result.neededRounds ?? 0);
2931
setWarnings(result.warnings || []);
3032
} else {
3133
setStatus("error");
@@ -73,6 +75,9 @@ export default function JudgingAdminClient() {
7375
✅ No round collisions.
7476
</p>
7577
)}
78+
<p className="text-green-600 font-bold mt-2">
79+
{neededRounds} round(s) needed.
80+
</p>
7681

7782
{warnings.length > 0 && (
7883
<div className="mt-4 p-4 bg-orange-50 border-2 border-orange-200 rounded-md text-left">

src/util/actions/judge.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ export interface AutoAssignResult {
9393
*/
9494
collisionCount?: number;
9595

96+
/**
97+
* The number of rounds needed for everyone to get judged.
98+
*/
99+
neededRounds?: number;
100+
96101
/**
97102
* Non-fatal warnings collected across all three phases.
98103
*/
@@ -210,6 +215,7 @@ export async function actionAssignJudges(): Promise<AutoAssignResult> {
210215
tableAssignmentsCount: tableResult.placements.length,
211216
judgeAssignmentsCount: judgeResult.newAssignments.length,
212217
collisionCount: collisions.length,
218+
neededRounds: judgeResult.neededRounds,
213219
warnings,
214220
};
215221
} catch (error) {

src/util/judging/judgeAssignment.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { JudgeAssignment, Project, Track } from "@/src/util/dataTypes";
44
/**
55
* The number of judges that should score each (project, track) pair.
66
*/
7-
export const JUDGES_PER_TRACK = 2;
7+
export const JUDGES_PER_TRACK = 5;
88

99
/**
1010
* The minimum count of judges simultaneously scheduled at the same
@@ -59,6 +59,13 @@ export interface JudgeAssignmentResult {
5959
*/
6060
newAssignments: AssignJudgeAssignment[];
6161

62+
/**
63+
* The number of rounds needed to handle judging.
64+
* This is the maximum of the number of projects assigned
65+
* to a single judge.
66+
*/
67+
neededRounds: number;
68+
6269
/**
6370
* Non-fatal issues (unknown track tags, empty tags, insufficient
6471
* judges for a track, etc.). Shown to the admin after the run.
@@ -100,6 +107,7 @@ export function computeJudgeAssignments(
100107
const trackMap = new Map(tracks.map((t) => [t.devpostTag, t]));
101108
const projectMap = new Map(projects.map((p) => [p.id, p]));
102109

110+
// Judge ID -> # of assigned projects.
103111
const judgeWorkload = new Map<number, number>();
104112
for (const j of judges) judgeWorkload.set(j.id, 0);
105113
for (const a of existing) {
@@ -245,7 +253,9 @@ export function computeJudgeAssignments(
245253
}
246254
}
247255

248-
return { newAssignments, warnings };
256+
const neededRounds = Math.max(...judgeWorkload.values());
257+
258+
return { newAssignments, neededRounds, warnings };
249259
}
250260

251261
/**

0 commit comments

Comments
 (0)