Skip to content

Commit 1a53182

Browse files
committed
course revision sessions page
1 parent 5974215 commit 1a53182

File tree

11 files changed

+129
-200
lines changed

11 files changed

+129
-200
lines changed

components/CourseRevisionCard.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { styled } from "@stitches/react";
2+
3+
4+
export const CourseRevisionCard = styled('div', {
5+
color: "#ebf2ff",
6+
padding: '1.2rem 1.6rem',
7+
display: 'flex',
8+
flexFlow: 'column nowrap',
9+
background: 'linear-gradient(0.25turn, #4287f5, #4386f0);',
10+
boxShadow: 'inset 0px 0px 35px -22px rgba(0,0,0,0.33)',
11+
borderRadius: '1.2rem',
12+
length: '100%',
13+
width: "100%",
14+
transitionProperty: "width, padding, margin, background",
15+
transitionDuration: "400ms",
16+
transitionTimingFunction: "ease",
17+
18+
'&:hover': {
19+
background: 'linear-gradient(0.25turn, #5294ff, #5796fa);',
20+
cursor: 'pointer',
21+
paddingTop: 'calc(1.2rem - 8px)',
22+
marginBottom: "8px",
23+
paddingLeft: "calc(1.6rem - 6px)",
24+
width: "calc(100% - 6px)",
25+
},
26+
27+
'&:active': {
28+
background: 'linear-gradient(0.25turn, #4287f5, #4386f0);',
29+
}
30+
})

components/Navbar.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ const navItems = [
2525
'path': 'creators',
2626
'title': 'Contribute',
2727
},
28-
{
29-
'path': '2521-revision-practical',
30-
'title': 'COMP2521',
31-
},
3228
{
3329
'path': 'opendev',
3430
'title': 'Open Dev',

components/ProblemCard.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ export const ProblemCard = styled('div', {
77
display: 'flex',
88
flexFlow: 'column nowrap',
99
backgroundColor: '#dae9f7',
10-
boxShadow: '0px 0px 35px -22px rgba(0,0,0,0.33)',
1110
borderRadius: '1.2rem',
1211
length: '100%',
1312

1413
'&:hover': {
1514
backgroundColor: '#e1ecf7',
1615
cursor: 'pointer'
17-
}
16+
},
1817

1918
})

contentlayer.config.js

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -62,43 +62,19 @@ export const ArticleType = defineDocumentType(() => ({
6262
computedFields
6363
}))
6464

