From c78b427546320ed4294f7281cdf2862854a613a2 Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Thu, 29 May 2025 11:29:48 +0300 Subject: [PATCH] =?UTF-8?q?fix=20[P-227]:=20=D1=81=D0=B4=D0=B0=D1=87=D0=B0?= =?UTF-8?q?,=20=D0=BD=D0=B5=D1=81=D0=B4=D0=B0=D1=87=D0=B0=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/testing/DetailCardTest.vue | 11 ++ .../src/components/testing/TestResults.vue | 113 +++++++++++++++++- 2 files changed, 122 insertions(+), 2 deletions(-) diff --git a/src/front/src/components/testing/DetailCardTest.vue b/src/front/src/components/testing/DetailCardTest.vue index 9d879ed0a..153d88214 100644 --- a/src/front/src/components/testing/DetailCardTest.vue +++ b/src/front/src/components/testing/DetailCardTest.vue @@ -34,6 +34,9 @@ :answeredQuestions="answeredQuestions" :totalQuestions="data.question_count" :formattedTime="formattedTime" + :questions="data?.questions" + :userAnswers="answers" + @restart="startTest" /> @@ -138,11 +141,19 @@ export default { const startTest = async () => { await deactivateOldTestings(testId); + await getTestById(testId); + testStarted.value = true; testFinished.value = false; + + answers.value = Array(data.value.questions.length).fill(null); data.value = { ...data.value, time: data.value.time * 60 }; + if (timer) { + clearInterval(timer); + } + timer = setInterval(() => { if (data.value?.time > 0) { data.value = { ...data.value, time: data.value.time - 1 }; diff --git a/src/front/src/components/testing/TestResults.vue b/src/front/src/components/testing/TestResults.vue index f35d593fd..417815185 100644 --- a/src/front/src/components/testing/TestResults.vue +++ b/src/front/src/components/testing/TestResults.vue @@ -14,17 +14,35 @@ mdi-close-circle
Не расстраивайтесь!
Попробуйте еще раз
+ + Пройти заново + mdi-reload + - + mdi-checkbox-marked-circle

{{ correctAnswers }}/{{ totalQuestions }}

-
Правильных ответов
+
+ Правильных ответов + mdi-information +
@@ -44,11 +62,63 @@
+ + + + + + Правильные ответы + + + + + + + +
+ + {{ isQuestionCorrect(index) ? 'mdi-check-circle' : 'mdi-close-circle' }} + + Вопрос {{ index + 1 }} +
+
+ +

{{ question.name }}

+ +
+ + {{ answer.right_wrong ? 'mdi-check' : 'mdi-minus' }} + + + {{ answer.name }} + + (правильный ответ) +
+
+
+
+
+
+
@@ -88,6 +193,10 @@ export default { transform: translateY(-5px); } +.cursor-pointer { + cursor: pointer; +} + .success-light { background-color: #E8F5E9 !important; }