Skip to content

Commit 0446534

Browse files
committed
Added extra credit section to summary
1 parent 114259b commit 0446534

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

apps/api/src/routers/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class ZotHacksApplicationDataSummary(BaseModel):
6060
school_year: str
6161
submission_time: Any
6262
normalized_scores: Optional[dict[str, float]] = None
63+
extra_points: Optional[float] = None
6364
email: str
6465
resume_url: str
6566

apps/site/src/app/admin/scores/Scores.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,20 @@ function sortApplicantsByNormalizedScore(applicants: HackerApplicantSummary[]) {
2626
return { ...applicant, avgNormalizedScore: 0 };
2727

2828
const total = Object.values(scores).reduce((sum, val) => sum + val, 0);
29-
const avg = total / Object.keys(scores).length;
29+
let avg = total / Object.keys(scores).length;
30+
if (applicant.application_data.extra_points)
31+
avg += applicant.application_data.extra_points;
3032

3133
return { ...applicant, avgNormalizedScore: avg };
3234
})
3335
.sort((a, b) => b.avgNormalizedScore - a.avgNormalizedScore);
3436
}
3537

3638
const downloadCSV = (
37-
data: (HackerApplicantSummary & { avgNormalizedScore: number })[],
39+
data: (HackerApplicantSummary & {
40+
avgNormalizedScore: number;
41+
extraPoints?: number;
42+
})[],
3843
) => {
3944
const headers = ["Name", "Email", "Resume URL", "Average Normalized Score"];
4045
const rows = data.map((a) => [
@@ -58,7 +63,10 @@ const downloadCSV = (
5863
};
5964

6065
const ResumeModalButton = (
61-
item: HackerApplicantSummary & { avgNormalizedScore: number },
66+
item: HackerApplicantSummary & {
67+
avgNormalizedScore: number;
68+
extraPoints?: number;
69+
},
6270
) => {
6371
const [showResume, setShowResume] = useState(false);
6472

apps/site/src/lib/admin/useHackerApplicants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface HackerApplicantSummary {
1717
school_year?: string;
1818
submission_time: string;
1919
normalized_scores?: Record<string, number>;
20+
extra_points?: number;
2021
email: string;
2122
resume_url: string;
2223
};

0 commit comments

Comments
 (0)