diff --git a/src/front/src/components/testing/TestResults.vue b/src/front/src/components/testing/TestResults.vue
index 151744e52..78c664df5 100644
--- a/src/front/src/components/testing/TestResults.vue
+++ b/src/front/src/components/testing/TestResults.vue
@@ -12,17 +12,7 @@
mdi-close-circle
-
Не расстраивайтесь!
-
Попробуйте еще раз
-
- Пройти заново
- mdi-reload
-
+
Не пройдено
@@ -32,8 +22,6 @@
class="pa-4 text-center result-card"
elevation="2"
:color="testPassed ? 'success-light' : 'error-light'"
- :class="{ 'cursor-pointer': isPracticeMode }"
- @click="showAnswersDialog = isPracticeMode"
>
mdi-checkbox-marked-circle
@@ -63,8 +51,8 @@
-
-
+
+
Правильные ответы
diff --git a/src/front/src/views/TestHomePage.vue b/src/front/src/views/TestHomePage.vue
index e21c14ef8..3c96f67ee 100644
--- a/src/front/src/views/TestHomePage.vue
+++ b/src/front/src/views/TestHomePage.vue
@@ -382,18 +382,19 @@ export default {
const showResults = async (id) => {
try {
- const response = await axiosApiInstance.get(`/api/tests/testdetail/${id}/`);
+ const [testDetailResponse, resultResponse] = await Promise.all([
+ axiosApiInstance.get(`/api/tests/testdetail/${id}/`),
+ axiosApiInstance.get(`/api/tests/testresultview/?id=${id}`)
+ ]);
testResults.value = {
- passed: true,
- total_questions: response.data.question_count,
- total_answers: response.data.question_count,
- correct_answers: Math.ceil((response.data.pass_perc / 100) * response.data.question_count),
- time_spent: `${response.data.time} мин`,
- questions: response.data.questions,
- user_answers: response.data.questions.map(q =>
- q.answers.find(a => a.right_wrong)?.name || []
- )
+ passed: resultResponse.data.is_passed,
+ total_questions: testDetailResponse.data.question_count,
+ total_answers: resultResponse.data.answered_questions_total,
+ correct_answers: resultResponse.data.score,
+ time_spent: `${testDetailResponse.data.time} мин`,
+ questions: [],
+ userAnswers: []
};
showResultsDialog.value = true;