diff --git a/src/front/src/components/testing/CatalogTest.vue b/src/front/src/components/testing/CatalogTest.vue index 1ed17fb9c..73a385fcc 100644 --- a/src/front/src/components/testing/CatalogTest.vue +++ b/src/front/src/components/testing/CatalogTest.vue @@ -1,6 +1,7 @@ diff --git a/src/front/src/components/testing/DetailCardTest.vue b/src/front/src/components/testing/DetailCardTest.vue index 1d578e7a3..ebafeff62 100644 --- a/src/front/src/components/testing/DetailCardTest.vue +++ b/src/front/src/components/testing/DetailCardTest.vue @@ -227,11 +227,15 @@ export default { const answers = ref([]); - watch(data.value?.questions, (newData) => { - if (newData && Array.isArray(newData.questions)) { - answers.value = newData.questions.map(() => null); - } - }); + watch( + () => data.value?.questions, + (newQuestions) => { + if (newQuestions && Array.isArray(newQuestions)) { + answers.value = newQuestions.map(() => null); + } + }, + { deep: true } + ); const correctAnswers = computed( () => diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index adcfd1bc7..04620f8eb 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -588,9 +588,9 @@ export default { }; watch( - form.value, - () => { - if (!form.value.title || !form.value.description || form.value.questions.length < 1) { + () => form.value, + (formValue) => { + if (!formValue.title || !formValue.description || formValue.questions.length < 1) { errorMessage.value = 'Все обязательные поля должны быть заполнены'; } else { errorMessage.value = ''; @@ -602,7 +602,6 @@ export default { watch( () => form.value.questions, (newQuestions) => { - quests.value = newQuestions.map((q) => !!q.text.trim()); const hasEmptyQuestions = newQuestions.some((q) => !q.text || q.text.trim() === ''); const hasInvalidAnswers = validateAnswers(); @@ -686,11 +685,13 @@ export default { testImage, imagePreview, previewImage, + handleTestImageUpload, getImagePreviewUrl, actualQuestionCount, actualTestQuestionCount, isTest: props.isTest, - imageError + imageError, + validateImage }; }, };