render() { return ( <div className={classes.Quiz}> <div className={classes.QuizWrapper}> <h1>Answer all question</h1> { this.state.isFinished ? <FinishedQuiz results={this.state.results} quiz={this.state.quiz} /> : <ActiveQuiz answers={this.state.quiz[this.state.activeQuestion].answers} question={this.state.quiz[this.state.activeQuestion].question} onClickAnswer={this.onClickAnswerHandler} questionNumber={this.state.activeQuestion + 1} quizLength={this.state.quiz.length} state={this.state.answerState} /> } </div> </div> ) }
render() { return ( <div className={classes.Quiz}> {!this.state.isFinished && <div className={classes.content}> <h1> Answer all questions </h1> <div className={classes.QuizContent}> <ActiveQuiz answers={this.state.quiz[this.state.activeQuestion].answers} question={this.state.quiz[this.state.activeQuestion].question} onAnswerClickHandler={this.onAnswerClickHandler} answersLength={this.state.quiz.length} activeQuestion={this.state.activeQuestion + 1} state={this.state.answerState}/> </div> </div> } {this.state.isFinished && <FinishQuiz results={this.state.results} quiz={this.state.quiz} showQuizPage={this.showQuizPage}/> } </div> ) }
render() { return ( <div className={classes.Quiz}> <div className={classes.QuizWrapper}> <h1>Ответьте на все вопросы</h1> { this.state.isFinished ? <FinishedQuiz /> : <ActiveQuiz answers={this.state.quiz[this.state.activeQuestion].answers} question={this.state.quiz[this.state.activeQuestion].question} onAnswerClick={this.onAnswerClickHandler} quizLength={this.state.quiz.length} answerNumber={this.state.activeQuestion + 1} state={this.state.answerState} /> } </div> </div> ) }
state.step > 1 && (state.quiz.quizQuestions[state.step - 2].question === "" || state.quiz.quizQuestions[state.step - 2].answers.some( (item) => item.value === "" )) questions[state.step - 2].answers[action.index].value = action.value; return { ...state, questions[state.step - 2].answers.push({ value: "", answer: false, questions[state.step - 2].answers[action.index].answer = !questions[ state.step - 2 ].answers[action.index].answer; return { ...state,