Skip to content

Commit

Permalink
TRansformovaný zoznam úloh na tabulku
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacspe committed Dec 14, 2024
1 parent efe2c42 commit 92c561c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/components/SemesterAdministration/SemesterAdministration.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {Stack, Typography} from '@mui/material'
import Grid from '@mui/material/Unstable_Grid2'
import {useMutation, useQuery} from '@tanstack/react-query'
import axios, {AxiosError} from 'axios'
import {FC, useState} from 'react'
import {FC, Fragment, useState} from 'react'

import {Button} from '@/components/Clickable/Button'
import {Link} from '@/components/Clickable/Link'
Expand Down Expand Up @@ -149,13 +150,21 @@ export const SemesterAdministration: FC = () => {
<b>Termín série:</b> {formatDateTime(series.deadline)}
</Typography>
</Stack>
<Stack px={2} direction="row" justifyContent="space-between">
{series?.problems.map((problem) => (
<Link key={problem.id} variant="button2" href={`/${seminar}/admin/opravit-ulohu/${problem.id}`}>
{problem.order}. úloha
</Link>
))}
</Stack>
<Grid container spacing={2} xs={12} md={6}>
{series?.problems.map((problem) => {
return (
<Fragment key={problem.id}>
<Grid xs={6}>
<Link key={problem.id} variant="button2" href={`/${seminar}/admin/opravit-ulohu/${problem.id}`}>
{problem.order}. úloha
</Link>
</Grid>
<Grid xs={3}>(0/0)</Grid>
<Grid xs={3}>x</Grid>
</Fragment>
)
})}
</Grid>
</Stack>
))}

Expand Down
2 changes: 2 additions & 0 deletions src/types/api/generated/competition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export interface ProblemCorrection {
export interface Problem {
id: number
submitted?: any
num_solutions: number
num_corrected_solutions: number
text: string
order: number
image?: any | null
Expand Down

0 comments on commit 92c561c

Please sign in to comment.