diff --git a/src/front/src/components/testing/BodyDetailTesting.vue b/src/front/src/components/testing/BodyDetailTesting.vue index aa54a694d..591dea355 100644 --- a/src/front/src/components/testing/BodyDetailTesting.vue +++ b/src/front/src/components/testing/BodyDetailTesting.vue @@ -13,7 +13,6 @@

-

Попытка 1 из {{ data?.attemps_number }}

{ const resp = await axiosApiInstance.get(`/api/tests/testdetail/${id}`); @@ -185,20 +186,17 @@ export default { const testMode = route.query.mode; const isFormalTesting = testMode === 'exam' || testMode === 'retry'; - console.log('Отправляем результаты теста:', answersToSubmit); - console.log('Режим тестирования:', isFormalTesting ? 'testing' : 'practice'); - const queryParams = new URLSearchParams(); if (isFormalTesting) { queryParams.append('status', 'testing'); } - await axiosApiInstance.post( + const response = await axiosApiInstance.post( `/api/tests/testresultview/?${queryParams.toString()}`, answersToSubmit, ); - console.log('Результаты теста успешно отправлены'); + testResults.value = response.data; } catch (error) { console.error('Ошибка при отправке результатов теста:', error); } @@ -238,7 +236,7 @@ export default { () => answers.value.filter((answer) => answer !== null).length, ); - const testPassed = computed(() => correctAnswers.value >= data?.value.questions.length / 2); + const testPassed = computed(() => testResults.value?.is_passed ?? false); const changeQuestion = (newIndex) => { if (newIndex >= 0 && newIndex < data?.value.questions.length) { diff --git a/src/front/src/components/testing/TestResults.vue b/src/front/src/components/testing/TestResults.vue index 5bafc51ba..f35d593fd 100644 --- a/src/front/src/components/testing/TestResults.vue +++ b/src/front/src/components/testing/TestResults.vue @@ -1,30 +1,46 @@