刘光辉
4 小时以前 cf11e63b659afcc9792ab3e395f1b45d844431a8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/**
 * 我的试卷 / 在线考试答卷状态(与后端 TmsExamStatus 一致)
 * - notStarted:未开考(待考壳已生成,尚未点开考)
 * - doing:答题中
 * - submitted:已交卷
 * (cancelled 一般不出现在「我的试卷」列表)
 */
export type MyPaperStatus = 'notStarted' | 'doing' | 'submitted';
 
/** 列表行:我的试卷 */
export interface MyPaperListItem {
  id: string;
  paperId: string;
  paperName: string;
  /** 答卷状态:notStarted / doing / submitted */
  status: MyPaperStatus;
  examStart?: string;
  examEnd?: string;
  /** 展示用考试时间文案 */
  examTimeText?: string;
  totalScore: number;
  passScore?: number;
  durationMin?: number;
  /** 已交卷时的得分 */
  gotScore?: number;
  /** 1合格 / 0不合格 / pass/fail / 空=未出结果 */
  passFlag?: string;
  examId?: string;
  /** 当前/最近一次考试序号,1=首考 */
  attemptNo?: number;
  /** 首考 / 补考(第1次)…(补考序号不含首考) */
  attemptLabel?: string;
  submittedCount?: number;
  retakeLimit?: number;
  remainingRetakes?: number;
  canRetake?: boolean;
}
 
export interface MyPaperPageQuery {
  currentPage?: number;
  pageSize?: number;
  keyword?: string;
  status?: MyPaperStatus | '';
  /** pass/fail(兼容 1/0)/ none未出结果 */
  passFlag?: string;
  /** first首考 / retake补考 */
  attemptType?: 'first' | 'retake' | '';
  /** 1可补考 / 0不可补考 */
  canRetake?: '0' | '1' | '';
  examTimeFrom?: string;
  examTimeTo?: string;
}
 
/** 开考后试卷内容 */
export interface OnlineExamPaper {
  examId: string;
  paperId: string;
  paperName: string;
  totalScore: number;
  passScore?: number;
  durationMin?: number;
  /** 开考时间,倒计时按此续算 */
  startTime?: string;
  /** 服务端剩余秒数 */
  remainSeconds?: number | null;
  /** 开考接口发现已超时并完成自动交卷 */
  autoSubmitted?: boolean;
  attemptNo?: number;
  attemptLabel?: string;
  questions: OnlineExamQuestionItem[];
}
 
export type OnlineQuestionType = 'single' | 'multi' | 'judge' | 'blank' | 'essay';
 
export interface OnlineExamQuestionItem {
  id: string;
  questionId?: string;
  questionNo?: string;
  questionType: OnlineQuestionType;
  stem: string;
  score: number;
  gotScore?: number | null;
  userAnswer?: string;
  options: { optionLabel: string; optionContent: string; isCorrect?: '0' | '1' }[];
  /** 交卷后回填 */
  right?: boolean | null;
  correctAnswer?: string;
  /** 试题解析(回顾) */
  analysis?: string;
  subjective?: boolean;
}
 
export interface OnlineExamSubmitResult {
  objectiveScore?: number;
  totalScore?: number;
  passFlag?: string;
  gradeStatus?: string;
  pendingGrade?: boolean;
  items?: {
    id: string;
    correctAnswer?: string;
    analysis?: string;
    gotScore?: number | null;
    right?: boolean | null;
    subjective?: boolean;
  }[];
}
 
export interface OnlineExamAttempt {
  examId: string;
  attemptNo?: number;
  attemptLabel?: string;
  status?: MyPaperStatus;
  gradeStatus?: string;
  startTime?: string;
  submitTime?: string;
  gotScore?: number | null;
  passFlag?: string;
}
 
export interface OnlineExamDetail {
  id: string;
  paperId: string;
  paperName: string;
  status: MyPaperStatus;
  examTimeText?: string;
  totalScore: number;
  passScore?: number;
  durationMin?: number;
  gotScore?: number;
  startTime?: string;
  submitTime?: string;
  passFlag?: string;
  gradeStatus?: string;
  examId?: string;
  attemptNo?: number;
  attemptLabel?: string;
  submittedCount?: number;
  retakeLimit?: number;
  remainingRetakes?: number;
  canRetake?: boolean;
  /** 历史答卷 */
  attempts?: OnlineExamAttempt[];
  /** 已交卷回顾 */
  questions?: OnlineExamQuestionItem[];
}