This commit is contained in:
Antti Pilto 2018-11-17 16:16:32 +02:00
parent f6bc13bfb9
commit dab55e029f

View file

@ -229,14 +229,16 @@ class Question extends Component {
{this.getPreviousResult()}
<div className="big-character">{this.getShowableQuestion()}</div>
<div className="answer-container">
{this.props.stage<3?this.state.answerOptions.map(function(answer, idx) {
return <AnswerButton answer={answer}
className={btnClass}
key={idx}
answertype={this.getAnswerType()}
handleAnswer={this.handleAnswer} />
}, this):
<div className="answer-form-container">
{
this.props.stage<3 ?
this.state.answerOptions.map((answer, idx) => {
return <AnswerButton answer={answer}
className={btnClass}
key={idx}
answertype={this.getAnswerType()}
handleAnswer={this.handleAnswer} />
})
: <div className="answer-form-container">
<form onSubmit={this.handleSubmit}>
<input autoFocus className="answer-input" type="text" value={this.state.currentAnswer} onChange={this.handleAnswerChange} />
</form>