-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
✨ Add task grade guidelines (#1569)
- Loading branch information
Showing
4 changed files
with
203 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<script lang="ts"> | ||
import { | ||
Table, | ||
TableBody, | ||
TableBodyCell, | ||
TableBodyRow, | ||
TableHead, | ||
TableHeadCell, | ||
} from 'flowbite-svelte'; | ||
import ExternalLinkWrapper from '$lib/components/ExternalLinkWrapper.svelte'; | ||
import { gradeGuidelineTableData } from '$lib/components/TaskGrades/grade_guideline_table_data'; | ||
import GradeLabel from '$lib/components/GradeLabel.svelte'; | ||
import { TASK_GRADE_CRITERIA_SHEET_URL } from '$lib/constants/urls'; | ||
</script> | ||
|
||
<div class="container mx-auto w-5/6 lg:w-2/3 mt-6 text-gray-800 dark:text-gray-300"> | ||
<div> | ||
AtCoder Beginners Contest(通称、ABC)の配点・問題と、対応するグレードの目安を示しています。 | ||
</div> | ||
<div> | ||
また、各グレードの基準に関しては、 | ||
<ExternalLinkWrapper url={TASK_GRADE_CRITERIA_SHEET_URL} description="こちら" /> | ||
をご覧ください。 | ||
</div> | ||
</div> | ||
|
||
<div class="container w-full lg:w-2/3 mx-auto mt-3 sm:mt-4 overflow-auto rounded-md border"> | ||
<Table | ||
shadow | ||
id="grade-guideline" | ||
class="text-md table-fixed w-full" | ||
aria-label="Task grade guideline table" | ||
> | ||
<TableHead class="text-sm bg-gray-100"> | ||
<TableHeadCell class="w-24 xs:w-32 px-3 sm:px-6 text-center">ABCの配点</TableHeadCell> | ||
<TableHeadCell class="w-40 hidden sm:table-cell text-center">問題</TableHeadCell> | ||
<TableHeadCell class="w-40 text-center">対応グレード</TableHeadCell> | ||
</TableHead> | ||
|
||
<TableBody tableBodyClass="divide-y"> | ||
{#each gradeGuidelineTableData as { point, task, lowerGrade, upperGrade }} | ||
<TableBodyRow> | ||
<TableBodyCell class="text-sm xs:text-md text-center py-3">{point}</TableBodyCell> | ||
<TableBodyCell class="text-center py-3 hidden sm:table-cell">{task}</TableBodyCell> | ||
|
||
{#if upperGrade === lowerGrade} | ||
<TableBodyCell class="flex items-center justify-center space-x-3 py-3"> | ||
<GradeLabel taskGrade={upperGrade} /> | ||
</TableBodyCell> | ||
{:else} | ||
<TableBodyCell class="flex items-center justify-center space-x-3 py-3"> | ||
<GradeLabel taskGrade={lowerGrade} /> | ||
<p>〜</p> | ||
<GradeLabel taskGrade={upperGrade} /> | ||
</TableBodyCell> | ||
{/if} | ||
</TableBodyRow> | ||
{/each} | ||
</TableBody> | ||
</Table> | ||
</div> |
127 changes: 127 additions & 0 deletions
127
src/lib/components/TaskGrades/grade_guideline_table_data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
import { TaskGrade } from '$lib/types/task'; | ||
|
||
type TaskGradeGuideline = { | ||
point: string; | ||
task: string; | ||
lowerGrade: TaskGrade; | ||
upperGrade: TaskGrade; | ||
}; | ||
|
||
type TaskGradeGuidelines = TaskGradeGuideline[]; | ||
|
||
export const gradeGuidelineTableData: TaskGradeGuidelines = [ | ||
{ | ||
point: '〜 100', | ||
task: '(JOI 一次予選 A)', | ||
lowerGrade: TaskGrade.Q10, | ||
upperGrade: TaskGrade.Q10, | ||
}, | ||
{ | ||
point: '100', | ||
task: 'A', | ||
lowerGrade: TaskGrade.Q9, | ||
upperGrade: TaskGrade.Q6, | ||
}, | ||
{ | ||
point: '150', | ||
task: 'A、B', | ||
lowerGrade: TaskGrade.Q7, | ||
upperGrade: TaskGrade.Q5, | ||
}, | ||
{ | ||
point: '200', | ||
task: 'B', | ||
lowerGrade: TaskGrade.Q6, | ||
upperGrade: TaskGrade.Q4, | ||
}, | ||
{ | ||
point: '250', | ||
task: 'B、C', | ||
lowerGrade: TaskGrade.Q5, | ||
upperGrade: TaskGrade.Q3, | ||
}, | ||
{ | ||
point: '300', | ||
task: 'C', | ||
lowerGrade: TaskGrade.Q4, | ||
upperGrade: TaskGrade.Q2, | ||
}, | ||
{ | ||
point: '350', | ||
task: 'C、D', | ||
lowerGrade: TaskGrade.Q3, | ||
upperGrade: TaskGrade.Q1, | ||
}, | ||
{ | ||
point: '400', | ||
task: 'D', | ||
lowerGrade: TaskGrade.Q2, | ||
upperGrade: TaskGrade.Q1, | ||
}, | ||
{ | ||
point: '425', | ||
task: 'D、E', | ||
lowerGrade: TaskGrade.Q2, | ||
upperGrade: TaskGrade.Q1, | ||
}, | ||
{ | ||
point: '450', | ||
task: 'D、E', | ||
lowerGrade: TaskGrade.Q1, | ||
upperGrade: TaskGrade.D1, | ||
}, | ||
{ | ||
point: '475', | ||
task: 'E、F', | ||
lowerGrade: TaskGrade.Q1, | ||
upperGrade: TaskGrade.D2, | ||
}, | ||
{ | ||
point: '500', | ||
task: 'E、F', | ||
lowerGrade: TaskGrade.Q1, | ||
upperGrade: TaskGrade.D3, | ||
}, | ||
{ | ||
point: '525', | ||
task: 'F', | ||
lowerGrade: TaskGrade.D1, | ||
upperGrade: TaskGrade.D3, | ||
}, | ||
{ | ||
point: '550', | ||
task: 'F', | ||
lowerGrade: TaskGrade.D2, | ||
upperGrade: TaskGrade.D4, | ||
}, | ||
{ | ||
point: '575', | ||
task: 'F、G', | ||
lowerGrade: TaskGrade.D3, | ||
upperGrade: TaskGrade.D4, | ||
}, | ||
{ | ||
point: '600', | ||
task: 'G', | ||
lowerGrade: TaskGrade.D3, | ||
upperGrade: TaskGrade.D4, | ||
}, | ||
{ | ||
point: '625', | ||
task: 'G', | ||
lowerGrade: TaskGrade.D3, | ||
upperGrade: TaskGrade.D5, | ||
}, | ||
{ | ||
point: '650', | ||
task: 'G', | ||
lowerGrade: TaskGrade.D4, | ||
upperGrade: TaskGrade.D5, | ||
}, | ||
{ | ||
point: '675', | ||
task: 'G', | ||
lowerGrade: TaskGrade.D5, | ||
upperGrade: TaskGrade.D6, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters