44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
import React from "react";
|
||
|
||
import StarRating from "@components/StarRating/StarRating";
|
||
|
||
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">
|
||
<div className="report__column">
|
||
<StarRating
|
||
color={"#52B709"}
|
||
countStars={1}
|
||
countActiveStars={0.5}
|
||
size={61}
|
||
/>
|
||
<div className="report__job-title">{info.questionnaire_title}</div>
|
||
</div>
|
||
<div className="report__column">
|
||
<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">
|
||
{Boolean(correctWrongAnswers()) ? correctWrongAnswers() : 0}
|
||
</div>
|
||
<div className="report__text">Не правильных ответов</div>
|
||
</div>
|
||
<div className="report__column">
|
||
<div className="report__status-text">Статус:</div>
|
||
<div className="report__status">Пройдено!</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
);
|
||
};
|