fix: user changes

This commit is contained in:
sajjadtalkhabi
2026-05-28 13:34:30 +03:30
parent cb86920015
commit 7ed6ec9ae1
46 changed files with 328 additions and 1114 deletions
-27
View File
@@ -1,27 +0,0 @@
import { register } from '@/services/mock/registry'
import { endpoints } from '@/services/api/endpoints'
import { studentExams } from '@/services/mock/fixtures/student-exams'
register('GET', endpoints.showStudentExam, ({ params }) => {
const exam = studentExams.find((e) => String(e.id) === String(params.id))
if (exam) return { data: exam }
const fallback = studentExams[1]
return { data: { ...fallback, id: params.id } }
})
register('POST', endpoints.startStudentExamAttempt, ({ params }) => ({
data: { id: params.id, status: 'started', message: 'آزمون آغاز شد' },
}))
register('POST', endpoints.submitStudentExamAttempt, ({ params, data }) => {
const answers = data?.answers || {}
const total = Object.keys(answers).length
return {
data: {
id: params.id,
submitted: true,
score: total > 0 ? (12 + Math.random() * 6).toFixed(2) : 0,
message: 'پاسخ‌های شما با موفقیت ثبت شد.',
},
}
})