Skip to content

Commit

Permalink
Merge pull request #113 from HackDavis/ui-fixes
Browse files Browse the repository at this point in the history
Added comments to admin panel
  • Loading branch information
brandonw504 authored Apr 28, 2024
2 parents 8e92449 + 1479699 commit 6051b8c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
8 changes: 7 additions & 1 deletion app/(api)/_utils/scoring/rankTeams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ function calculateScores(team: Team, submissions: Submission[]) {
score: isNaN(res / submissionsCount) ? 0 : res / submissionsCount,
}));

return { number: team.number, name: team.name, scores: finalScores };
return {
number: team.number,
name: team.name,
scores: finalScores,
comments: submissions.map((submission) => submission.comments),
};
}

async function computeAllTeams(teams: Team[]) {
Expand Down Expand Up @@ -98,6 +103,7 @@ export default async function rankTeams(teams: Team[]) {
number: team.number,
name: team.name,
score: foundScore.score,
comments: team.comments,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
flex-direction: column;
}

.score {
margin-bottom: 8px;
border: none;
border-radius: 4px;
padding: 20px;
background-color: var(--background-tertiary);
box-shadow: 0 3.874px 61.987px 0 rgba(255, 197, 61, .16);
}

.delete {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@ export default function JudgeTeamGrouping() {
? trackResults!.map((result) => (
<>
<h4>{result.track}</h4>
{result.topEntries.map((entry) => (
<>
{result.topEntries.map((entry, i) => (
<div key={i} className={styles.score}>
<p>
Team No. {entry.number}, {entry.name}, {entry.score}
</p>
</>
<p>Comments:</p>
<ul>
{entry.comments.map((comment, i) => {
if (comment !== undefined) {
return <li key={i}>{comment}</li>;
}
})}
</ul>
</div>
))}
</>
))
Expand Down

0 comments on commit 6051b8c

Please sign in to comment.