feat: improve student practice experience

This commit is contained in:
Codex
2026-06-29 15:12:35 +08:00
parent 134f7830dd
commit b96897b2be
12 changed files with 443 additions and 63 deletions

View File

@@ -14,11 +14,13 @@ export interface QuestionItem {
content?: string;
type?: string;
typeLabel?: string;
mediaUrl?: string | null;
options?: QuestionOption[] | string[] | null;
answerText?: string | null;
correctOptionIndex?: number | null;
correctOptionIndices?: number[] | null;
explanation?: string | null;
subQuestions?: Record<string, unknown>[] | null;
hasVideoExplanation?: boolean;
wrongCount?: number;
lastWrongAt?: string | null;
@@ -41,6 +43,10 @@ export interface AnswerResult {
id: string;
questionId: string;
isCorrect: boolean | null;
selectedOptions?: string[];
answerText?: string | null;
answeredAt?: string;
selfJudged?: boolean;
}
export interface PracticeReport {
@@ -128,6 +134,7 @@ export async function submitAnswer(body: {
questionId: string;
selectedOptions?: string[];
answerText?: string;
selfJudgedCorrect?: boolean;
}) {
return apiRequest<{ item: AnswerResult }>('/api/learning/answers', {
method: 'POST',