From ec7d0716b3fde1a309b9b36591e661e1471174f7 Mon Sep 17 00:00:00 2001 From: Dmitry220 Date: Tue, 21 Nov 2023 17:31:22 +0300 Subject: [PATCH 1/8] quiz --- src/App.js | 2 +- .../features/quiz/CardAviableTest.jsx | 10 +- .../features/quiz/GetOptionTask.jsx | 56 ++--- src/components/features/quiz/HeaderQuiz.jsx | 12 +- .../quiz/Quiz-passing-information.jsx | 108 ++++++--- src/components/features/quiz/Task.js | 214 +++++++++--------- src/hooks/useHandlerFieldTest.js | 40 ++++ src/pages/quiz/PassingTests.js | 60 ++++- src/pages/quiz/QuizPage.js | 39 ++-- src/pages/quiz/QuizReportPage.js | 3 +- src/redux/quizSlice.js | 138 ++--------- 11 files changed, 327 insertions(+), 355 deletions(-) create mode 100644 src/hooks/useHandlerFieldTest.js diff --git a/src/App.js b/src/App.js index 6c0d0e6b..13c11653 100644 --- a/src/App.js +++ b/src/App.js @@ -108,7 +108,7 @@ const App = () => { } /> - } /> + } /> } /> diff --git a/src/components/features/quiz/CardAviableTest.jsx b/src/components/features/quiz/CardAviableTest.jsx index 2f747792..912d7e4d 100644 --- a/src/components/features/quiz/CardAviableTest.jsx +++ b/src/components/features/quiz/CardAviableTest.jsx @@ -5,15 +5,16 @@ import StarRating from "@components/StarRating/StarRating"; import rightArrow from "assets/icons/arrows/arrowRight.svg"; -export const CardAvailableTest = ({ title, description, path, passedTest }) => { +export const CardAvailableTest = ({ title, description, path, status }) => { return (
@@ -27,8 +28,7 @@ export const CardAvailableTest = ({ title, description, path, passedTest }) => {
- - {passedTest && ( + {status === 2 && (

Получить отчет по тестированию

Отчет по тесту diff --git a/src/components/features/quiz/GetOptionTask.jsx b/src/components/features/quiz/GetOptionTask.jsx index 52cd39c9..7223274a 100644 --- a/src/components/features/quiz/GetOptionTask.jsx +++ b/src/components/features/quiz/GetOptionTask.jsx @@ -1,44 +1,18 @@ import React from "react"; -export const GetOptionTask = ({ type, answer, handleChange, inputValue }) => { - switch (type) { - case "1": - return ( -
-