forked from wangziqi/gongxue-base
feat: support composite practice questions
This commit is contained in:
@@ -28,6 +28,39 @@ export interface QuestionItem {
|
||||
createdAt?: string;
|
||||
}
|
||||
|
||||
export interface SubAnswerInput {
|
||||
subQuestionId: string;
|
||||
selectedOptions?: string[];
|
||||
answerText?: string;
|
||||
selfJudgedCorrect?: boolean;
|
||||
}
|
||||
|
||||
export interface SubAnswerResult {
|
||||
subQuestionId: string;
|
||||
order?: number;
|
||||
type?: string;
|
||||
typeLabel?: string | null;
|
||||
content?: string | null;
|
||||
selectedOptions?: string[];
|
||||
answerText?: string | null;
|
||||
isCorrect?: boolean | null;
|
||||
selfJudged?: boolean;
|
||||
correctOptionIndex?: number | null;
|
||||
correctOptionIndices?: number[];
|
||||
correctAnswerText?: string | null;
|
||||
explanation?: string | null;
|
||||
answered?: boolean;
|
||||
score?: number;
|
||||
totalScore?: number;
|
||||
}
|
||||
|
||||
export interface AnswerPayload {
|
||||
mode?: string;
|
||||
subAnswers?: SubAnswerInput[];
|
||||
subResults?: SubAnswerResult[];
|
||||
summary?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface PracticeSession {
|
||||
id: string;
|
||||
mode: string;
|
||||
@@ -57,8 +90,11 @@ export interface AnswerResult {
|
||||
isCorrect: boolean | null;
|
||||
selectedOptions?: string[];
|
||||
answerText?: string | null;
|
||||
answerPayload?: AnswerPayload;
|
||||
answeredAt?: string;
|
||||
selfJudged?: boolean;
|
||||
subResults?: SubAnswerResult[];
|
||||
compositeSummary?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface PracticeReport {
|
||||
@@ -153,6 +189,7 @@ export async function submitAnswer(body: {
|
||||
selectedOptions?: string[];
|
||||
answerText?: string;
|
||||
selfJudgedCorrect?: boolean;
|
||||
subAnswers?: SubAnswerInput[];
|
||||
}) {
|
||||
return apiRequest<{ item: AnswerResult }>('/api/learning/answers', {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user