fix(client): nicer error message and layout update

This commit is contained in:
Mrugesh Mohapatra
2020-04-24 18:06:16 +05:30
parent 8479250a14
commit 286ba7689b

View File

@ -131,6 +131,7 @@ export class Project extends Component {
handleOptionChange = changeEvent => { handleOptionChange = changeEvent => {
this.setState({ this.setState({
showWrong: false,
selectedOption: parseInt(changeEvent.target.value, 10) selectedOption: parseInt(changeEvent.target.value, 10)
}); });
}; };
@ -191,9 +192,7 @@ export class Project extends Component {
. .
</i> </i>
</div> </div>
<Spacer />
<ChallengeDescription description={description} /> <ChallengeDescription description={description} />
<Spacer />
<SanitizedSpan text={text} /> <SanitizedSpan text={text} />
<Spacer /> <Spacer />
<div className='video-quiz-options'> <div className='video-quiz-options'>
@ -217,6 +216,20 @@ export class Project extends Component {
))} ))}
</div> </div>
<Spacer /> <Spacer />
<div
style={{
textAlign: 'center'
}}
>
{this.state.showWrong ? (
<span>
Sorry, that's not the right answer. Give it another try?
</span>
) : (
<span>Click the button below to check your answer.</span>
)}
</div>
<Spacer />
<Button <Button
block={true} block={true}
bsSize='large' bsSize='large'
@ -227,14 +240,6 @@ export class Project extends Component {
> >
Check your answer Check your answer
</Button> </Button>
<Spacer />
<div
style={{
visibility: this.state.showWrong ? 'visible' : 'hidden'
}}
>
Wrong. Try again.
</div>
<Spacer size={2} /> <Spacer size={2} />
</Col> </Col>
<CompletionModal blockName={blockName} /> <CompletionModal blockName={blockName} />