feat(training): 完善安全培训题库与考试交互
修复 PDF 导入判断和填空题解析,支持文本题判分、回顾改答及安全培训三级流程校验。
This commit is contained in:
1 parent
ec4ed9b67d
commit
e62e4961d4
19 files changed
+721
-48
No files matched your search
@@ -38,7 +38,9 @@ type TrainingRecordApi = {
|
||||
answer_details?: Array<{
|
||||
question_id?: string;
|
||||
selected_option_id?: string;
|
||||
answer_text?: string;
|
||||
correct?: boolean;
|
||||
score_ratio?: number;
|
||||
}>;
|
||||
completion_time?: string | null;
|
||||
updated_at?: string | null;
|
||||
@@ -122,7 +124,9 @@ function mapAnswerDetails(items?: TrainingRecordApi['answer_details']): Training
|
||||
? items.map((item) => ({
|
||||
questionId: String(item.question_id || ''),
|
||||
selectedOptionId: String(item.selected_option_id || ''),
|
||||
answerText: String(item.answer_text || ''),
|
||||
correct: Boolean(item.correct),
|
||||
scoreRatio: Number(item.score_ratio || 0),
|
||||
}))
|
||||
: [];
|
||||
}
|
||||
@@ -249,7 +253,9 @@ export async function saveMyTrainingProgress(payload: SaveTrainingProgressPayloa
|
||||
answer_details: payload.answerDetails.map((item) => ({
|
||||
question_id: item.questionId,
|
||||
selected_option_id: item.selectedOptionId,
|
||||
answer_text: item.answerText || '',
|
||||
correct: item.correct,
|
||||
score_ratio: item.scoreRatio || 0,
|
||||
})),
|
||||
join_date: payload.joinDate || undefined,
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user