Skip to content

Commit 5f1c474

Browse files
Robert MiddletonRobert Middleton
authored andcommitted
Merge branch 'dev' of https://github.com/CPSECapstone/webrew into studentOverviewBreakdown
2 parents 583b8ea + 7340e0e commit 5f1c474

File tree

20 files changed

+30559
-180
lines changed

20 files changed

+30559
-180
lines changed

package-lock.json

Lines changed: 30282 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App/App.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
.App {
22
text-align: left;
33
height: 100%;
4+
background-color: #fff;
5+
}
6+
7+
.side {
8+
background-color: #fff;
49
}
510

611
.App-logo {
@@ -46,4 +51,4 @@
4651
.content-container {
4752
background-color: ghostwhite;
4853
}
49-
}
54+
}

src/App/App.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ function App() {
5757
<Navigation />
5858
<div className="main container-fluid">
5959
<div className="row h-100">
60-
<div className="sidebar-container col-md-2">
61-
<img src={StudentPicture} alt="" style={{ width: 180, height: 180 }} />
62-
{fname}
60+
<div className="sidebar-container col-md-2 p-0 side">
61+
<div className="img-container">
62+
<img src={StudentPicture} alt="" className="img-fluid" />
63+
</div>
64+
<div className="pl-2 pt-2 pr-2">{fname}</div>
6365
<Sidebar />
6466
</div>
65-
<div className="content-container col-md-10">
67+
<div className="content-container col-md-10 p-0">
6668
<Content />
6769
</div>
6870
</div>

src/Components/Sidebar/Sidebar.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
flex-direction: column;
66
align-items: center;
77
padding: 22px;
8+
background-color: #fff;
89
}
910

10-
1111
.sidebar .menu-container {
1212
width: 80px;
1313
margin-bottom: 10px;
1414
color: ghostwhite;
1515
text-align: center;
1616
align-self: center;
1717
padding-top: 22px !important;
18-
1918
}
2019

2120
.menu-container .menu-icon {
@@ -31,4 +30,4 @@
3130
text-decoration: none;
3231
font-weight: 700;
3332
font-size: 1rem;
34-
}
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { InputGroup, FormControl } from 'react-bootstrap';
2+
3+
function FrBlock({
4+
title,
5+
question,
6+
answer,
7+
cssKey,
8+
}: {
9+
title: string;
10+
question: string;
11+
answer: string;
12+
cssKey: number;
13+
}) {
14+
return (
15+
<div className={`${cssKey % 2 === 1 ? 'white ' : 'gray '}row`}>
16+
<div className="col-md-6 text-center py-5 mx-auto">
17+
<h3 className="text-left mb-3">{title}</h3>
18+
<InputGroup className="mb-3">
19+
<div className="question-container p-4 shadow w-100">
20+
<p className="text-left">{question}</p>
21+
<br />
22+
<FormControl value={answer} disabled />
23+
</div>
24+
</InputGroup>
25+
</div>
26+
</div>
27+
);
28+
}
29+
30+
export default FrBlock;

src/Components/TaskBlocks/ImageBlock/ImageBlock.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import '../TaskBlock.css';
22

3-
function ImageBlock({ title, contents }: { title: string; contents: string }) {
3+
function ImageBlock({
4+
title,
5+
contents,
6+
cssKey,
7+
}: {
8+
title: string;
9+
contents: string;
10+
cssKey: number;
11+
}) {
412
return (
5-
<div className="row">
6-
<div className="col-md-12 my-2 p-3">
7-
<h2 className="text-left">
8-
<b>{title || 'N/A'}</b>
9-
</h2>
13+
<div className={`${cssKey % 2 === 1 ? 'white ' : 'gray '}row`}>
14+
<div className="col-md-6 text-center py-5 mx-auto">
15+
<h3 className="text-left mb-3">{title}</h3>
1016
{contents ? (
1117
<div className="container" id="img-container">
1218
<img src={contents} alt={contents} className="img-fluid" />

src/Components/TaskBlocks/IntroBlock/IntroBlock.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import '../TaskBlock.css';
22

3-
function IntroBlock({ instructions }: { instructions: string }) {
3+
function IntroBlock({ instructions, cssKey }: { instructions: string; cssKey: number }) {
44
return (
5-
<div className="row">
6-
<div className="col-md-12 my-2 p-3">
7-
<h2 className="text-left">
8-
<b>Introduction</b>
9-
</h2>
5+
<div className="white row">
6+
<div className="col-md-6 text-center py-5 mx-auto">
7+
<h3 className="text-left mb-3">Introduction</h3>
108
<p className="text-left">{instructions || 'No instructions given.'}</p>
119
</div>
1210
</div>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { RadioGroup, FormControlLabel, Radio } from '@material-ui/core';
2+
import { QuestionOption } from '../../../__generated__/types';
3+
4+
function renderQuestionOptions(options: QuestionOption[], answers: number[]) {
5+
const correctChoices = new Set<number>(answers);
6+
7+
return options.map((option: QuestionOption, index: number) => {
8+
const styleName = `${correctChoices.has(option.id) ? 'option-correct ' : ''}option col-md-12`;
9+
10+
return (
11+
<div className="row my-2">
12+
<div className={styleName}>
13+
<input type="radio" value={index} id={`${option.id}`} name="radio" />
14+
<label htmlFor={`${option.id}`}>{option.description}</label>
15+
</div>
16+
</div>
17+
);
18+
});
19+
}
20+
21+
function McBlock({
22+
title,
23+
question,
24+
options,
25+
answers,
26+
cssKey,
27+
}: {
28+
title: string;
29+
question: string;
30+
options: QuestionOption[];
31+
answers: number[];
32+
cssKey: number;
33+
}) {
34+
return (
35+
<div className={`${cssKey % 2 === 1 ? 'white ' : 'gray '}row`}>
36+
<div className="col-md-6 text-center py-5 mx-auto">
37+
<h3 className="text-left mb-3">{title}</h3>
38+
<div className="question-container p-4 shadow w-100">
39+
<p className="text-left">{question}</p>
40+
<br />
41+
<div className="mx-4">{renderQuestionOptions(options, answers)}</div>
42+
</div>
43+
</div>
44+
</div>
45+
);
46+
}
47+
48+
export default McBlock;

src/Components/TaskBlocks/QuizBlock/QuizBlock.tsx

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

src/Components/TaskBlocks/TaskBlock.css

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
.col-md-12 {
2-
background-color: rgb(224, 224, 224);
3-
border-radius: 5px;
4-
border: 1px;
5-
border-color: #007bff;
6-
}
7-
81
#img-container {
92
background-color: #fff;
103
border-radius: 5px;
@@ -24,3 +17,41 @@
2417
padding: 5px 20px;
2518
background-color: #383838;
2619
}
20+
21+
.white {
22+
background-color: #fff;
23+
}
24+
25+
.gray {
26+
background-color: #f2f2f2;
27+
}
28+
29+
h3 {
30+
color: #4274f3;
31+
}
32+
33+
.question-container {
34+
border-radius: 7px;
35+
background-color: #fff;
36+
}
37+
38+
.option {
39+
background-color: #f2f2f2;
40+
border-radius: 25px;
41+
}
42+
43+
.question-container .option-correct {
44+
background-color: #4274f3;
45+
color: #fff;
46+
}
47+
48+
input[type='radio'] {
49+
visibility: hidden;
50+
}
51+
label {
52+
cursor: pointer;
53+
font-size: smaller;
54+
}
55+
input:checked + label {
56+
color: #4274f3;
57+
}

0 commit comments

Comments
 (0)