2023-12-12 11:22:53 +03:00
|
|
|
import React, { useEffect, useState } from "react";
|
2023-05-31 08:36:15 +03:00
|
|
|
import { useSelector } from "react-redux";
|
2023-12-12 11:22:53 +03:00
|
|
|
import { useNavigate, useParams } from "react-router-dom";
|
2023-05-31 08:36:15 +03:00
|
|
|
|
|
|
|
import { selectedTest } from "@redux/quizSlice";
|
|
|
|
|
2023-12-12 11:23:06 +03:00
|
|
|
import { apiRequest } from "@api/request";
|
|
|
|
|
2023-05-31 08:36:15 +03:00
|
|
|
import { Footer } from "@components/Common/Footer/Footer";
|
2023-12-12 11:23:06 +03:00
|
|
|
import { Navigation } from "@components/Navigation/Navigation";
|
2023-05-31 08:36:15 +03:00
|
|
|
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
|
|
|
|
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
|
2023-12-12 11:22:53 +03:00
|
|
|
// import { HeadBottom } from "@components/features/Candidate-lk/HeadBottom";
|
2023-05-31 08:36:15 +03:00
|
|
|
import { AlertResult } from "@components/features/quiz/AlertResult";
|
|
|
|
import { QuizReport } from "@components/features/quiz/QuizReport";
|
|
|
|
|
|
|
|
export const QuizReportPage = () => {
|
|
|
|
const test = useSelector(selectedTest);
|
2023-12-12 11:22:53 +03:00
|
|
|
const params = useParams();
|
2023-05-31 08:36:15 +03:00
|
|
|
|
|
|
|
let navigate = useNavigate();
|
|
|
|
if (!test) {
|
|
|
|
navigate("/quiz");
|
|
|
|
}
|
|
|
|
|
2023-12-12 11:22:53 +03:00
|
|
|
useEffect(() => {
|
2023-12-12 11:23:06 +03:00
|
|
|
apiRequest(
|
|
|
|
`/user-questionnaire/questionnaire-completed?user_questionnaire_uuid=${params.uuid}`
|
|
|
|
).then((res) => {
|
|
|
|
setTestInfo(res);
|
|
|
|
});
|
|
|
|
}, []);
|
2023-12-12 11:22:53 +03:00
|
|
|
|
2023-12-12 11:23:06 +03:00
|
|
|
const [testInfo, setTestInfo] = useState({});
|
2023-12-12 11:22:53 +03:00
|
|
|
|
2023-05-31 08:36:15 +03:00
|
|
|
return (
|
|
|
|
<div className="quiz-report-page">
|
|
|
|
<ProfileHeader />
|
2023-12-12 11:22:53 +03:00
|
|
|
<Navigation />
|
|
|
|
{/*<HeadBottom />*/}
|
2023-05-31 08:36:15 +03:00
|
|
|
<div className="quiz-report-page__container">
|
|
|
|
<ProfileBreadcrumbs
|
|
|
|
links={[
|
|
|
|
{ name: "Главная", link: "/profile-candidate" },
|
|
|
|
{ name: "Тестирование", link: "/quiz" },
|
|
|
|
{ name: "Отчет по тестированию", link: "/quiz/report" },
|
|
|
|
]}
|
|
|
|
/>
|
|
|
|
<div className="quiz-report-page__title main-title">
|
2023-12-12 11:22:53 +03:00
|
|
|
Отчет по тестированию позиции {testInfo.questionnaire_title}
|
2023-05-31 08:36:15 +03:00
|
|
|
</div>
|
|
|
|
<div className="quiz-report-page__report-quiz">
|
2023-12-12 11:22:53 +03:00
|
|
|
<QuizReport info={testInfo} />
|
2023-05-31 08:36:15 +03:00
|
|
|
</div>
|
2023-12-12 11:22:53 +03:00
|
|
|
<AlertResult info={testInfo} />
|
2023-05-31 08:36:15 +03:00
|
|
|
</div>
|
|
|
|
<Footer />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|