From 8860201d5e02e495d7eebb9db80b4c96f6e8284b Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Wed, 4 Jun 2025 16:35:01 +0300 Subject: [PATCH 01/23] =?UTF-8?q?fix=20[P-256]:=20=D1=84=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=20=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=BE=D0=B9=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/src/components/carousel-list.vue | 6 ++++++ src/front/src/components/digital-letna.vue | 10 ++++++++++ src/front/src/views/HomePage.vue | 16 +++++++++++++--- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/front/src/components/carousel-list.vue b/src/front/src/components/carousel-list.vue index f6b966916..958495371 100644 --- a/src/front/src/components/carousel-list.vue +++ b/src/front/src/components/carousel-list.vue @@ -187,3 +187,9 @@ export default { cursor: default !important; } + diff --git a/src/front/src/components/digital-letna.vue b/src/front/src/components/digital-letna.vue index f550fdf4d..e3a6f6f15 100644 --- a/src/front/src/components/digital-letna.vue +++ b/src/front/src/components/digital-letna.vue @@ -234,4 +234,14 @@ export default { .fiction .v-input__control { display: none; } + + + \ No newline at end of file diff --git a/src/front/src/views/HomePage.vue b/src/front/src/views/HomePage.vue index 8c7ff94ac..530091b99 100644 --- a/src/front/src/views/HomePage.vue +++ b/src/front/src/views/HomePage.vue @@ -146,12 +146,22 @@ export default { } .bgCard { - /* #ffffff6b #ffffff8c*/ - background: #ffffff38; + background: #fff !important; } .bgText { - background: #ffffffb0; + background: #f5f5f5 !important; + color: #222 !important; line-height: 2.1rem !important; } + +.card-unified { + border-radius: 18px; + box-shadow: none; +} + +.text-unified { + color: #222 !important; + font-family: 'Montserrat', 'Arial', sans-serif; +} From 01b5be0e187236a88fdc4d5220061252a76c7a77 Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Wed, 4 Jun 2025 16:40:17 +0300 Subject: [PATCH 02/23] =?UTF-8?q?fix=20[P-256]:=20=D1=84=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=20=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/src/components/testing/BodyDetailTesting.vue | 4 ++-- src/front/src/components/testing/DetailCardTest.vue | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/front/src/components/testing/BodyDetailTesting.vue b/src/front/src/components/testing/BodyDetailTesting.vue index 74e3e7149..9020fc7fa 100644 --- a/src/front/src/components/testing/BodyDetailTesting.vue +++ b/src/front/src/components/testing/BodyDetailTesting.vue @@ -33,7 +33,7 @@ -
+
Количество попыток: {{ remainingAttempts !== undefined ? remainingAttempts : data?.attemps_number }} @@ -50,7 +50,7 @@ { await getTestById(testId); - // Проверяем, есть ли оставшиеся попытки - if (remainingAttempts.value !== undefined && remainingAttempts.value <= 0) { + // Проверяем попытки только для режима экзамена + const isExamMode = route.query.mode === 'exam'; + if (isExamMode && remainingAttempts.value !== undefined && remainingAttempts.value <= 0) { console.log('Нет оставшихся попыток для прохождения теста'); return; // Прерываем запуск теста если попыток не осталось } From 122bd670527aa7e323952adfc7a3b8bd92dfcead Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Wed, 4 Jun 2025 17:01:27 +0300 Subject: [PATCH 03/23] =?UTF-8?q?fix=20[P-256]:=20=D0=B3=D0=BB=D0=B0=D0=B2?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/src/components/UI/NewsCard.vue | 7 +++++-- src/front/src/components/UI/fiousercard/listUser.vue | 8 +++++--- src/front/src/components/UI/my-helper.vue | 2 +- src/front/src/components/carousel-list.vue | 2 +- src/front/src/components/digital-letna.vue | 4 ++-- src/front/src/components/news-full.vue | 6 +++++- src/front/src/components/news-home.vue | 2 +- src/front/src/views/HomePage.vue | 4 ++-- 8 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/front/src/components/UI/NewsCard.vue b/src/front/src/components/UI/NewsCard.vue index c956a7d6c..c16d25ce7 100644 --- a/src/front/src/components/UI/NewsCard.vue +++ b/src/front/src/components/UI/NewsCard.vue @@ -41,6 +41,7 @@ @@ -53,6 +54,7 @@ @@ -65,6 +67,7 @@ @@ -76,6 +79,7 @@ @@ -102,8 +106,7 @@ @@ -23,16 +24,17 @@ v-if="from_which == 'top-user'" class="h-100 text-left pa-0 pl-0" @click="open = true" + active-color="teal-darken-4" > diff --git a/src/front/src/components/UI/my-helper.vue b/src/front/src/components/UI/my-helper.vue index 85df72a3a..eb45ddb76 100644 --- a/src/front/src/components/UI/my-helper.vue +++ b/src/front/src/components/UI/my-helper.vue @@ -11,7 +11,7 @@ v-bind="attrs" v-on="on" size="large" - color="indigo" + color="teal-darken-4" icon="mdi-owl" @click="menu = !menu" > diff --git a/src/front/src/components/carousel-list.vue b/src/front/src/components/carousel-list.vue index 958495371..1df2878e7 100644 --- a/src/front/src/components/carousel-list.vue +++ b/src/front/src/components/carousel-list.vue @@ -9,7 +9,7 @@ hide-delimiters hide-delimiter-background :show-arrows="carous.length < 2 ? false : 'hover'" - color="white" + color="teal-darken-4" @update:modelValue="slidechanged" > + - - + + Выбраны все {{ question.answers.length }} сотрудников + + +
{{ findEmployeeById(person.text)?.fio }} @@ -158,7 +184,7 @@ import QuestionHeader from '@/components/vote/ConstructorVote/QuestionHeader.vue'; import QuestionSettings from '@/components/vote/ConstructorVote/QuestionSettings.vue'; import AnswerList from '@/components/vote/ConstructorVote/AnswerList.vue'; -import { computed, ref } from 'vue'; +import { computed, ref, watch } from 'vue'; import { useRoute } from 'vue-router'; export default { @@ -295,11 +321,55 @@ export default { }; const onEmployeeUpdate = (selected) => { + // Filter existing answers to keep only those that are still selected props.question.answers = props.question.answers.filter((e) => selected.includes(e.text) ); + + // Add new answers for newly selected employees that don't have answers yet + const existingAnswerIds = props.question.answers.map(a => a.text); + const newEmployeeIds = selected.filter(id => !existingAnswerIds.includes(id)); + + // Add new answers for the newly selected employees + newEmployeeIds.forEach(employeeId => { + props.question.answers.push({ text: employeeId, image: null }); + }); + + // Also update the saved state for potential future switching between radio options + props.question._savedSelectedEmployees = [...selected]; + props.question._savedAnswers = [...props.question.answers]; + emit('update:question', props.question); }; + + const removeSelectedEmployee = (employeeId) => { + // Находим индекс сотрудника в массиве selectedEmployees + const index = props.question.selectedEmployees.indexOf(employeeId); + if (index !== -1) { + // Удаляем сотрудника из списка выбранных + props.question.selectedEmployees.splice(index, 1); + // Находим соответствующий ответ и удаляем его + const answerIndex = props.question.answers.findIndex(a => a.text === employeeId); + if (answerIndex !== -1) { + props.question.answers.splice(answerIndex, 1); + } + + // Обновляем сохраненное состояние + if (props.question._savedSelectedEmployees) { + const savedIndex = props.question._savedSelectedEmployees.indexOf(employeeId); + if (savedIndex !== -1) { + props.question._savedSelectedEmployees.splice(savedIndex, 1); + } + + const savedAnswerIndex = props.question._savedAnswers?.findIndex(a => a.text === employeeId); + if (savedAnswerIndex !== -1) { + props.question._savedAnswers.splice(savedAnswerIndex, 1); + } + } + + emit('update:question', props.question); + } + }; const toggleSelectAll = (value) => { props.handleSelectAll(value, props.index); @@ -307,8 +377,21 @@ export default { }; const removeEmployeeAnswer = (pIndex) => { - props.question.selectedEmployees.splice(pIndex, 1); + const employeeId = props.question.answers[pIndex].text; + + props.question.selectedEmployees = props.question.selectedEmployees.filter(id => id !== employeeId); props.question.answers.splice(pIndex, 1); + + // Обновляем сохраненное состояние + if (props.question._savedSelectedEmployees) { + props.question._savedSelectedEmployees = props.question._savedSelectedEmployees.filter(id => id !== employeeId); + + const savedAnswerIndex = props.question._savedAnswers?.findIndex(a => a.text === employeeId); + if (savedAnswerIndex !== -1) { + props.question._savedAnswers.splice(savedAnswerIndex, 1); + } + } + emit('update:question', props.question); }; @@ -320,6 +403,27 @@ export default { const isTestRoute = computed(() => { return route.path && String(route.path).includes('test'); }); + + // Добавляем наблюдение за изменением выбора типа голосования + watch(() => props.question.settings.onlyDep, (newValue, oldValue) => { + // Если выбрано любое значение кроме null, автоматически выбрать всех сотрудников + if (newValue !== null) { + // Сохраняем выбранных сотрудников перед выбором "все" + if (oldValue === null) { + // Сохраняем текущий выбор сотрудников для возможного возврата к "произвольным сотрудникам" + props.question._savedSelectedEmployees = [...props.question.selectedEmployees]; + props.question._savedAnswers = [...props.question.answers]; + } + toggleSelectAll(true); + } + // Если переключаемся на "За произвольного сотрудника" (null) и у нас есть сохраненный выбор + else if (newValue === null && oldValue !== null && props.question._savedSelectedEmployees) { + // Восстанавливаем ранее сохраненный выбор сотрудников + props.question.selectedEmployees = [...props.question._savedSelectedEmployees]; + props.question.answers = [...props.question._savedAnswers]; + emit('update:question', props.question); + } + }); return { resetAnswers, @@ -328,6 +432,7 @@ export default { onEmployeeUpdate, toggleSelectAll, removeEmployeeAnswer, + removeSelectedEmployee, onEmployeesChange, isTestRoute, questionImagePreview, diff --git a/src/front/src/components/vote/CurrentVote.vue b/src/front/src/components/vote/CurrentVote.vue index ac912ae59..c93af7807 100644 --- a/src/front/src/components/vote/CurrentVote.vue +++ b/src/front/src/components/vote/CurrentVote.vue @@ -234,10 +234,10 @@ export default { activepick.value = val } - const groupedAnswers = (question) => { + const groupedAnswers = (question) => { const filtered = question.answers.filter(answer => answer.employee?.id !== accountStore.user.is_idEmployee); - if (question.settings.onlyDep === null) { + if (question.settings.onlyDep === null || question.settings.onlyDep === 'any') { return groupByDepartment(filtered); } else if (question.settings.onlyDep) { const byDepartment = filtered.filter( diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index 04620f8eb..a0dd4d783 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -263,12 +263,17 @@ Голосование по отделам: {{ onlyDepdict.find((e) => e.value === question.settings.onlyDep).name }}
-

Выбранные сотрудники:

-
    -
  • - {{ findEmployeeById(employeeId.text).fio }} -
  • -
+
+

Выбрано {{ question.answers.length }} сотрудников

+
+
+

Выбранные сотрудники:

+
    +
  • + {{ findEmployeeById(employeeId.text).fio }} +
  • +
+
@@ -627,12 +632,13 @@ export default { }; const onlyDepdict = [ - { name: 'За любого сотрудника', value: null }, + { name: 'За любого сотрудника', value: 'any' }, { - name: 'Кроме своего отдела', + name: 'Только за сотрудника из другого отдела', value: false, }, - { name: 'Только за свой отдел', value: true }, + { name: 'Только за сотрудника из своего отдела', value: true }, + { name: 'За произвольного сотрудника (есть возможность добавить картинку)', value: null }, ]; const quests = computed(() => form.value.questions.map((question) => question.text.length > 0)); diff --git a/src/front/src/components/vote/VoteResult.vue b/src/front/src/components/vote/VoteResult.vue index 744a5f365..906bdbbed 100644 --- a/src/front/src/components/vote/VoteResult.vue +++ b/src/front/src/components/vote/VoteResult.vue @@ -30,7 +30,7 @@ - + Date: Thu, 19 Jun 2025 10:00:47 +0300 Subject: [PATCH 11/23] =?UTF-8?q?fix=20[P-276]:=20=D0=B8=D0=B7=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=81=D0=BE=D1=82=D1=80=D1=83=D0=B4=D0=BD=D0=B8=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D1=80?= =?UTF-8?q?=D1=83=D0=BA=D1=82=D0=BE=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vote/ConstructorVote/QuestionItem.vue | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/front/src/components/vote/ConstructorVote/QuestionItem.vue b/src/front/src/components/vote/ConstructorVote/QuestionItem.vue index 4dd05e7c4..d911358ac 100644 --- a/src/front/src/components/vote/ConstructorVote/QuestionItem.vue +++ b/src/front/src/components/vote/ConstructorVote/QuestionItem.vue @@ -59,15 +59,6 @@ - - Все сотрудники будут автоматически добавлены в варианты ответов - - - Выбраны все {{ question.answers.length }} сотрудников -
Date: Thu, 19 Jun 2025 10:07:10 +0300 Subject: [PATCH 12/23] =?UTF-8?q?fix=20[P-272]:=20=D1=83=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D0=B5=20=D1=83?= =?UTF-8?q?=D0=B2=D0=B5=D0=B4=D0=BE=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__pycache__/0001_initial.cpython-310.pyc | Bin 2938 -> 2938 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 138 -> 138 bytes .../__pycache__/0001_initial.cpython-310.pyc | Bin 2011 -> 2011 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 130 -> 130 bytes .../__pycache__/0001_initial.cpython-310.pyc | Bin 3061 -> 3061 bytes ...0002_alter_calendar_author.cpython-310.pyc | Bin 781 -> 781 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 140 -> 140 bytes .../__pycache__/0001_initial.cpython-310.pyc | Bin 4797 -> 4797 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 133 -> 133 bytes .../__pycache__/0001_initial.cpython-310.pyc | Bin 2121 -> 2121 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 138 -> 138 bytes .../__pycache__/0001_initial.cpython-310.pyc | Bin 5118 -> 5118 bytes .../0002_news_vote.cpython-310.pyc | Bin 491 -> 491 bytes .../0003_news_vote.cpython-310.pyc | Bin 688 -> 688 bytes .../0004_remove_news_vote.cpython-310.pyc | Bin 491 -> 491 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 132 -> 132 bytes .../__pycache__/0001_initial.cpython-310.pyc | Bin 1888 -> 1888 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 128 -> 128 bytes .../__pycache__/0001_initial.cpython-310.pyc | Bin 3660 -> 3660 bytes ...est_dateend_test_datestart.cpython-310.pyc | Bin 457 -> 457 bytes .../0003_testing_is_active.cpython-310.pyc | Bin 632 -> 632 bytes .../0004_test_is_available.cpython-310.pyc | Bin 608 -> 608 bytes ...ing_datestart_testing_news.cpython-310.pyc | Bin 958 -> 958 bytes ...on_alter_testresult_answer.cpython-310.pyc | Bin 840 -> 840 bytes ...testing_alter_testing_user.cpython-310.pyc | Bin 942 -> 942 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 127 -> 127 bytes .../__pycache__/0001_initial.cpython-310.pyc | Bin 5403 -> 5403 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 130 -> 130 bytes .../__pycache__/0001_initial.cpython-310.pyc | Bin 575 -> 575 bytes .../__pycache__/0002_initial.cpython-310.pyc | Bin 2345 -> 2345 bytes .../0003_vote_news.cpython-310.pyc | Bin 730 -> 730 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 126 -> 126 bytes 32 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/back/about_inspection/migrations/__pycache__/0001_initial.cpython-310.pyc b/src/back/about_inspection/migrations/__pycache__/0001_initial.cpython-310.pyc index 5e1baa6e5ae180b4d9cce29c932590efcf3bd0a3..e911c828ed92a46db3fabc5aff032f163b158d0d 100644 GIT binary patch delta 20 acmew*_DhUApO=@50SK;b3*N|`&kX=T+Xd7B delta 20 acmew*_DhUApO=@50SGbzO*V4pa{~Z6-~{3T diff --git a/src/back/about_inspection/migrations/__pycache__/__init__.cpython-310.pyc b/src/back/about_inspection/migrations/__pycache__/__init__.cpython-310.pyc index 931a65e3ace53e717c8bfc52f8fda42c40f03b5d..728be776944f957bdf75bc3d514c055b3940b9ac 100644 GIT binary patch delta 19 ZcmeBT>|*53=jG*M0D^1Vf+up<0{|#31g`)9 delta 19 YcmeBT>|*53=jG*M0D_D_lZo8*03##=y#N3J diff --git a/src/back/accounts/migrations/__pycache__/0001_initial.cpython-310.pyc b/src/back/accounts/migrations/__pycache__/0001_initial.cpython-310.pyc index bba215063d0d75574a0d12fa20c28ff5c54c08c2..881179603bc7a3ef84a1c9ae89135c1157743997 100644 GIT binary patch delta 20 acmcc3f195>pO=@50SK;b3*N|mfgJ!m0|n&( delta 20 acmcc3f195>pO=@50SGbzO*V30UkyHwH%l delta 20 acmew={#BeipO=@50SGbzO*V4B;syXaJOxz% diff --git a/src/back/calendar_of_events/migrations/__pycache__/0002_alter_calendar_author.cpython-310.pyc b/src/back/calendar_of_events/migrations/__pycache__/0002_alter_calendar_author.cpython-310.pyc index d2484b4f2aff51b37f93b5e273989b887d00411e..de376c07d886f2de06e5e87c8f34526377129ac5 100644 GIT binary patch delta 20 acmeBW>t*B4=jG*M0D^1Vf;VzAF#`ZCiv(o= delta 20 ZcmeBW>t*B4=jG*M0D_D_la1U=%m62l19JcX diff --git a/src/back/calendar_of_events/migrations/__pycache__/__init__.cpython-310.pyc b/src/back/calendar_of_events/migrations/__pycache__/__init__.cpython-310.pyc index f658a53761aca99f37a6ff66564d8c33a3c1ad3b..6eb83438aafbc3e6a6abd3e635c0d95a0e40d28a 100644 GIT binary patch delta 19 ZcmeBS>|x~2=jG*M0D^1Vf+un}0sts?1hoJF delta 19 YcmeBS>|x~2=jG*M0D_D_lZo7o03&V#!vFvP diff --git a/src/back/commeteresp/migrations/__pycache__/0001_initial.cpython-310.pyc b/src/back/commeteresp/migrations/__pycache__/0001_initial.cpython-310.pyc index 92bd549fc862efdc9d52499b41205554429b6b37..366c69d219bf754d0da9dba68c40c590ee987a34 100644 GIT binary patch delta 20 acmdn1x>uDupO=@50SK;b3*N}RNeBQsb_K!! delta 20 acmdn1x>uDupO=@50SGbzO*V3G5&{4;dj!w` diff --git a/src/back/commeteresp/migrations/__pycache__/__init__.cpython-310.pyc b/src/back/commeteresp/migrations/__pycache__/__init__.cpython-310.pyc index 40c69348ba3bb8786763f103fb22da823e55a488..2891d9815e98141621d35813b65ef1a6f2b1d4bb 100644 GIT binary patch delta 19 ZcmZo=Y-Qxm=jG*M0D^1Vf+uoU0RSg-1fT!_ delta 19 YcmZo=Y-Qxm=jG*M0D_D_lZo6_03vGxt^fc4 diff --git a/src/back/general_vacation/migrations/__pycache__/0001_initial.cpython-310.pyc b/src/back/general_vacation/migrations/__pycache__/0001_initial.cpython-310.pyc index e9e47c43a553de3acb8d30e2ed6996a501d7399f..ae80862f87af8a717a135eeb3e4df9daa6272904 100644 GIT binary patch delta 20 acmX>pa8iIfpO=@50SK;b3*N|W#{mF1SOqcw delta 20 acmX>pa8iIfpO=@50SGbzO*V4daR2}^T?9Y? diff --git a/src/back/general_vacation/migrations/__pycache__/__init__.cpython-310.pyc b/src/back/general_vacation/migrations/__pycache__/__init__.cpython-310.pyc index a337c044419eea01021b02e4df10cbc4f522d244..74fe081050e59d35ecefc7deb90298a7ec26b4ef 100644 GIT binary patch delta 19 ZcmeBT>|*53=jG*M0D^1Vf+up<0{|#31g`)9 delta 19 YcmeBT>|*53=jG*M0D_D_lZo8*03##=y#N3J diff --git a/src/back/navigation/migrations/__pycache__/0001_initial.cpython-310.pyc b/src/back/navigation/migrations/__pycache__/0001_initial.cpython-310.pyc index f7a1baacbbe2a1b0d36b2457c6698f645571d31f..ad32a6e647c2a9120817728c3cc58280498b84ea 100644 GIT binary patch delta 20 acmeyT{!g7dpO=@50SK;b3*N~6Sr`CB=LU)Z delta 20 acmeyT{!g7dpO=@50SGbzO*V3W76t%5>;;$r diff --git a/src/back/navigation/migrations/__pycache__/0002_news_vote.cpython-310.pyc b/src/back/navigation/migrations/__pycache__/0002_news_vote.cpython-310.pyc index c62e1c61ca530b68b05cd94cedfea28cbffacb5a..b1472238e4009af268a61e47766624fc3ec601ab 100644 GIT binary patch delta 20 acmaFO{F<3NpO=@50SK;b3*N~6fDr&Z%?0-W delta 20 acmaFO{F<3NpO=@50SGbzO*V2rU<3d*(gg(o diff --git a/src/back/navigation/migrations/__pycache__/0003_news_vote.cpython-310.pyc b/src/back/navigation/migrations/__pycache__/0003_news_vote.cpython-310.pyc index 76087c2adfb3d6be669fd3aa8e8cc19fe9152483..3219123dea73e2a2709a1594cb665094b02f3c12 100644 GIT binary patch delta 91 zcmdnMx`CBDpO=@50SK;b3!cdRi}BWEHpWM6(m;VC>B;XHd(6Z@OcpR7m5>2)Z*kb< X=BJeAq}nk8dBto%LV$^bQH&V?%*YZL delta 91 zcmdnMx`CBDpO=@50SGbzO(t^xVvL&1#`uU$3Mfz{HTfN5kC`Zl$pYr164F5KEe@O9 X{FKt1R69l>ub2%;2rzLliZKHKUg{8^ diff --git a/src/back/navigation/migrations/__pycache__/0004_remove_news_vote.cpython-310.pyc b/src/back/navigation/migrations/__pycache__/0004_remove_news_vote.cpython-310.pyc index bda4c67470e1574057c77551e285e3624371b07a..4c13fb64ef1b7fc96c8e0414fcfea28f6e9299aa 100644 GIT binary patch delta 56 zcmaFO{F<3NpO=@50SK;b3!ccml`(4K!B#eYAis!zvJYda0E7wVg9w4i7a64hn*|K& delta 56 zcmaFO{F<3NpO=@50SGbzO(t@0WxO@4Le diff --git a/src/back/navigation/migrations/__pycache__/__init__.cpython-310.pyc b/src/back/navigation/migrations/__pycache__/__init__.cpython-310.pyc index b0d554faee10621e44ca5c9769770d08e2605d05..7f1631bc648ea0674867ddc70d7c5827601dd490 100644 GIT binary patch delta 19 ZcmZo+Y+>Zi=jG*M0D^1Vf+uoU0stpZ1f2i? delta 19 YcmZo+Y+>Zi=jG*M0D_D_lZo7w03t>Ms{jB1 diff --git a/src/back/safety/migrations/__pycache__/0001_initial.cpython-310.pyc b/src/back/safety/migrations/__pycache__/0001_initial.cpython-310.pyc index 4276e11bd3c50b92ead1753144bffc912d623ab6..87f31ff1a1581ab67b628c4892a2de9c54bd8b69 100644 GIT binary patch delta 20 acmaFB_kfQ(pO=@50SK;b3*N{b$_@ZKrv-8V delta 20 acmaFB_kfQ(pO=@50SGbzO*V3evI77$tOS4n diff --git a/src/back/safety/migrations/__pycache__/__init__.cpython-310.pyc b/src/back/safety/migrations/__pycache__/__init__.cpython-310.pyc index 0d5e37633c7864dbd1080f57f3a93f0c3b59d0d4..603d89ed9aa95026a40b418363eca57732e91028 100644 GIT binary patch delta 19 ZcmZo*Y+&Th=jG*M0D^1Vf+up90stnv1d#v$ delta 19 YcmZo*Y+&Th=jG*M0D_D_lZo7=03osip8x;= diff --git a/src/back/tests/migrations/__pycache__/0001_initial.cpython-310.pyc b/src/back/tests/migrations/__pycache__/0001_initial.cpython-310.pyc index 905624bc41b277cd538c8c472f827742e7ba9dcb..0a64f35423aedeed6547c95b4b45a836aa707e9d 100644 GIT binary patch delta 20 acmX>jb4G?cpO=@50SK;b3*N}>$OiyAh6Pyw delta 20 acmX>jb4G?cpO=@50SIP3Fx$xO$Oiy9Mg=JV diff --git a/src/back/tests/migrations/__pycache__/0002_test_dateend_test_datestart.cpython-310.pyc b/src/back/tests/migrations/__pycache__/0002_test_dateend_test_datestart.cpython-310.pyc index d6ea40029a6205c901f55a70de6c91056f3381ec..30ece33143c691d5f779e411a498931d6b375689 100644 GIT binary patch delta 20 acmX@fe3F?vpO=@50SK;b3*N}Rj}ZVjeFc#K delta 20 acmX@fe3F?vpO=@50SLT!%r|oHV*~&%Ap}1F diff --git a/src/back/tests/migrations/__pycache__/0003_testing_is_active.cpython-310.pyc b/src/back/tests/migrations/__pycache__/0003_testing_is_active.cpython-310.pyc index 47edc650d712f27f0196446699184141cc2696e8..74ef8d5c64a81f8a959ffcf184cd977615a08e1b 100644 GIT binary patch delta 56 zcmeyt@`HstpO=@50SK;b3!cb*g7MbGD}UHTf&3!T$=4Vw1RzW>A4G^vj$@Jn0M-)@ AVgLXD delta 56 zcmeyt@`HstpO=@50SIoYTTJ9W!5B61${#inAiqdt@-@Z^0SFV!2N9x^ diff --git a/src/back/tests/migrations/__pycache__/0004_test_is_available.cpython-310.pyc b/src/back/tests/migrations/__pycache__/0004_test_is_available.cpython-310.pyc index 97852214d6e58a865eef8a9fac2eee5f14e1bd5f..fbfc017788f41a6516536c49a4f6f712771378f3 100644 GIT binary patch delta 20 acmaFB@_>aqpO=@50SK;b3*N{b$^-y9It5t( delta 20 acmaFB@_>aqpO=@50SJy-T5jYHWdZ;;Qv|U9 diff --git a/src/back/tests/migrations/__pycache__/0005_testing_datestart_testing_news.cpython-310.pyc b/src/back/tests/migrations/__pycache__/0005_testing_datestart_testing_news.cpython-310.pyc index 49da51ae8bb9788fb992932481ae7ed770764382..bfca8d81f413f00d195a83fececc7fe24d63d8b5 100644 GIT binary patch delta 20 acmdnTzK@+dpO=@50SK;b3*N}RnHc~!R|R?i delta 20 acmdnTzK@+dpO=@50SFHG+HU0D%nSfB*#zYP diff --git a/src/back/tests/migrations/__pycache__/0006_testresult_question_alter_testresult_answer.cpython-310.pyc b/src/back/tests/migrations/__pycache__/0006_testresult_question_alter_testresult_answer.cpython-310.pyc index 44a4ecacf539a5868bb6b824c9e6827f71d201fa..f8683e388d55b104edc30b87b6e717b674b30669 100644 GIT binary patch delta 79 zcmX@Xc7lyNpO=@50SK;b3!cdRpYhgYZpNkDoIrshkZ=+AO2T-7h6GU)L-px3PO&Y|Mo*c}yicxg( TKPEW=hyYj=M956mVU_^^)l3kh diff --git a/src/back/tests/migrations/__pycache__/0007_alter_testattempt_testing_alter_testing_user.cpython-310.pyc b/src/back/tests/migrations/__pycache__/0007_alter_testattempt_testing_alter_testing_user.cpython-310.pyc index 700f2b8f2ba967aacf3718fb839490439ed548f2..36ce42c22bd4f286b8af9e0e739df00ef6e75c70 100644 GIT binary patch delta 20 acmZ3-zK)$cpO=@50SK;b3*N}Rm>B>w*9A%d delta 20 acmZ3-zK)$cpO=@50SMUM+i&Dv%nSf883dmI diff --git a/src/back/tests/migrations/__pycache__/__init__.cpython-310.pyc b/src/back/tests/migrations/__pycache__/__init__.cpython-310.pyc index 09936bb62d523ad61337fa035b21a57d50eff86b..0799869911416f7ef683a314da95f8118f7672b1 100644 GIT binary patch delta 17 Xcmb=g=g#NlrUT^w diff --git a/src/back/vote/migrations/__pycache__/0003_vote_news.cpython-310.pyc b/src/back/vote/migrations/__pycache__/0003_vote_news.cpython-310.pyc index 099f17f0ba4e5ee88c3627b3daf5349031344615..29aa10adabe49adbab108d3667cbf966cf18bd2a 100644 GIT binary patch delta 20 acmcb`dW)4ipO=@50SK;b3*N|mo(TXtZUxBz delta 20 acmcb`dW)4ipO=@50SGbzO*V3$X955;a|G7_ diff --git a/src/back/vote/migrations/__pycache__/__init__.cpython-310.pyc b/src/back/vote/migrations/__pycache__/__init__.cpython-310.pyc index 6d79e4dc46218794a747ffc700b71c81d6226c16..8e6d02942ac1f9f7967a4eb5e042bfe4d9eae5fc 100644 GIT binary patch delta 17 Xcmb=c Date: Thu, 19 Jun 2025 11:11:10 +0300 Subject: [PATCH 13/23] admin vote, tests --- src/back/tests/admin.py | 2 + src/back/vote/admin.py | 22 +++++++++-- ..._answer_file_alter_answer_name_and_more.py | 37 +++++++++++++++++++ src/back/vote/models.py | 8 ++-- 4 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 src/back/vote/migrations/0004_alter_answer_file_alter_answer_name_and_more.py diff --git a/src/back/tests/admin.py b/src/back/tests/admin.py index dc0563d7c..c2926eca7 100644 --- a/src/back/tests/admin.py +++ b/src/back/tests/admin.py @@ -5,11 +5,13 @@ import nested_admin class TestAnswerInline(nested_admin.NestedStackedInline): model = TestAnswer extra = 0 + fields = ('name', 'file', 'right_wrong') class TestQuestionInline(nested_admin.NestedStackedInline): model = TestQuestion extra = 0 inlines = [TestAnswerInline] + fields = ('name', 'file') class TestAdmin(nested_admin.NestedModelAdmin): inlines = [TestQuestionInline] diff --git a/src/back/vote/admin.py b/src/back/vote/admin.py index 19a39c4cc..6398499e8 100644 --- a/src/back/vote/admin.py +++ b/src/back/vote/admin.py @@ -1,6 +1,22 @@ from django.contrib import admin from .models import * +import nested_admin -admin.site.register(Vote) -admin.site.register(Question) -admin.site.register(Answer) \ No newline at end of file +# admin.site.register(Vote) +# admin.site.register(Question) +# admin.site.register(Answer) + +class AnswerInline(nested_admin.NestedTabularInline): + model = Answer + extra = 1 + fields = ('name', 'file') + +class QuestionInline(nested_admin.NestedStackedInline): + model = Question + inlines = [AnswerInline] + extra = 1 + fields = ('name', 'file') + +@admin.register(Vote) +class VoteAdmin(nested_admin.NestedModelAdmin): + inlines = [QuestionInline] \ No newline at end of file diff --git a/src/back/vote/migrations/0004_alter_answer_file_alter_answer_name_and_more.py b/src/back/vote/migrations/0004_alter_answer_file_alter_answer_name_and_more.py new file mode 100644 index 000000000..c5128c6b6 --- /dev/null +++ b/src/back/vote/migrations/0004_alter_answer_file_alter_answer_name_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.6 on 2025-06-19 08:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("vote", "0003_vote_news"), + ] + + operations = [ + migrations.AlterField( + model_name="answer", + name="file", + field=models.FileField( + blank=True, null=True, upload_to="vote/answer_files/", verbose_name="Картинка" + ), + ), + migrations.AlterField( + model_name="answer", + name="name", + field=models.CharField(max_length=255, verbose_name="Ответ"), + ), + migrations.AlterField( + model_name="question", + name="file", + field=models.ImageField( + blank=True, null=True, upload_to="vote/question_images/", verbose_name="Картинка" + ), + ), + migrations.AlterField( + model_name="question", + name="name", + field=models.CharField(max_length=255, verbose_name="Вопрос"), + ), + ] diff --git a/src/back/vote/models.py b/src/back/vote/models.py index 08ff0a896..946affab2 100644 --- a/src/back/vote/models.py +++ b/src/back/vote/models.py @@ -26,9 +26,9 @@ class Vote(models.Model): verbose_name_plural = "Голосования" class Question(models.Model): - name = models.CharField(max_length=255) + name = models.CharField(max_length=255, verbose_name="Вопрос") vote = models.ForeignKey(Vote, related_name='questions', on_delete=models.CASCADE) - file = models.ImageField(upload_to='vote/question_images/', null=True, blank=True) + file = models.ImageField(upload_to='vote/question_images/', null=True, blank=True,verbose_name='Картинка') numb = models.PositiveIntegerField() settings = models.JSONField(default=dict, verbose_name='Json настроек голосования') @@ -40,8 +40,8 @@ class Question(models.Model): verbose_name_plural = "Вопросы" class Answer(models.Model): - name = models.CharField(max_length=255) - file = models.FileField(upload_to='vote/answer_files/', null=True, blank=True) + name = models.CharField(max_length=255, verbose_name='Ответ') + file = models.FileField(upload_to='vote/answer_files/', null=True, blank=True,verbose_name='Картинка') question = models.ForeignKey(Question, related_name='answers', on_delete=models.CASCADE) def __str__(self): From 7eae7807b7e01e7fe5d79fb3ba97cc01d0dfb452 Mon Sep 17 00:00:00 2001 From: cja Date: Tue, 24 Jun 2025 12:14:43 +0300 Subject: [PATCH 14/23] models --- ..._pass_perc_alter_testanswer_right_wrong.py | 23 +++++++++++++++++++ src/back/tests/models.py | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/back/tests/migrations/0008_alter_test_pass_perc_alter_testanswer_right_wrong.py diff --git a/src/back/tests/migrations/0008_alter_test_pass_perc_alter_testanswer_right_wrong.py b/src/back/tests/migrations/0008_alter_test_pass_perc_alter_testanswer_right_wrong.py new file mode 100644 index 000000000..5f8b84404 --- /dev/null +++ b/src/back/tests/migrations/0008_alter_test_pass_perc_alter_testanswer_right_wrong.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.6 on 2025-06-24 08:23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("tests", "0007_alter_testattempt_testing_alter_testing_user"), + ] + + operations = [ + migrations.AlterField( + model_name="test", + name="pass_perc", + field=models.FloatField(verbose_name="Мин. % правильных ответов"), + ), + migrations.AlterField( + model_name="testanswer", + name="right_wrong", + field=models.BooleanField(verbose_name="Правильно"), + ), + ] diff --git a/src/back/tests/models.py b/src/back/tests/models.py index 4acfa3bfa..3b2769217 100644 --- a/src/back/tests/models.py +++ b/src/back/tests/models.py @@ -16,7 +16,7 @@ class Test(models.Model): description = models.TextField(verbose_name='Описание') author = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='Создатель тестирования') - pass_perc = models.FloatField(blank=False, verbose_name="Мин. кол-во правильных ответов") + pass_perc = models.FloatField(blank=False, verbose_name="Мин. % правильных ответов") time = models.FloatField(blank=False, verbose_name="Время прохождения теста") question_count = models.PositiveIntegerField(blank=False, verbose_name="Количество вопросов") attemps_number = models.PositiveIntegerField(blank=False, verbose_name="Количество попыток") @@ -60,7 +60,7 @@ class TestAnswer(models.Model): related_name='answers', on_delete=models.CASCADE, verbose_name="Вопрос") - right_wrong = models.BooleanField(blank=False, verbose_name="Правильно/Неправильно") + right_wrong = models.BooleanField(blank=False, verbose_name="Правильно") class Meta: verbose_name = "Ответ" From a462620999289c4d40bf47dbbc2ae3928f987717 Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Tue, 24 Jun 2025 14:28:26 +0300 Subject: [PATCH 15/23] =?UTF-8?q?fix=20[P-276]:=20=D0=B8=D0=B7=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easydockersave | 2 +- easyserver | 2 +- ...alter_answer_name_and_more.cpython-310.pyc | Bin 0 -> 879 bytes .../src/components/testing/DetailCardTest.vue | 31 +++- .../src/components/testing/QuestionBlock.vue | 33 ++-- .../src/components/testing/TestResults.vue | 151 ++++++++++++------ 6 files changed, 149 insertions(+), 70 deletions(-) create mode 100644 src/back/vote/migrations/__pycache__/0004_alter_answer_file_alter_answer_name_and_more.cpython-310.pyc diff --git a/easydockersave b/easydockersave index b72d231e8..0bf5ed16e 120000 --- a/easydockersave +++ b/easydockersave @@ -1 +1 @@ -/home/nukeap/projects/PORTAL_COD2/sys/scripts/easydockersave.sh \ No newline at end of file +/home/denzel/Документы/PORTAL_COD2/sys/scripts/easydockersave.sh \ No newline at end of file diff --git a/easyserver b/easyserver index dd68800b6..24a03aacc 120000 --- a/easyserver +++ b/easyserver @@ -1 +1 @@ -/home/nukeap/projects/PORTAL_COD2/sys/scripts/easyserver.sh \ No newline at end of file +/home/denzel/Документы/PORTAL_COD2/sys/scripts/easyserver.sh \ No newline at end of file diff --git a/src/back/vote/migrations/__pycache__/0004_alter_answer_file_alter_answer_name_and_more.cpython-310.pyc b/src/back/vote/migrations/__pycache__/0004_alter_answer_file_alter_answer_name_and_more.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5093ad94d79f02981a30be0ea9518d3c662a467 GIT binary patch literal 879 zcmZ`%J#Q015Z%4ov+vG!Fi22Ai{vJ@1O-Kef{=oOM4C`tvs!yL=X37Ex$`BE0);^9 zhLVDwE=Ai`fbx7$)h;uj!6m|bIHkl59ZX5Q?~yqVps)$$3hPd~SZn~adJ+E`wQ zk##)9O%yv)Q1C?p9ekiY^O(!iE%Uxu`dodiPC86E{aB>Cilt>7E3X{KnE*b?RC8bE z{j9+JB9R>%$EHVREWC`Ea&{saL%xD}&(2Yl`q8R4nEhS#es*j|EuQdLrr~6mH_@rw zy;2r>^oLgs!-dJCM1-28zE!=dPOC4oqv~|_e5=z?E;m&+3nPX9lGU`&) zf3Ui?niRGF;O;k*WeZ==gONzXY!&*Z>0CEzoEPlp+6{ClcWpktyHpd @@ -36,6 +37,7 @@ :formattedTime="formatSpentTime" :questions="data?.questions" :userAnswers="answers" + :remainingAttempts="remainingAttempts" @restart="startTest" /> @@ -157,7 +159,11 @@ export default { testStarted.value = true; testFinished.value = false; - answers.value = Array(data.value.questions.length).fill(null); + // Правильно инициализируем ответы в зависимости от типа вопроса + answers.value = data.value.questions.map((question) => { + const correctAnswersCount = question.answers.filter(answer => answer.right_wrong).length; + return correctAnswersCount > 1 ? [] : null; + }); const initialTime = data.value.time * 60; data.value = { ...data.value, time: initialTime }; @@ -169,7 +175,7 @@ export default { timer = setInterval(() => { if (data.value?.time > 0) { - data.value = { ...data.value, time: data.value.time - 1 }; + data.value.time = data.value.time - 1; // Обновляем только время, а не весь объект spentTime.value += 1; } else { finishTest(); @@ -231,7 +237,12 @@ export default { () => data.value?.questions, (newQuestions) => { if (newQuestions && Array.isArray(newQuestions)) { - answers.value = newQuestions.map(() => null); + if (!answers.value || answers.value.length === 0) { + answers.value = newQuestions.map((question) => { + const correctAnswersCount = question.answers.filter(answer => answer.right_wrong).length; + return correctAnswersCount > 1 ? [] : null; + }); + } } }, { deep: true } @@ -260,7 +271,11 @@ export default { ); const answeredQuestions = computed( - () => answers.value.filter((answer) => answer !== null).length, + () => answers.value.filter((answer) => { + if (answer === null || answer === undefined) return false; + if (Array.isArray(answer)) return answer.length > 0; + return true; + }).length, ); const testPassed = computed(() => testResults.value?.is_passed ?? false); @@ -271,6 +286,13 @@ export default { } }; + const onAnswerChanged = (questionIndex, value) => { + + const newAnswers = [...answers.value]; + newAnswers[questionIndex] = value; + answers.value = newAnswers; + }; + const openFinishDialog = () => { showFinishDialog.value = true; }; @@ -293,6 +315,7 @@ export default { answers, currentQuestion, changeQuestion, + onAnswerChanged, showFinishDialog, openFinishDialog, correctAnswers, diff --git a/src/front/src/components/testing/QuestionBlock.vue b/src/front/src/components/testing/QuestionBlock.vue index 339687127..d61fc1c38 100644 --- a/src/front/src/components/testing/QuestionBlock.vue +++ b/src/front/src/components/testing/QuestionBlock.vue @@ -17,7 +17,7 @@ @@ -97,7 +97,7 @@ @@ -168,10 +169,10 @@ export default { color: rgb(var(--v-theme-text_carous)); } -.v-radio-group :deep(.v-radio:hover), +/* .v-radio-group :deep(.v-radio:hover), .v-checkbox:hover { transform: translateX(4px); -} +} */ .v-btn { text-transform: none; diff --git a/src/front/src/components/testing/TestResults.vue b/src/front/src/components/testing/TestResults.vue index 08913c384..e2b77b213 100644 --- a/src/front/src/components/testing/TestResults.vue +++ b/src/front/src/components/testing/TestResults.vue @@ -17,23 +17,6 @@
- - - - mdi-checkbox-marked-circle - -

{{ correctAnswers }}/{{ totalQuestions }}

-
- {{ isPracticeMode ? 'Правильных ответов (нажмите чтобы увидеть детали)' : 'Правильных ответов' }} -
-
-
@@ -43,6 +26,24 @@ + + + + mdi-checkbox-marked-circle + +

{{ correctAnswers }}/{{ totalQuestions }}

+
+ {{ !fromCompletedTab ? 'Правильных ответов (нажмите чтобы увидеть детали)' : 'Правильных ответов' }} +
+
+
+ mdi-clock-outline @@ -52,11 +53,11 @@
- - + + - Правильные ответы + {{ isPracticeMode ? 'Правильные ответы' : 'Результаты по вопросам' }} @@ -78,33 +79,46 @@ -

{{ question.name }}

- -
- - {{ getAnswerIcon(index, answer) }} - - - {{ answer.name }} - - - Ваш ответ - -
-
+

{{ question.name }}

+ + +
-
- {{ isQuestionCorrect(index) ? 'Правильно ✓' : 'Неправильно ✗' }} +
+ + {{ getAnswerIcon(index, answer) }} + + + {{ answer.name }} + + + Ваш ответ + +
+
+ + +
+ +
+ + {{ isQuestionCorrect(index) ? 'mdi-check-circle' : 'mdi-close-circle' }} + + {{ isQuestionCorrect(index) ? 'Правильно' : 'Неправильно' }}
@@ -114,9 +128,10 @@ - -
+ +
mdi-refresh Попробовать ещё раз + + + {{ getRetryMessage }} +
@@ -157,6 +182,10 @@ export default { fromCompletedTab: { type: Boolean, default: false + }, + remainingAttempts: { + type: Number, + default: undefined } }, setup(props) { @@ -164,6 +193,29 @@ export default { const showAnswersDialog = ref(false); const isPracticeMode = computed(() => !route.query.mode || route.query.mode === 'practice'); + const isExamMode = computed(() => route.query.mode === 'exam'); + + const canRetry = computed(() => { + if (props.fromCompletedTab) return false; + if (isPracticeMode.value) return true; + if (isExamMode.value) { + // В режиме экзамена можно повторить только если есть попытки и тест не пройден + return props.remainingAttempts > 0 && !props.testPassed; + } + return true; + }); + + const getRetryMessage = computed(() => { + if (isExamMode.value && props.remainingAttempts !== undefined) { + if (props.testPassed) { + return 'Тест успешно пройден. Повторное прохождение недоступно.'; + } + if (props.remainingAttempts <= 0) { + return 'Нет оставшихся попыток для прохождения теста.'; + } + } + return null; + }); const getQuestionStatusColor = (questionIndex) => { if (!props.questions[questionIndex]?.answers) return 'grey'; @@ -301,6 +353,9 @@ export default { return { showAnswersDialog, isPracticeMode, + isExamMode, + canRetry, + getRetryMessage, isQuestionCorrect, hasUserAnswer, showUserAnswer, From 8aad07ae5577584ae728484e040b542026a90595 Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Tue, 24 Jun 2025 14:52:30 +0300 Subject: [PATCH 16/23] =?UTF-8?q?fix=20[P-276]:=20=D0=B8=D0=B7=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=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; From 45e3cce1ad79629e72506ee9a24b2f093437500a Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Tue, 24 Jun 2025 14:58:39 +0300 Subject: [PATCH 17/23] fix [P-276]: merge --- .env.base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.base b/.env.base index b4f5465aa..eb8f072e1 100644 --- a/.env.base +++ b/.env.base @@ -55,4 +55,4 @@ NGINX_EXTERNAL_PORT=80 NGINX_INTERNAL_PORT=80 RUN_WITH_DOCS=False -PRODUCTION=False +PRODUCTION=True From e562915a747ad1b57d76b6c887c8b2e33075a896 Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Tue, 24 Jun 2025 16:24:48 +0300 Subject: [PATCH 18/23] fix [P-276]: merge --- ...c_alter_testanswer_right_wrong.cpython-310.pyc | Bin 0 -> 766 bytes .../src/components/testing/QuestionBlock.vue | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 src/back/tests/migrations/__pycache__/0008_alter_test_pass_perc_alter_testanswer_right_wrong.cpython-310.pyc diff --git a/src/back/tests/migrations/__pycache__/0008_alter_test_pass_perc_alter_testanswer_right_wrong.cpython-310.pyc b/src/back/tests/migrations/__pycache__/0008_alter_test_pass_perc_alter_testanswer_right_wrong.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9cb7c3f3e1deb120e99e57ad9bf34c28fe4938ed GIT binary patch literal 766 zcmY*Xzi-qq6t0_H-uLUj>!#qtStJAVjdXSe~WNKlK z`fCVa7q;4mAW)1siV4RFjve7HJtH6n%OQ8UcZT`ktYe4V2iE7o6`PPa;30@_>EQ8| zDqO*HA?KwMv|zc29B{9M$w#mPN9