65-
export const Puzzle = defineDocumentType(() => ({
66-
name: 'Puzzle',
67-
filePathPattern: `2521-revision-practical/*.mdx`,
65+
export const CourseRevisionOffering = defineDocumentType(() => ({
66+
name: 'CourseRevisionOffering',
67+
filePathPattern: `course-revision/*.mdx`,
6868
contentType: 'mdx',
6969
fields: {
7070
title: {
7171
type: 'string',
72-
description: 'The title of the puzzle',
72+
description: 'The title of the exercise set e.g. COMP1511 22T3 Revision Session',
7373
required: true
7474
},
7575
desc: {
7676
type: 'string',
77-
description: 'One sentence that summarises the puzzle objective.',
78-
required: true
79-
},
80-
class: {
81-
type: 'string',
82-
description: 'The class the puzzle relates to',
83-
required: true
84-
},
85-
difficulty: {
86-
type: 'number',
87-
description: 'The difficulty of the puzzle',
88-
required: true
89-
}
90-
},
91-
computedFields
92-
}))
93-
94-
export const CourseRevisionOffering = defineDocumentType(() => ({
95-
name: 'CourseRevisionOffering',
96-
filePathPattern: `course-revision/*.mdx`,
97-
contentType: 'mdx',
98-
fields: {
99-
title: {
100-
type: 'string',
101-
description: 'The title of the exercise set',
77+
description: 'A brief 1-2 sentence description of what this course revision contains',
10278
required: true
10379
},
10480
course: {
@@ -144,19 +120,9 @@ export const CourseRevisionExercise = defineDocumentType(() => ({
144120
computedFields
145121
}))
146122

147-
export const BlockContent = defineDocumentType(() => ({
148-
name: 'BlockContent',
149-
filePathPattern: `block-content/*.mdx`,
150-
contentType: 'mdx',
151-
fields: {},
152-
computedFields: {
153-
slug: computedFields.slug
154-
}
155-
}))
156-
157123
export default makeSource({
158124
contentDirPath: 'data',
159-
documentTypes: [ArticleType, Puzzle, CourseRevisionOffering, CourseRevisionExercise, BlockContent],
125+
documentTypes: [ArticleType, CourseRevisionOffering, CourseRevisionExercise],
160126
mdx: {
161127
remarkPlugins: [remarkGfm],
162128
rehypePlugins: [

data/course-revision/1511.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
---
22
title: CSESoc COMP1511 Revision Practice Problems
3+
desc: Practical coding exercises to help you prepare for your COMP1511 22T3 final exam 😄
34
course: COMP1511
45
offering: 22T3
56
---
67

7-
# CSESoc COMP2521 Revision Practice Problems
8+
# CSESoc COMP1511 Revision Practice Problems
89

9-
Note: For COMP2521 theory revision problems, see [here](https://learn.csesoc.org.au/articles/2521-revision-theory)
10-
11-
This is a set of 5 practical programming problems designed to help you prepare for your COMP2521 22T2 final exam.
10+
This is a set of ### practical programming problems designed to help you prepare for your COMP1511 22T3 final exam.
1211

1312
There are autotests for each problem on cse servers which you can use to check your solutions.
1413

1514
To start, log in to cse servers via ssh and create a new folder:
1615

1716
```bash:~
18-
$ mkdir 2521-revision
19-
$ cd 2521-revision
17+
$ mkdir 1511-revision
18+
$ cd 1511-revision
2019
```
2120

2221
Then run the following command to copy the template files:
2322

24-
```bash:~/2521-revision
25-
$ 2521 fetch revision
23+
```bash:~/1511-revision
24+
$ 1511 fetch csesoc-revision
2625
```

data/course-revision/2521.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: CSESoc COMP2521 Revision Practice Problems
3+
desc: Practical coding exercises to help you prepare for your COMP2521 22T2 final exam 😄
34
course: COMP2521
45
offering: 22T2
56
---

pages/2521-revision-practical/[slug].tsx

Lines changed: 0 additions & 83 deletions
This file was deleted.

pages/2521-revision-practical/index.tsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

pages/course-revision/[course_offering]/[exercise]/index.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Link from 'next/link'
1515
import { ArrowDown, ArrowLeft } from 'phosphor-react'
1616
import ArticleLayout from 'components/ArticleLayout'
1717
import { Button } from 'components/Button'
18+
import { useRouter } from 'next/router'
1819

1920
const defaultComponents = {
2021
Image,
@@ -47,23 +48,24 @@ export async function getStaticPaths() {
4748
}
4849

4950
export async function getStaticProps({ params }) {
50-
const puzzle = allCourseRevisionExercises.find((e) => e.slug === params.exercise)
51+
const exercise = allCourseRevisionExercises.find((e) => e.slug === params.exercise)
5152
return {
5253
props: {
53-
puzzle
54+
exercise
5455
}
5556
}
5657
}
5758

58-
const PuzzleLayout = ({ puzzle }) => {
59-
const MDXContent = useMDXComponent(puzzle.body.code)
59+
const ExercisePage = ({ exercise }) => {
60+
const router = useRouter();
61+
const MDXContent = useMDXComponent(exercise.body.code)
6062

6163
return (
6264
<ArticleLayout>
6365
<Head>
64-
<title>{puzzle.title}</title>
66+
<title>{exercise.title}</title>
6567
</Head>
66-
<Link href="/1511-revision-practical">
68+
<Link href={`/course-revision/${router.query.course_offering}`}>
6769
<Button css={{ padding: '3px 14px', borderRadius: '100vh', width: "fit-content" }}>
6870
<ArrowLeft />Back
6971
</Button>
@@ -76,15 +78,15 @@ const PuzzleLayout = ({ puzzle }) => {
7678
paddingTop: '$2',
7779
alignSelf: 'center'
7880
}}>
79-
{puzzle.title}
81+
{exercise.title}
8082
</Text>
8183
<Box css={{ paddingTop: '$2' }}>
8284
<Text>
8385
<MDXContent components={components} />
8486
</Text>
8587
</Box>
86-
</ArticleLayout>
88+
</ArticleLayout >
8789
)
8890
}
8991

90-
export default PuzzleLayout
92+
export default ExercisePage

0 commit comments

Comments
 (0)