2023-05-31 08:36:15 +03:00
|
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
|
|
import StarRating from "@components/StarRating/StarRating";
|
|
|
|
|
|
2023-12-12 11:22:53 +03:00
|
|
|
|
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)
|
|
|
|
|
}
|
2023-05-31 08:36:15 +03:00
|
|
|
|
return (
|
|
|
|
|
<div className="report">
|
|
|
|
|
<div className="report__row">
|
|
|
|
|
<div className="report__column">
|
|
|
|
|
<StarRating
|
|
|
|
|
color={"#52B709"}
|
|
|
|
|
countStars={1}
|
|
|
|
|
countActiveStars={0.5}
|
|
|
|
|
size={61}
|
|
|
|
|
/>
|
|
|
|
|
<div className="report__job-title">
|
2023-12-12 11:22:53 +03:00
|
|
|
|
{info.questionnaire_title}
|
2023-05-31 08:36:15 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="report__column">
|
2023-12-12 11:22:53 +03:00
|
|
|
|
<div className="report__value">{Boolean(correctAnswers()) ? correctAnswers() : 0}</div>
|
2023-05-31 08:36:15 +03:00
|
|
|
|
<div className="report__text">Правильных ответов</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="report__column">
|
2023-12-12 11:22:53 +03:00
|
|
|
|
<div className="report__value report__value_false">{Boolean(correctWrongAnswers()) ? correctWrongAnswers() : 0}</div>
|
2023-05-31 08:36:15 +03:00
|
|
|
|
<div className="report__text">Не правильных ответов</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="report__column">
|
|
|
|
|
<div className="report__status-text">Статус:</div>
|
|
|
|
|
<div className="report__status">Пройдено!</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|