quiz
This commit is contained in:
@ -2,7 +2,7 @@ import React from "react";
|
||||
|
||||
import suucessIcon from "assets/images/quiz/success.png";
|
||||
|
||||
export const AlertResult = () => {
|
||||
export const AlertResult = ({info}) => {
|
||||
const successTest = false;
|
||||
|
||||
return (
|
||||
@ -17,7 +17,7 @@ export const AlertResult = () => {
|
||||
className="alert-result__text"
|
||||
style={{ color: successTest ? "#52B709" : "#5B6871" }}
|
||||
>
|
||||
Благодарим Вас за прохождение теста "Junior разработчик". Ваши
|
||||
Благодарим Вас за прохождение теста "{info.questionnaire_title}". Ваши
|
||||
результаты проверены, готовы пригласить Вас в команду
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@ export const CardAvailableTest = ({ title, description, path, status }) => {
|
||||
return (
|
||||
<div className="card-available-test">
|
||||
<Link
|
||||
to={`/${path}`}
|
||||
to={status === 2 ? `/quiz/report/${path}` : `/quiz/test/${path}`}
|
||||
aria-disabled={true}
|
||||
className="card-available-test__container"
|
||||
style={
|
||||
@ -33,7 +33,7 @@ export const CardAvailableTest = ({ title, description, path, status }) => {
|
||||
{status === 2 && (
|
||||
<div className="card-available-test__finished">
|
||||
<p>Получить отчет по тестированию</p>
|
||||
<Link to={"/quiz/report"}>Отчет по тесту</Link>
|
||||
<Link to={`/quiz/report/${path}`}>Отчет по тесту</Link>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
@ -2,7 +2,13 @@ import React from "react";
|
||||
|
||||
import StarRating from "@components/StarRating/StarRating";
|
||||
|
||||
export const QuizReport = () => {
|
||||
export const QuizReport = ({info}) => {
|
||||
function correctAnswers() {
|
||||
return info.number_questions * info.percent_correct_answers
|
||||
}
|
||||
function correctWrongAnswers() {
|
||||
return info.number_questions * (1 - info.percent_correct_answers)
|
||||
}
|
||||
return (
|
||||
<div className="report">
|
||||
<div className="report__row">
|
||||
@ -14,15 +20,15 @@ export const QuizReport = () => {
|
||||
size={61}
|
||||
/>
|
||||
<div className="report__job-title">
|
||||
Junior <br /> разработчик
|
||||
{info.questionnaire_title}
|
||||
</div>
|
||||
</div>
|
||||
<div className="report__column">
|
||||
<div className="report__value">22</div>
|
||||
<div className="report__value">{Boolean(correctAnswers()) ? correctAnswers() : 0}</div>
|
||||
<div className="report__text">Правильных ответов</div>
|
||||
</div>
|
||||
<div className="report__column">
|
||||
<div className="report__value report__value_false">02</div>
|
||||
<div className="report__value report__value_false">{Boolean(correctWrongAnswers()) ? correctWrongAnswers() : 0}</div>
|
||||
<div className="report__text">Не правильных ответов</div>
|
||||
</div>
|
||||
<div className="report__column">
|
||||
|
Reference in New Issue
Block a user