Roadmap P0
- Ship /logo.svg fallback and rewire asset references (superseded later by
the project-manager PNG in a separate commit).
Roadmap P1
- Response envelope alignment ({items,total,page,size}) across services
and query hooks.
- Approval/ticket UX updates tied to the new backend rollback semantics.
Roadmap P2
- React.lazy + Vite manualChunks to split vendor-radix/charts/icons/forms
from the main bundle and cut initial JS.
- Fix the 181 tsc errors (PaginationParams class + per-service generics).
- Auto-refresh flow for JWT refresh tokens wired into api-client.ts.
Roadmap P3
- i18n: i18next + language detector, en/ar locales, RTL auto-switch,
LanguageToggle component in RoleLayout and AdminLmsLayout.
- GDPR: PrivacyCenter page for data export and right-to-erasure, backed
by gdpr.service.ts; logout via AuthContext after erasure.
- Human-in-the-loop exam review UI: admin ExamReviewQueue + ExamReviewDetail
pages, useExamReview hooks, exam-review.service.ts.
- AI quality loop: AIPromptEditor (versioning + render preview),
AIFeedbackButtons for students, AIFeedbackTriage admin page, dedicated
services, hooks, and types.
- Dark mode: ThemeProvider + ThemeToggle + chart color tokens.
- Accessibility: DialogDescription on every DialogContent; alert-dialog
and sheet updates.
- Retire dead pages: ExamPage marketing, Index, ProfilePage import.
- Playwright e2e scaffolding: playwright.config.ts + e2e/login.spec.ts
smoke tests, npm scripts test:e2e / test:e2e:install.
Made-with: Cursor
58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
import { api } from "@/lib/api-client";
|
|
import type { PaginatedResponse } from "@/types/common";
|
|
import type {
|
|
ExamReviewDetail,
|
|
ExamReviewListItem,
|
|
} from "@/types/exam-review";
|
|
|
|
export interface ExamReviewQueueParams {
|
|
page?: number;
|
|
size?: number;
|
|
search?: string;
|
|
status?: "draft" | "pending_review" | "published" | "archived";
|
|
subject_id?: number;
|
|
}
|
|
|
|
/**
|
|
* Admin-facing review queue. Everything here assumes the caller has an admin
|
|
* JWT — the server is authoritative; the frontend just surfaces errors.
|
|
*/
|
|
export const examReviewService = {
|
|
async queue(
|
|
params: ExamReviewQueueParams = {},
|
|
): Promise<PaginatedResponse<ExamReviewListItem>> {
|
|
const res = await api.get<PaginatedResponse<ExamReviewListItem>>(
|
|
"/exam/review/queue",
|
|
params,
|
|
);
|
|
const items = res.items ?? res.data ?? [];
|
|
return {
|
|
items,
|
|
total: res.total ?? items.length,
|
|
page: res.page ?? 1,
|
|
size: res.size ?? items.length,
|
|
pages: res.pages ?? 1,
|
|
};
|
|
},
|
|
|
|
async detail(examId: number): Promise<ExamReviewDetail> {
|
|
return api.get<ExamReviewDetail>(`/exam/review/${examId}`);
|
|
},
|
|
|
|
async approve(
|
|
examId: number,
|
|
notes?: string,
|
|
): Promise<ExamReviewListItem> {
|
|
return api.post<ExamReviewListItem>(
|
|
`/exam/review/${examId}/approve`,
|
|
notes ? { notes } : {},
|
|
);
|
|
},
|
|
|
|
async reject(examId: number, notes: string): Promise<ExamReviewListItem> {
|
|
return api.post<ExamReviewListItem>(`/exam/review/${examId}/reject`, {
|
|
notes,
|
|
});
|
|
},
|
|
};
|