Skip to content

Commit 41b7f62

Browse files
authored
Added field for extra points (#693)
* Added extra credit section to summary * Fixed column widths
1 parent 555584e commit 41b7f62

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
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: 13 additions & 4 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

@@ -163,7 +171,7 @@ function Scores() {
163171
id: "index",
164172
header: "#",
165173
cell: (item) => item.rowIndex,
166-
width: 60,
174+
width: 40,
167175
},
168176
{
169177
id: "name",
@@ -179,6 +187,7 @@ function Scores() {
179187
id: "resume",
180188
header: "Resume",
181189
cell: ResumeModalButton,
190+
minWidth: 350,
182191
},
183192
{
184193
id: "avgScore",

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)