Спринт 5: Трекер результатов

- Миграция 005: user_id в test_attempts (дефолт 1 = Гость)
- GET /api/attempts с фильтрами по тесту, дате и пагинацией
- Страница /tracker: таблица попыток, фильтры, пагинация
- Ссылка «Трекер» в шапке приложения

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Aleksey Razorvin
2026-03-21 15:26:40 +05:00
parent 9a0b3ba92c
commit fc684e7c7d
11 changed files with 522 additions and 22 deletions
+33
View File
@@ -56,6 +56,36 @@ export interface AttemptResult {
questions: QuestionResult[]
}
export interface AttemptListItem {
id: number
test_id: number
test_title: string
test_version: number
user_id: number
user_name: string
started_at: string
finished_at: string | null
score: number | null
correct_count: number | null
total_count: number | null
passed: boolean | null
}
export interface AttemptListResponse {
items: AttemptListItem[]
total: number
page: number
page_size: number
}
export interface AttemptListParams {
test_id?: number
date_from?: string
date_to?: string
page?: number
page_size?: number
}
export const attemptsApi = {
start: (test_id: number) =>
client.post<AttemptStarted>('/attempts', { test_id }),
@@ -65,4 +95,7 @@ export const attemptsApi = {
getResult: (attempt_id: number) =>
client.get<AttemptResult>(`/attempts/${attempt_id}/result`),
list: (params: AttemptListParams = {}) =>
client.get<AttemptListResponse>('/attempts', { params }),
}