feat: education
Deploy banu-front / deploy (push) Failing after 6s

This commit is contained in:
sajjadtalkhabi
2026-06-11 21:09:12 +03:30
parent 020a47f735
commit 4011c2f83b
18 changed files with 558 additions and 35 deletions
@@ -11,7 +11,7 @@
</BoxedIconTitleBlock>
<SkeletonLoaderBlock v-if="isLoading && !exam" :rows="2" :cols-per-row="1" />
<StudentExamSummary v-else-if="exam" :exam="exam" @start="onStart" />
<StudentExamSummary v-else-if="exam" :exam="examSummary" @start="onStart" />
<SimpleTitleIconBlock title="تعداد تلاش ها برای این آزمون" class="se__list-title">
<template #header-icon>
@@ -32,14 +32,14 @@
</template>
<script setup>
import { computed } from 'vue'
import { computed, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import SvgIcon from '@/components/icons/SvgIcon.vue'
import { useStudentExamQuery } from '@/services/query/student-exams'
import BoxedIconTitleBlock from '@/components/blocks/BoxedIconTitleBlock.vue'
import SkeletonLoaderBlock from '@/components/blocks/SkeletonLoaderBlock.vue'
import SimpleTitleIconBlock from '@/components/blocks/SimpleTitleIconBlock.vue'
import StudentExamSummary from '@/features/student/exams/components/StudentExamSummary.vue'
import { useStudentExamQuery, useStudentExamResultsQuery } from '@/services/query/student-exams'
import StudentExamAttemptItem from '@/features/student/exams/components/StudentExamAttemptItem.vue'
const route = useRoute()
@@ -51,7 +51,40 @@ const { data: exam, isLoading } = useStudentExamQuery(examId, {
enabled: () => !!examId.value,
})
const attempts = computed(() => exam.value?.attempts ?? [])
const resultsFilters = ref({})
const resultsPagination = ref({ page: 1, perPage: 50 })
const { data: results } = useStudentExamResultsQuery(resultsFilters, resultsPagination)
// Attempts on this exam, newest first, shaped for StudentExamAttemptItem.
const attempts = computed(() =>
(results.value?.data ?? [])
.filter((a) => String(a.examId) === String(examId.value))
.map((a) => ({
id: a.id,
title: exam.value?.title || 'آزمون',
score: a.score,
date: a.submittedAt,
status: a.isPassed ? 'passed' : 'failed',
statusLabel: a.isPassed ? 'قبول شده' : 'مردود',
}))
)
const examSummary = computed(() => {
const passed = attempts.value.some((a) => a.status === 'passed')
const status = passed ? 'passed' : attempts.value.length > 0 ? 'failed' : 'not_started'
const statusLabel = passed
? 'قبول شده اید'
: attempts.value.length > 0
? 'قبول نشده اید'
: 'شروع نشده'
return {
...exam.value,
attempts: attempts.value,
attemptsCount: attempts.value.length,
status,
statusLabel,
}
})
const onStart = () => {
router.push({ name: 'student-take-exam', params: { id: examId.value } }).catch(() => {})