feat(targeted): add targeted practice functionality

feat(analytics); add analytics page
This commit is contained in:
shafin-r
2026-02-05 15:07:24 +06:00
parent 2ac88835f9
commit 903653a212
20 changed files with 2018 additions and 35 deletions

View File

@ -7,6 +7,7 @@ import type {
SubmitAnswer,
} from "../types/session";
import type { PracticeSheet } from "../types/sheet";
import type { Topic } from "../types/topic";
const API_URL = "https://ed-dev-api.omukk.dev";
@ -130,6 +131,29 @@ class ApiClient {
);
}
// async startPracticeSession(
// token: string,
// sessionData: PracticeSessionRequest,
// ): Promise<SessionResponse> {
// return this.authenticatedRequest<SessionResponse>(`/sessions/`, token, {
// method: "POST",
// body: JSON.stringify(sessionData),
// });
// }
// async startTargetedPracticeSession(
// token: string,
// sessionData: TargetedSessionRequest,
// ): Promise<TargetedSessionResponse> {
// return this.authenticatedRequest<TargetedSessionResponse>(
// `/sessions/`,
// token,
// {
// method: "POST",
// body: JSON.stringify(sessionData),
// },
// );
// }
async startSession(
token: string,
sessionData: SessionRequest,
@ -191,5 +215,12 @@ class ApiClient {
async fetchLessonById(token: string, lessonId: string): Promise<Lesson> {
return this.authenticatedRequest<Lesson>(`/lessons/${lessonId}`, token);
}
async fetchAllTopics(token: string): Promise<Topic[]> {
return this.authenticatedRequest<Topic[]>(`/topics/`, token);
}
async fetchTopicById(token: string, topicId: string): Promise<Topic> {
return this.authenticatedRequest<Topic>(`/topics/${topicId}`, token);
}
}
export const api = new ApiClient(API_URL);