From e4f7a53bce7c4db5322df8b528ea7c3f508c9564 Mon Sep 17 00:00:00 2001
From: Denis Voinovich
Date: Mon, 2 Jun 2025 10:53:10 +0300
Subject: [PATCH 1/7] =?UTF-8?q?fix=20[P-237]:=20=D1=82=D0=B8=D1=82=D1=83?=
=?UTF-8?q?=D0=BB=20=D1=82=D0=B5=D1=81=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?=
=?UTF-8?q?=D0=BD=D0=B8=D1=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/front/src/router/index.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/front/src/router/index.js b/src/front/src/router/index.js
index ddf603cc8..cd457b15a 100644
--- a/src/front/src/router/index.js
+++ b/src/front/src/router/index.js
@@ -181,7 +181,11 @@ const routes = [
path: "/test/testdetail/:id",
name: "TestDetail",
component: () =>
- import("@/components/testing/DetailCardTest.vue")
+ import("@/components/testing/DetailCardTest.vue"),
+ meta: {
+ title: "Тестирование",
+ ico: "mdi-account",
+ },
},
{
path: '/secret',
From 06e80baff83dabe2bd5aaad1b301b8b44e53bd7f Mon Sep 17 00:00:00 2001
From: Denis Voinovich
Date: Mon, 2 Jun 2025 10:58:09 +0300
Subject: [PATCH 2/7] =?UTF-8?q?fix=20[P-237]:=20=D0=BE=D0=BA=D0=BE=D0=BD?=
=?UTF-8?q?=D1=87=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BB=D1=8F=20=D0=BC?=
=?UTF-8?q?=D0=B8=D0=BD=D1=83=D1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/testing/BodyDetailTesting.vue | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/front/src/components/testing/BodyDetailTesting.vue b/src/front/src/components/testing/BodyDetailTesting.vue
index 8b5145784..ee00baa5c 100644
--- a/src/front/src/components/testing/BodyDetailTesting.vue
+++ b/src/front/src/components/testing/BodyDetailTesting.vue
@@ -12,7 +12,7 @@
{{ data?.description }}
- Время на прохождение — {{ data?.time }} минут
+ Время на прохождение — {{ data?.time }} {{ timeWordDeclension }}
@@ -43,12 +43,25 @@ export default {
default: false
}
},
- setup() {
+ setup(props) {
const route = useRoute();
const isExamMode = computed(() => route.query.mode === 'exam');
+ const timeWordDeclension = computed(() => {
+ if (!props.data?.time) return 'минут';
+
+ const lastDigit = props.data.time % 10;
+ const lastTwoDigits = props.data.time % 100;
+
+ if (lastTwoDigits >= 11 && lastTwoDigits <= 14) return 'минут';
+ if (lastDigit === 1) return 'минута';
+ if (lastDigit >= 2 && lastDigit <= 4) return 'минуты';
+ return 'минут';
+ });
+
return {
- isExamMode
+ isExamMode,
+ timeWordDeclension
};
}
};
From 5d437e7bd1d79772c3cfaa5a505cdcbf92080fe4 Mon Sep 17 00:00:00 2001
From: Denis Voinovich
Date: Mon, 2 Jun 2025 11:08:32 +0300
Subject: [PATCH 3/7] =?UTF-8?q?fix=20[P-239]:=20=20=D1=84=D0=B8=D0=BA?=
=?UTF-8?q?=D1=81=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=D0=B0=20=D0=BA?=
=?UTF-8?q?=D0=B0=D1=80=D1=82=D0=B8=D0=BD=D0=BE=D0=BA=20=D0=B2=20=D0=BE?=
=?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D0=B0=D1=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/front/src/components/testing/QuestionBlock.vue | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/front/src/components/testing/QuestionBlock.vue b/src/front/src/components/testing/QuestionBlock.vue
index 5d6cd7343..afb2bf184 100644
--- a/src/front/src/components/testing/QuestionBlock.vue
+++ b/src/front/src/components/testing/QuestionBlock.vue
@@ -1,7 +1,7 @@
Вопрос {{ currentQuestion + 1 }} из {{ totalQuestions }}
@@ -27,7 +27,8 @@
v-if="option.file"
:src="`http://127.0.0.1:8000${option.file}`"
class="mb-4"
- max-height="140"
+ width="400"
+ min-width="300"
contain
/>
{{ option.name }}
@@ -52,7 +53,8 @@
v-if="option.file"
:src="`http://127.0.0.1:8000${option.file}`"
class="mb-4"
- max-height="140"
+ width="400"
+ min-width="300"
contain
/>
{{ option.name }}
@@ -178,5 +180,7 @@ export default {
:deep(.v-img) {
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ margin: 0 auto;
+ display: block;
}
From 194f2b1dc3c78a3e41211f29159551646c5ebf31 Mon Sep 17 00:00:00 2001
From: Denis Voinovich
Date: Mon, 2 Jun 2025 11:32:25 +0300
Subject: [PATCH 4/7] =?UTF-8?q?fix=20[P-239]:=20=D1=84=D0=B8=D0=BA=D1=81?=
=?UTF-8?q?=20=D0=B7=D0=B0=D1=82=D1=80=D0=B0=D1=87=D0=B5=D0=BD=D0=BD=D0=BE?=
=?UTF-8?q?=D0=B3=D0=BE=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/components/testing/DetailCardTest.vue | 15 ++++++++--
.../src/components/testing/TestResults.vue | 30 +++++++++++++++----
2 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/src/front/src/components/testing/DetailCardTest.vue b/src/front/src/components/testing/DetailCardTest.vue
index d2c62ab89..19e223465 100644
--- a/src/front/src/components/testing/DetailCardTest.vue
+++ b/src/front/src/components/testing/DetailCardTest.vue
@@ -33,7 +33,7 @@
:correctAnswers="correctAnswers"
:answeredQuestions="answeredQuestions"
:totalQuestions="data.question_count"
- :formattedTime="formattedTime"
+ :formattedTime="formatSpentTime"
:questions="data?.questions"
:userAnswers="answers"
@restart="startTest"
@@ -81,6 +81,13 @@ export default {
const data = ref(null);
const testingId = ref(null);
const testResults = ref(null);
+ const spentTime = ref(0);
+
+ const formatSpentTime = computed(() => {
+ const minutes = Math.floor(spentTime.value / 60);
+ const seconds = spentTime.value % 60;
+ return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
+ });
const getTestById = async (id) => {
const resp = await axiosApiInstance.get(`/api/tests/testdetail/${id}`);
@@ -131,7 +138,9 @@ export default {
answers.value = Array(data.value.questions.length).fill(null);
- data.value = { ...data.value, time: data.value.time * 60 };
+ const initialTime = data.value.time * 60;
+ data.value = { ...data.value, time: initialTime };
+ spentTime.value = 0;
if (timer) {
clearInterval(timer);
@@ -140,6 +149,7 @@ export default {
timer = setInterval(() => {
if (data.value?.time > 0) {
data.value = { ...data.value, time: data.value.time - 1 };
+ spentTime.value += 1;
} else {
finishTest();
}
@@ -253,6 +263,7 @@ export default {
testStarted,
testFinished,
formattedTime,
+ formatSpentTime,
startTest,
finishTest,
answers,
diff --git a/src/front/src/components/testing/TestResults.vue b/src/front/src/components/testing/TestResults.vue
index 292419d11..aa294422a 100644
--- a/src/front/src/components/testing/TestResults.vue
+++ b/src/front/src/components/testing/TestResults.vue
@@ -171,9 +171,18 @@ export default {
if (props.fromCompletedTab) {
return 'grey';
}
-
- const hasCorrectAnswers = props.questions[questionIndex].answers.some(a => a.right_wrong === true);
- return hasCorrectAnswers ? 'success' : 'grey';
+
+ const userAnswer = props.userAnswers?.[questionIndex];
+ if (!userAnswer) return 'grey';
+
+ const correctAnswers = props.questions[questionIndex].answers.filter(a => a.right_wrong === true);
+ const isCorrect = Array.isArray(userAnswer)
+ ? correctAnswers.length === userAnswer.length &&
+ correctAnswers.every(a => userAnswer.includes(a.name)) &&
+ userAnswer.every(ua => correctAnswers.some(ca => ca.name === ua))
+ : correctAnswers.some(a => a.name === userAnswer);
+
+ return isCorrect ? 'success' : 'error';
};
const getQuestionStatusIcon = (questionIndex) => {
@@ -182,9 +191,18 @@ export default {
if (props.fromCompletedTab) {
return '';
}
-
- const hasCorrectAnswers = props.questions[questionIndex].answers.some(a => a.right_wrong === true);
- return hasCorrectAnswers ? 'mdi-check-circle' : 'mdi-circle-outline';
+
+ const userAnswer = props.userAnswers?.[questionIndex];
+ if (!userAnswer) return 'mdi-circle-outline';
+
+ const correctAnswers = props.questions[questionIndex].answers.filter(a => a.right_wrong === true);
+ const isCorrect = Array.isArray(userAnswer)
+ ? correctAnswers.length === userAnswer.length &&
+ correctAnswers.every(a => userAnswer.includes(a.name)) &&
+ userAnswer.every(ua => correctAnswers.some(ca => ca.name === ua))
+ : correctAnswers.some(a => a.name === userAnswer);
+
+ return isCorrect ? 'mdi-check-circle' : 'mdi-close-circle';
};
const hasUserAnswer = (index) => {
From ce4504a7b12949aa5f4452e2edd86824e52c94fd Mon Sep 17 00:00:00 2001
From: Denis Voinovich
Date: Mon, 2 Jun 2025 11:48:12 +0300
Subject: [PATCH 5/7] =?UTF-8?q?fix=20[P-239]:=20=D1=84=D0=B8=D0=BA=D1=81?=
=?UTF-8?q?=20=D0=B8=D0=BD=D1=84=D1=8B=20=D0=BE=20=D1=82=D0=B5=D1=81=D1=82?=
=?UTF-8?q?=D0=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/testing/BodyDetailTesting.vue | 49 ++++++++++++++++---
1 file changed, 41 insertions(+), 8 deletions(-)
diff --git a/src/front/src/components/testing/BodyDetailTesting.vue b/src/front/src/components/testing/BodyDetailTesting.vue
index ee00baa5c..551929c05 100644
--- a/src/front/src/components/testing/BodyDetailTesting.vue
+++ b/src/front/src/components/testing/BodyDetailTesting.vue
@@ -5,15 +5,40 @@
Информация
-
- {{ data?.description }}
-
-
- Время на прохождение — {{ data?.time }} {{ timeWordDeclension }}
-
+
+
{{ data?.description }}
+
+
+
+
+ Время на прохождение: {{ data?.time }} {{ timeWordDeclension }}
+
+
+
+
+
+
+ Количество вопросов: {{ data?.question_count }}
+
+
+
+
+
+
+ Количество попыток: {{ data?.attemps_number }}
+
+
+
+
+
+
+ Проходной балл: {{ data?.pass_perc }}%
+
+
+
route.query.mode === 'exam');
-
+
const timeWordDeclension = computed(() => {
if (!props.data?.time) return 'минут';
@@ -66,3 +91,11 @@ export default {
}
};
+
+
From 0329bb942ae72681b98f0b5a929d910ff8f8bef9 Mon Sep 17 00:00:00 2001
From: Denis Voinovich
Date: Mon, 2 Jun 2025 11:55:21 +0300
Subject: [PATCH 6/7] =?UTF-8?q?fix=20[P-245]:=20=D0=B2=20=D1=81=D1=87?=
=?UTF-8?q?=D1=91=D1=82=D1=87=D0=B8=D0=BA=20=D0=BD=D0=B0=D0=B7=D0=BD=D0=B0?=
=?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=BD=D1=8B=D1=85=20=D1=82=D0=BE=D0=BB=D1=8C?=
=?UTF-8?q?=D0=BA=D0=BE=20=D0=B0=D0=BA=D1=82=D0=B8=D0=B2=D0=BD=D1=8B=D0=B5?=
=?UTF-8?q?=20=D1=82=D0=B5=D1=81=D1=82=D1=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/front/src/views/TestHomePage.vue | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/front/src/views/TestHomePage.vue b/src/front/src/views/TestHomePage.vue
index c7a9af2a0..cde788f00 100644
--- a/src/front/src/views/TestHomePage.vue
+++ b/src/front/src/views/TestHomePage.vue
@@ -247,7 +247,11 @@ export default {
})
.finally(() => {
if (activeTab.value === 0) {
- currentTest.value = getAllTests.value.filter(test => test.is_active).length;
+ currentTest.value = getAllTests.value.filter(test =>
+ test.is_active &&
+ test.is_passed !== true &&
+ test.attemps_number > 0
+ ).length;
}
});
};
From bc509dff91d0b496700dc8a42caa560d19771983 Mon Sep 17 00:00:00 2001
From: Denis Voinovich
Date: Mon, 2 Jun 2025 12:44:03 +0300
Subject: [PATCH 7/7] =?UTF-8?q?fix=20[P-246]:=20=D0=B0=D0=B1=D0=B7=D0=B0?=
=?UTF-8?q?=D1=86=D1=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/testing/BodyDetailTesting.vue | 10 ++++++++--
.../src/components/testing/CatalogTest.vue | 17 +++++++++++++----
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/src/front/src/components/testing/BodyDetailTesting.vue b/src/front/src/components/testing/BodyDetailTesting.vue
index 551929c05..46bab2575 100644
--- a/src/front/src/components/testing/BodyDetailTesting.vue
+++ b/src/front/src/components/testing/BodyDetailTesting.vue
@@ -9,7 +9,7 @@
{ 'border-b-thin': !isDialog, 'pa-0': isDialog }
]">
-
{{ data?.description }}
+
@@ -84,9 +84,15 @@ export default {
return 'минут';
});
+ const formatDescription = (text) => {
+ if (!text) return '';
+ return text.replace(/\r?\n/g, '
');
+ };
+
return {
isExamMode,
- timeWordDeclension
+ timeWordDeclension,
+ formatDescription
};
}
};
diff --git a/src/front/src/components/testing/CatalogTest.vue b/src/front/src/components/testing/CatalogTest.vue
index 4890db2ba..1e0e9b087 100644
--- a/src/front/src/components/testing/CatalogTest.vue
+++ b/src/front/src/components/testing/CatalogTest.vue
@@ -32,9 +32,7 @@
{{ cardValue.name }}
-
- {{ cardValue.description }}
-
+
@@ -152,7 +150,13 @@ export default {
return val;
};
- return { search, searchTest, momenter, activeTabIcon, baseURL };
+ const formatDescription = (text) => {
+ if (!text) return '';
+ // Заменяем \r\n и \n на
+ return text.replace(/\r?\n/g, '
');
+ };
+
+ return { search, searchTest, momenter, activeTabIcon, baseURL, formatDescription };
},
};
@@ -197,4 +201,9 @@ export default {
background: rgba(0, 0, 0, 0.02);
border-radius: 8px;
}
+
+.test-description {
+ white-space: pre-wrap;
+ word-wrap: break-word;
+}