From 8aad07ae5577584ae728484e040b542026a90595 Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Tue, 24 Jun 2025 14:52:30 +0300 Subject: [PATCH] =?UTF-8?q?fix=20[P-276]:=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/testing/CatalogTest.vue | 20 ++++++++++++++++--- .../src/components/testing/DetailCardTest.vue | 8 +++----- .../testing/HeaderDetailTesting.vue | 2 +- .../src/components/testing/QuestionBlock.vue | 5 ----- .../src/components/testing/TestResults.vue | 4 ++-- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/front/src/components/testing/CatalogTest.vue b/src/front/src/components/testing/CatalogTest.vue index 73a385fcc..187769b25 100644 --- a/src/front/src/components/testing/CatalogTest.vue +++ b/src/front/src/components/testing/CatalogTest.vue @@ -59,9 +59,14 @@ @@ -217,6 +222,15 @@ export default { background: rgba(244, 67, 54, 0.1); } +.no-attempts-container { + display: flex; + flex-direction: column; + align-items: center; + padding: 12px; + max-width: 200px; + text-align: center; +} + .empty-state { min-height: 300px; display: flex; diff --git a/src/front/src/components/testing/DetailCardTest.vue b/src/front/src/components/testing/DetailCardTest.vue index bd76e24cb..3b9330586 100644 --- a/src/front/src/components/testing/DetailCardTest.vue +++ b/src/front/src/components/testing/DetailCardTest.vue @@ -149,17 +149,16 @@ export default { const startTest = async () => { await getTestById(testId); - // Проверяем попытки только для режима экзамена const isExamMode = route.query.mode === 'exam'; if (isExamMode && remainingAttempts.value !== undefined && remainingAttempts.value <= 0) { console.log('Нет оставшихся попыток для прохождения теста'); - return; // Прерываем запуск теста если попыток не осталось + return; } testStarted.value = true; testFinished.value = false; + currentQuestion.value = 0; - // Правильно инициализируем ответы в зависимости от типа вопроса answers.value = data.value.questions.map((question) => { const correctAnswersCount = question.answers.filter(answer => answer.right_wrong).length; return correctAnswersCount > 1 ? [] : null; @@ -175,7 +174,7 @@ export default { timer = setInterval(() => { if (data.value?.time > 0) { - data.value.time = data.value.time - 1; // Обновляем только время, а не весь объект + data.value.time = data.value.time - 1; spentTime.value += 1; } else { finishTest(); @@ -190,7 +189,6 @@ export default { showFinishDialog.value = false; try { - // [{ question_id, answers_id: [id, ...] }] let answersToSubmit = []; data.value.questions.forEach((question, questionIndex) => { const answer = answers.value[questionIndex]; diff --git a/src/front/src/components/testing/HeaderDetailTesting.vue b/src/front/src/components/testing/HeaderDetailTesting.vue index 469816097..f492cce4f 100644 --- a/src/front/src/components/testing/HeaderDetailTesting.vue +++ b/src/front/src/components/testing/HeaderDetailTesting.vue @@ -52,7 +52,7 @@
mdi-close-circle -
Не пройдено
+
Тест не пройден
@@ -211,7 +211,7 @@ export default { return 'Тест успешно пройден. Повторное прохождение недоступно.'; } if (props.remainingAttempts <= 0) { - return 'Нет оставшихся попыток для прохождения теста.'; + return 'Нет оставшихся попыток для прохождения теста. Для повторного прохождения обратитесь к администратору.'; } } return null;