- Restructure: move backend from new_project/ to backend/ - Add full React/TypeScript frontend (37 pages, 17 services, 16 type defs, 11 query hooks) - Add docs/ with SRS specs, user stories, and workflow documentation - Update .gitignore for new directory layout Workflows implemented: WF1 User Signup, WF2 Placement Test, WF3 Exam Configuration, WF4 General English Exam, WF5 Course Generation, WF6 Entity Student Onboarding, AI Course Generation, Adaptive Learning Engine UI, White-Label Branding, Score Release Made-with: Cursor
45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import { api } from "@/lib/api-client";
|
|
import type {
|
|
IELTSExamConfig,
|
|
IELTSExamResponse,
|
|
IELTSSkillConfig,
|
|
ContentPoolItem,
|
|
ContentPoolFilters,
|
|
AssemblyResult,
|
|
ExamValidationReport,
|
|
ExamAssignRequest,
|
|
} from "@/types";
|
|
import type { ApiSuccessResponse } from "@/types";
|
|
|
|
export const ieltsExamService = {
|
|
create: (data: IELTSExamConfig) =>
|
|
api.post<IELTSExamResponse>("/exam/ielts/create", data),
|
|
|
|
getSkills: (examId: number) =>
|
|
api.get<IELTSSkillConfig[]>(`/exam/ielts/${examId}/skills`),
|
|
|
|
getContentPoolCount: (examId: number) =>
|
|
api.get<Record<string, number>>(`/exam/ielts/${examId}/content-pool-count`),
|
|
|
|
getContentPool: (examId: number, filters: ContentPoolFilters) =>
|
|
api.get<ContentPoolItem[]>(`/exam/ielts/${examId}/content-pool`, filters as Record<string, string | number | boolean | undefined>),
|
|
|
|
autoAssemble: (examId: number) =>
|
|
api.post<AssemblyResult[]>(`/exam/ielts/${examId}/auto-assemble`),
|
|
|
|
suggest: (examId: number) =>
|
|
api.post<AssemblyResult[]>(`/exam/ielts/${examId}/suggest`),
|
|
|
|
saveQuestions: (examId: number, sectionId: number, questionIds: number[]) =>
|
|
api.put<ApiSuccessResponse>(`/exam/ielts/${examId}/sections/${sectionId}/questions`, { question_ids: questionIds }),
|
|
|
|
validate: (examId: number) =>
|
|
api.get<ExamValidationReport>(`/exam/ielts/${examId}/validate`),
|
|
|
|
update: (examId: number, data: { status: string }) =>
|
|
api.put<ApiSuccessResponse>(`/exam/ielts/${examId}`, data),
|
|
|
|
assign: (examId: number, data: ExamAssignRequest) =>
|
|
api.post<ApiSuccessResponse>(`/exam/ielts/${examId}/assign`, data),
|
|
};
|