Skip to content

Commit

Permalink
scoringpage done
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrecursion committed May 19, 2024
1 parent 6acdde4 commit 40ee204
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 50 deletions.
16 changes: 8 additions & 8 deletions frontend/frontend/src/pages/scoresPage/ProjectScoresPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Header } from '../../components/Header'
import { Button, Card } from '../../components/CustomComponents.tsx'
import {Button, Card, SecondaryButton} from '../../components/CustomComponents.tsx'
import {
Box,
CircularProgress,
Expand Down Expand Up @@ -372,11 +372,11 @@ export function ProjectScoresPage() {
spacing={2}
marginY={6}
>
<Button onClick={exportSubmissions}>
<SecondaryButton onClick={exportSubmissions}>
{t('export_submissions')}
</Button>
</SecondaryButton>

<Button variant={'contained'}>
<SecondaryButton variant={'contained'}>
{t('upload_scores')}
<VisuallyHiddenInput
type="file"
Expand All @@ -385,14 +385,14 @@ export function ProjectScoresPage() {
multiple={false}
onChange={uploadScores}
/>
</Button>
</SecondaryButton>
</Stack>
</Box>
<Box
display="flex"
flexDirection="row-reverse"
padding={'3px'}
sx={{ width: '50%', height: 'auto' }}
sx={{ width: '50%', height: '40px', marginTop: 6 }}
>
{loading ? (
<Skeleton
Expand All @@ -413,15 +413,15 @@ export function ProjectScoresPage() {
'&:hover': {
color: 'text.primary',
},
backgroundColor:
'primary.main',
backgroundColor: 'primary.main',
borderRadius: 2,
}}
>
<SaveIcon />
</IconButton>
</>
)}
<Box paddingLeft={'10px'}/>
<IconButton
onClick={() =>
setOpenDeleteScoresPopup(true)
Expand Down
40 changes: 14 additions & 26 deletions frontend/frontend/src/pages/scoresPage/StudentScoreListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Divider } from '../../components/CustomComponents.tsx'
import {Divider, EvenlySpacedRow} from '../../components/CustomComponents.tsx'
import {
CircularProgress,
ListItemIcon,
Expand Down Expand Up @@ -95,32 +95,20 @@ export function StudentScoreListItem({

return (
<>
<ListItem key={key} sx={{ margin: 0 }} disablePadding={true}>
<ListItem key={key} sx={{ maxHeight: '35px' }} disablePadding>
{/* Inner list item for displaying submission details */}
<ListItem
sx={{
width: '100%',
height: 30,
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
paddingX: 1,
paddingY: 3,
borderRadius: 2,
}}
>
<ListItem>
{/* Content section */}
<>
{loading ? (
<CircularProgress size={20} color={'primary'} />
) : (
<EvenlySpacedRow items={[
<ListItemText
sx={{ maxWidth: 200 }}
primary={name}
/>
)}
/>,
<ListItemText
sx={{ maxWidth: '30%' }}
primary={
lastSubmission
? t('last_submission') +
Expand All @@ -130,12 +118,11 @@ export function StudentScoreListItem({
)
: t('no_submissions')
}
/>
{/* Score section */}
<ListItem sx={{ maxWidth: '30%' }}>
/>,
<ListItem>
{lastSubmission ? (
<>
<Box width={'50px'}>
<Box width={'24px'} height={'25px'}>
<TextField
hiddenLabel
defaultValue={score}
Expand All @@ -144,7 +131,7 @@ export function StudentScoreListItem({
parseInt(event.target.value)
)
}
variant="outlined"
variant="standard"
size="small"
/>
</Box>
Expand All @@ -153,9 +140,8 @@ export function StudentScoreListItem({
) : (
<ListItemText primary={'0/' + maxScore} />
)}
</ListItem>
{/* Display download icon */}
<ListItemText sx={{ maxWidth: 35 }}>
</ListItem>,
<ListItemText >
<ListItemIcon>
<div onClick={downloadSubmission}>
{lastSubmission ? (
Expand All @@ -172,7 +158,9 @@ export function StudentScoreListItem({
)}
</div>
</ListItemIcon>
</ListItemText>
</ListItemText>]}
/>
)}
</>
</ListItem>
</ListItem>
Expand Down
25 changes: 9 additions & 16 deletions frontend/frontend/src/pages/scoresPage/StudentsView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Divider } from '../../components/CustomComponents.tsx'
import {Divider, EvenlySpacedRow} from '../../components/CustomComponents.tsx'
import { Box, Skeleton, Typography } from '@mui/material'
import List from '@mui/material/List'
import { StudentScoreListItem } from './StudentScoreListItem.tsx'
Expand Down Expand Up @@ -116,29 +116,25 @@ export function StudentsView({
<Box
aria-label={'scoresHeader'}
sx={{
backgroundColor: 'primary.light',
margin: 0,
backgroundColor: 'secondary.main',
height: 20,
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
padding: '30px',
padding: 3,
}}
>
<>
<EvenlySpacedRow items={[
<Typography variant="h5" sx={{ fontWeight: 'bold' }}>
{t('group')}
</Typography>
</Typography>,
<Typography variant="h5" sx={{ fontWeight: 'bold' }}>
{t('time')}
</Typography>
</Typography>,
<Typography variant="h5" sx={{ fontWeight: 'bold' }}>
Score
</Typography>
</Typography>,
<Typography variant="h5" sx={{ fontWeight: 'bold' }}>
Download
</Typography>
</>
</Typography>]}
/>
</Box>
<Divider color={'text.main'}></Divider>
<Box
Expand All @@ -148,9 +144,6 @@ export function StudentsView({
height: 450,
display: 'flex',
flexDirection: 'column',
padding: 1,
borderRadius: 2,
paddingBottom: 0,
}}
>
{/* Scrollable list of students */}
Expand Down

0 comments on commit 40ee204

Please sign in to comment.