Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added labels for subtasks #73

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions format-specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ The following field must be present if and only if the problem is scored with su
- `score`: a number indicating the score of the contestant on the subtask.
- `max_score`: a number indicating the maximum score on the subtask.
- `testcases`: an array of numbers, containing the testcases belonging to the subtask.
- `labels`: an optional array of string used to label the subtask.

Note that is the checker's responsibility to make sure that the information contained in `subtasks` is accurate.

Expand Down
7 changes: 6 additions & 1 deletion frontend/src/contest/submission/ResultView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function ResultView<T>({
{subtasks.map((s: Subtask, i: number) => (
<tr>
<td>
Subtask {i + 1} ({s.score}/{s.max_score})
Group {i + 1} ({s.score}/{s.max_score})
</td>
<td>
<ul className="list-inline mb-0">
Expand All @@ -31,6 +31,11 @@ export function ResultView<T>({
{renderCaseSummary(cases[i], i + 1)}
</li>
))}
{s.labels && s.labels.map((label: String, i: number) => (
<li className="list-inline-item" key={i}>
<div className="badge badge-warning">{label}</div>
</li>
))}
</ul>
</td>
</tr>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types/contest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type Subtask = {
max_score: number;
score: number;
testcases: number[];
labels?: String[];
};

export type Submission = {
Expand Down
Loading