From c68af12398e424c9e196750228c1fa76f7849cb2 Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Tue, 27 May 2025 09:49:42 +0300 Subject: [PATCH] =?UTF-8?q?feat=20[P-227]:=20=D0=BA=D0=BE=D0=BD=D1=81?= =?UTF-8?q?=D1=82=D1=80=D1=83=D0=BA=D1=82=D0=BE=D1=80=20=D0=B0=D0=B4=D0=B0?= =?UTF-8?q?=D0=BF=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=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 --- .../testing/ConstructorTest/CreatedTest.vue | 14 + .../components/testing/TestConstructor.vue | 420 ++++++++++++++++++ .../vote/ConstructorVote/AnswerList.vue | 17 +- .../vote/ConstructorVote/CreatedVote.vue | 12 +- .../vote/ConstructorVote/MainInfo.vue | 9 +- .../vote/ConstructorVote/NewQuestion.vue | 6 + .../vote/ConstructorVote/QuestionItem.vue | 6 +- .../src/components/vote/VoteConstructor.vue | 140 +++++- src/front/src/utils/axios-api.js | 82 ++++ src/front/src/views/TestHomePage.vue | 40 +- 10 files changed, 720 insertions(+), 26 deletions(-) create mode 100644 src/front/src/components/testing/ConstructorTest/CreatedTest.vue create mode 100644 src/front/src/components/testing/TestConstructor.vue diff --git a/src/front/src/components/testing/ConstructorTest/CreatedTest.vue b/src/front/src/components/testing/ConstructorTest/CreatedTest.vue new file mode 100644 index 000000000..64629d756 --- /dev/null +++ b/src/front/src/components/testing/ConstructorTest/CreatedTest.vue @@ -0,0 +1,14 @@ + + + diff --git a/src/front/src/components/testing/TestConstructor.vue b/src/front/src/components/testing/TestConstructor.vue new file mode 100644 index 000000000..0fd1dcea7 --- /dev/null +++ b/src/front/src/components/testing/TestConstructor.vue @@ -0,0 +1,420 @@ + + + + + diff --git a/src/front/src/components/vote/ConstructorVote/AnswerList.vue b/src/front/src/components/vote/ConstructorVote/AnswerList.vue index 43225bda4..0897ed11e 100644 --- a/src/front/src/components/vote/ConstructorVote/AnswerList.vue +++ b/src/front/src/components/vote/ConstructorVote/AnswerList.vue @@ -6,15 +6,15 @@ :key="aIndex" class="d-flex align-start mb-4" > - + - mdi-check + mdi-check mdi-close @@ -76,22 +76,29 @@ export default { removeAnswer: { type: Function, required: true, + }, + isTest: { + type: Boolean, + default: false } }, - setup() { + setup(props) { const route = useRoute(); + // Поддерживаем оба способа определения: через роут или через явный проп const isTestRoute = computed(() => { return route.path && String(route.path).includes('test'); }); const toggleCorrect = (answer) => { - answer.correct = !answer.correct; + // Используем right_wrong для тестов (совместимо с бэкендом) + answer.right_wrong = !answer.right_wrong; }; return { isTestRoute, toggleCorrect, + isTest: props.isTest }; } }; diff --git a/src/front/src/components/vote/ConstructorVote/CreatedVote.vue b/src/front/src/components/vote/ConstructorVote/CreatedVote.vue index 5c7b7295b..0859d8aa4 100644 --- a/src/front/src/components/vote/ConstructorVote/CreatedVote.vue +++ b/src/front/src/components/vote/ConstructorVote/CreatedVote.vue @@ -3,11 +3,19 @@
mdi-check-circle -

Голосование создано!

+

{{ title || 'Голосование создано!' }}

- diff --git a/src/front/src/components/vote/ConstructorVote/MainInfo.vue b/src/front/src/components/vote/ConstructorVote/MainInfo.vue index 3a3f7bd4f..0f4e14401 100644 --- a/src/front/src/components/vote/ConstructorVote/MainInfo.vue +++ b/src/front/src/components/vote/ConstructorVote/MainInfo.vue @@ -1,6 +1,6 @@