Skip to content

Commit

Permalink
Modify instructions page styling
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisTismenko committed Mar 11, 2020
1 parent 4b95d96 commit 105812c
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 17 deletions.
4 changes: 1 addition & 3 deletions quiz.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"8 bytes",
"16 bytes",
"32 bytes",
"64 bytes",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Screm, bibr screm!"
"64 bytes"
],
"correct": 1
},
Expand Down
8 changes: 8 additions & 0 deletions src/components/core/UI/Code.react.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import classes from './style/Code.module.css';

const Code = ({children}) => {
return <pre className={classes.Code}>{children}</pre>;
};

export default Code;
5 changes: 3 additions & 2 deletions src/components/core/UI/style/Card.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
}

.instructions {
width: 40rem;
height: 40rem;
width: 45rem;
height: 80vh;
border: none;
border-radius: 1.5rem;
box-shadow: 2.5px 5px 15px rgba(0, 0, 0, 0.25);
padding: 1em 1em 1em 1.75em;
}
4 changes: 4 additions & 0 deletions src/components/core/UI/style/Code.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Code {
background-color: #eeeeee;
padding: 1em;
}
48 changes: 37 additions & 11 deletions src/landing/Landing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@ import {randomizeArray} from '../service/util/util';
import IconWrapper from '../components/core/UI/IconWrapper.react';
import classes from './Landing.module.css';
import Modal from '../components/core/UI/Modal.react';
import Code from '../components/core/UI/Code.react';

const instructionsText = `[
{
"question": "In Java, how many bytes is a long?",
"options": [
"4 bytes",
"8 bytes",
"16 bytes",
"32 bytes",
"64 bytes",
],
"correct": 1
},
{
"question": "True or False: A string is a primitive datatype in Java.",
"options": [
"True",
"False"
],
"correct": 1
}
]`;

const Landing = () => {
const [isLoading, setLoading] = useState(false);
Expand Down Expand Up @@ -63,22 +86,25 @@ const Landing = () => {
{isViewingInstructions && (
<Modal hideModal={handleHideModal}>
<Card instructions>
<VerticalLayout center="middle">
<Text type="body1"> In order to use this tool, your .json quiz file must be formatted in a specific way.
</Text>
<Text type='body1'>
Format your questions and multiple choice answers as shown in the example below, specifying the correct answer by its index in the options array.
</Text>



<div className={classes.Instructions}>
<VerticalLayout center="middle">
<Text type="body1">
In order to use this tool, your .json quiz file must be
formatted in a specific way.
</Text>
<Text type="body1">
Format your questions and multiple choice answers as shown
in the example below, specifying the correct answer by its
index in the options array.
</Text>
<Code>{instructionsText}</Code>
<Button
type="button"
value="got it"
onClick={handleHideModal}
></Button>

</VerticalLayout>
</VerticalLayout>
</div>
</Card>
</Modal>
)}
Expand Down
6 changes: 6 additions & 0 deletions src/landing/Landing.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
}
.format_link {
margin-top: 2rem;
}

.Instructions {
height: 100%;
overflow-y: auto;
overflow-x: hidden;
}
2 changes: 1 addition & 1 deletion src/quiz/components/style/QuestionList.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.QuestionList {
overflow-y: scroll;
overflow-y: auto;
word-break: break-all;
}

0 comments on commit 105812c

Please sign in to comment.