|
|
@@ -0,0 +1,738 @@
|
|
|
1
|
+<script setup lang="ts">
|
|
|
2
|
+import { onMounted, ref } from 'vue'
|
|
|
3
|
+
|
|
|
4
|
+import { useRoute } from 'vue-router'
|
|
|
5
|
+
|
|
|
6
|
+import { examPaperDetail } from '@/api/exam'
|
|
|
7
|
+import { getAnswerResult } from '@/api/exam/answer'
|
|
|
8
|
+import { getParticipantById } from '@/api/exam/participant'
|
|
|
9
|
+
|
|
|
10
|
+const route = useRoute()
|
|
|
11
|
+const examId = Number(route.query.id || 0)
|
|
|
12
|
+const pid = Number(route.query.pid || 0)
|
|
|
13
|
+
|
|
|
14
|
+const participantInfo = ref<any>({})
|
|
|
15
|
+
|
|
|
16
|
+// 考试信息
|
|
|
17
|
+const examInfo = ref<any>({})
|
|
|
18
|
+// 答题信息
|
|
|
19
|
+const answerInfo = ref<any>([])
|
|
|
20
|
+
|
|
|
21
|
+// onMounted(() => {
|
|
|
22
|
+// getParticipantById(pid).then((res: any) => {
|
|
|
23
|
+// participantInfo.value = res || {}
|
|
|
24
|
+// })
|
|
|
25
|
+// })
|
|
|
26
|
+
|
|
|
27
|
+// 计算用时
|
|
|
28
|
+function calculateExamTime() {
|
|
|
29
|
+ if (!participantInfo.value.startTime || !participantInfo.value.submitTime) {
|
|
|
30
|
+ return '-'
|
|
|
31
|
+ }
|
|
|
32
|
+ const startTime = new Date(participantInfo.value.startTime).getTime()
|
|
|
33
|
+ const submitTime = new Date(participantInfo.value.submitTime).getTime()
|
|
|
34
|
+ const duration = (submitTime - startTime) / 60_000 // 转换为分钟
|
|
|
35
|
+ return `${duration.toFixed(2)} 分钟`
|
|
|
36
|
+}
|
|
|
37
|
+
|
|
|
38
|
+// 数据处理工具函数
|
|
|
39
|
+// 解析JSON字符串,处理异常
|
|
|
40
|
+function parseJson(str: string) {
|
|
|
41
|
+ if (!str)
|
|
|
42
|
+ return []
|
|
|
43
|
+ try {
|
|
|
44
|
+ return JSON.parse(str)
|
|
|
45
|
+ }
|
|
|
46
|
+ catch (error) {
|
|
|
47
|
+ console.error('解析JSON失败:', error)
|
|
|
48
|
+ return []
|
|
|
49
|
+ }
|
|
|
50
|
+}
|
|
|
51
|
+
|
|
|
52
|
+// 根据paperQuestionId获取答题信息
|
|
|
53
|
+function getAnswerByPaperQuestionId(paperQuestionId: number) {
|
|
|
54
|
+ return (
|
|
|
55
|
+ answerInfo.value.find(
|
|
|
56
|
+ (item: any) => item.paperQuestionId === paperQuestionId,
|
|
|
57
|
+ ) || {}
|
|
|
58
|
+ )
|
|
|
59
|
+}
|
|
|
60
|
+// 获取题目类型中文名称
|
|
|
61
|
+function getQuestionTypeName(type: string) {
|
|
|
62
|
+ const typeMap: any = {
|
|
|
63
|
+ single_choice: '单选题',
|
|
|
64
|
+ multiple_choice: '多选题',
|
|
|
65
|
+ judgment: '判断题',
|
|
|
66
|
+ fill_blank: '填空题',
|
|
|
67
|
+ essay: '简答题',
|
|
|
68
|
+ }
|
|
|
69
|
+ return typeMap[type] || type
|
|
|
70
|
+}
|
|
|
71
|
+
|
|
|
72
|
+// 按大题索引分组题目
|
|
|
73
|
+function getQuestionsByBigIndex() {
|
|
|
74
|
+ if (!examInfo.value?.paper?.questions)
|
|
|
75
|
+ return []
|
|
|
76
|
+
|
|
|
77
|
+ const grouped: any = {}
|
|
|
78
|
+ examInfo.value.paper.questions.forEach((question: any) => {
|
|
|
79
|
+ if (!grouped[question.bigQuestionIndex]) {
|
|
|
80
|
+ grouped[question.bigQuestionIndex] = []
|
|
|
81
|
+ }
|
|
|
82
|
+ grouped[question.bigQuestionIndex].push(question)
|
|
|
83
|
+ })
|
|
|
84
|
+
|
|
|
85
|
+ // 转换为数组并按索引排序
|
|
|
86
|
+ return Object.keys(grouped)
|
|
|
87
|
+ .sort((a, b) => Number(a) - Number(b))
|
|
|
88
|
+ .map(key => grouped[key])
|
|
|
89
|
+}
|
|
|
90
|
+
|
|
|
91
|
+async function init() {
|
|
|
92
|
+ // 并发请求接口获取数据
|
|
|
93
|
+ const [examInfoRes, participantRes, answerRes]: any = await Promise.all([
|
|
|
94
|
+ examPaperDetail(examId),
|
|
|
95
|
+ getParticipantById(pid),
|
|
|
96
|
+ getAnswerResult(examId),
|
|
|
97
|
+ ])
|
|
|
98
|
+ examInfo.value = examInfoRes.data || {}
|
|
|
99
|
+ if (examInfo.value?.paper?.bigQuestionNames) {
|
|
|
100
|
+ examInfo.value.paper.bigQuestionNames = JSON.parse(
|
|
|
101
|
+ examInfo.value.paper.bigQuestionNames,
|
|
|
102
|
+ )
|
|
|
103
|
+ }
|
|
|
104
|
+ participantInfo.value = participantRes.data || {}
|
|
|
105
|
+ answerInfo.value = answerRes.data || {}
|
|
|
106
|
+}
|
|
|
107
|
+
|
|
|
108
|
+onMounted(async () => {
|
|
|
109
|
+ await init()
|
|
|
110
|
+})
|
|
|
111
|
+
|
|
|
112
|
+// const list = ref([
|
|
|
113
|
+// {
|
|
|
114
|
+// type: 'single',
|
|
|
115
|
+// title: '第一题单选题(本题分值1分)',
|
|
|
116
|
+// score: 1,
|
|
|
117
|
+// list: [
|
|
|
118
|
+// {
|
|
|
119
|
+// title: '这是本题的题目,请选择',
|
|
|
120
|
+// answer: [
|
|
|
121
|
+// {
|
|
|
122
|
+// title: 'A.答案1',
|
|
|
123
|
+// isRight: true,
|
|
|
124
|
+// },
|
|
|
125
|
+// {
|
|
|
126
|
+// title: 'B.答案2',
|
|
|
127
|
+// isRight: false,
|
|
|
128
|
+// },
|
|
|
129
|
+// {
|
|
|
130
|
+// title: 'B.答案3',
|
|
|
131
|
+// isRight: '',
|
|
|
132
|
+// },
|
|
|
133
|
+// {
|
|
|
134
|
+// title: 'B.答案4',
|
|
|
135
|
+// isRight: '',
|
|
|
136
|
+// },
|
|
|
137
|
+// ],
|
|
|
138
|
+// AnswerExplanation:
|
|
|
139
|
+// '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
|
|
|
140
|
+// },
|
|
|
141
|
+// {
|
|
|
142
|
+// title: '这是本题的题目,请选择',
|
|
|
143
|
+// answer: [
|
|
|
144
|
+// {
|
|
|
145
|
+// title: 'A.答案1',
|
|
|
146
|
+// isRight: '',
|
|
|
147
|
+// },
|
|
|
148
|
+// {
|
|
|
149
|
+// title: 'B.答案2',
|
|
|
150
|
+// isRight: true,
|
|
|
151
|
+// },
|
|
|
152
|
+// {
|
|
|
153
|
+// title: 'B.答案3',
|
|
|
154
|
+// isRight: '',
|
|
|
155
|
+// },
|
|
|
156
|
+// {
|
|
|
157
|
+// title: 'B.答案4',
|
|
|
158
|
+// isRight: false,
|
|
|
159
|
+// },
|
|
|
160
|
+// ],
|
|
|
161
|
+// AnswerExplanation:
|
|
|
162
|
+// '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
|
|
|
163
|
+// },
|
|
|
164
|
+// ],
|
|
|
165
|
+// },
|
|
|
166
|
+// {
|
|
|
167
|
+// type: 'single',
|
|
|
168
|
+// title: '第二题多选题(本题分值1分)',
|
|
|
169
|
+// score: 1,
|
|
|
170
|
+// list: [
|
|
|
171
|
+// {
|
|
|
172
|
+// title: '这是本题的题目,请选择',
|
|
|
173
|
+// answer: [
|
|
|
174
|
+// {
|
|
|
175
|
+// title: 'A.答案1',
|
|
|
176
|
+// isRight: true,
|
|
|
177
|
+// },
|
|
|
178
|
+// {
|
|
|
179
|
+// title: 'B.答案2',
|
|
|
180
|
+// isRight: true,
|
|
|
181
|
+// },
|
|
|
182
|
+// {
|
|
|
183
|
+// title: 'B.答案3',
|
|
|
184
|
+// isRight: true,
|
|
|
185
|
+// },
|
|
|
186
|
+// {
|
|
|
187
|
+// title: 'B.答案4',
|
|
|
188
|
+// isRight: false,
|
|
|
189
|
+// },
|
|
|
190
|
+// ],
|
|
|
191
|
+// AnswerExplanation:
|
|
|
192
|
+// '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
|
|
|
193
|
+// },
|
|
|
194
|
+// {
|
|
|
195
|
+// title: '这是本题的题目,请选择',
|
|
|
196
|
+// answer: [
|
|
|
197
|
+// {
|
|
|
198
|
+// title: 'A.答案1',
|
|
|
199
|
+// isRight: false,
|
|
|
200
|
+// },
|
|
|
201
|
+// {
|
|
|
202
|
+// title: 'B.答案2',
|
|
|
203
|
+// isRight: true,
|
|
|
204
|
+// },
|
|
|
205
|
+// {
|
|
|
206
|
+// title: 'B.答案3',
|
|
|
207
|
+// isRight: false,
|
|
|
208
|
+// },
|
|
|
209
|
+// {
|
|
|
210
|
+// title: 'B.答案4',
|
|
|
211
|
+// isRight: true,
|
|
|
212
|
+// },
|
|
|
213
|
+// ],
|
|
|
214
|
+// AnswerExplanation:
|
|
|
215
|
+// '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
|
|
|
216
|
+// },
|
|
|
217
|
+// ],
|
|
|
218
|
+// },
|
|
|
219
|
+// {
|
|
|
220
|
+// type: 'single',
|
|
|
221
|
+// title: '第三题判断题(本题分值1分)',
|
|
|
222
|
+// score: 1,
|
|
|
223
|
+// list: [
|
|
|
224
|
+// {
|
|
|
225
|
+// title: '这是本题的题目,请选择',
|
|
|
226
|
+// answer: [
|
|
|
227
|
+// {
|
|
|
228
|
+// title: 'A.答案1',
|
|
|
229
|
+// isRight: true,
|
|
|
230
|
+// },
|
|
|
231
|
+// {
|
|
|
232
|
+// title: 'B.答案2',
|
|
|
233
|
+// isRight: false,
|
|
|
234
|
+// },
|
|
|
235
|
+// ],
|
|
|
236
|
+// AnswerExplanation:
|
|
|
237
|
+// '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
|
|
|
238
|
+// },
|
|
|
239
|
+// {
|
|
|
240
|
+// title: '这是本题的题目,请选择',
|
|
|
241
|
+// answer: [
|
|
|
242
|
+// {
|
|
|
243
|
+// title: 'A.答案1',
|
|
|
244
|
+// isRight: false,
|
|
|
245
|
+// },
|
|
|
246
|
+// {
|
|
|
247
|
+// title: 'B.答案2',
|
|
|
248
|
+// isRight: true,
|
|
|
249
|
+// },
|
|
|
250
|
+// ],
|
|
|
251
|
+// AnswerExplanation:
|
|
|
252
|
+// '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
|
|
|
253
|
+// },
|
|
|
254
|
+// ],
|
|
|
255
|
+// },
|
|
|
256
|
+// {
|
|
|
257
|
+// type: 'single',
|
|
|
258
|
+// title: '第四题填空题(本题分值1分)',
|
|
|
259
|
+// score: 1,
|
|
|
260
|
+// list: [
|
|
|
261
|
+// {
|
|
|
262
|
+// title: '1.这是本题的题目(),(),()',
|
|
|
263
|
+// answer: [
|
|
|
264
|
+// {
|
|
|
265
|
+// title: 'A.填空',
|
|
|
266
|
+// answertext: '考生输入的答案1',
|
|
|
267
|
+// isRight: true,
|
|
|
268
|
+// },
|
|
|
269
|
+// {
|
|
|
270
|
+// title: 'B.填空',
|
|
|
271
|
+// answertext: '考生输入的答案2',
|
|
|
272
|
+// isRight: true,
|
|
|
273
|
+// },
|
|
|
274
|
+// {
|
|
|
275
|
+// title: 'C.填空',
|
|
|
276
|
+// answertext: '考生输入的答案3',
|
|
|
277
|
+// isRight: false,
|
|
|
278
|
+// },
|
|
|
279
|
+// ],
|
|
|
280
|
+// AnswerExplanation:
|
|
|
281
|
+// '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
|
|
|
282
|
+// },
|
|
|
283
|
+// {
|
|
|
284
|
+// title: '2.这是本题的题目(),(),()',
|
|
|
285
|
+// answer: [
|
|
|
286
|
+// {
|
|
|
287
|
+// title: 'A.填空',
|
|
|
288
|
+// answertext: '考生输入的答案1',
|
|
|
289
|
+// isRight: true,
|
|
|
290
|
+// },
|
|
|
291
|
+// {
|
|
|
292
|
+// title: 'B.填空',
|
|
|
293
|
+// answertext: '考生输入的答案2',
|
|
|
294
|
+// isRight: false,
|
|
|
295
|
+// },
|
|
|
296
|
+// ],
|
|
|
297
|
+// AnswerExplanation:
|
|
|
298
|
+// '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
|
|
|
299
|
+// },
|
|
|
300
|
+// ],
|
|
|
301
|
+// },
|
|
|
302
|
+// {
|
|
|
303
|
+// type: 'single',
|
|
|
304
|
+// title: '第五题简答题(本题分值1分)',
|
|
|
305
|
+// score: 1,
|
|
|
306
|
+// list: [
|
|
|
307
|
+// {
|
|
|
308
|
+// title: '1.这是本题的题目。',
|
|
|
309
|
+// answer: [
|
|
|
310
|
+// {
|
|
|
311
|
+// title: '这是一个简答题',
|
|
|
312
|
+// answertext:
|
|
|
313
|
+// '考生输入的答案考生输入的答案考生输入的答案考生输入的答案考生输入的答案考生输入的答案',
|
|
|
314
|
+// Correctanswer: '正确答案正确答案正确答案正确答案正确答案正确答案',
|
|
|
315
|
+// isRight: true,
|
|
|
316
|
+// },
|
|
|
317
|
+// ],
|
|
|
318
|
+// AnswerExplanation:
|
|
|
319
|
+// '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
|
|
|
320
|
+// },
|
|
|
321
|
+// ],
|
|
|
322
|
+// },
|
|
|
323
|
+// ]) as any
|
|
|
324
|
+</script>
|
|
|
325
|
+
|
|
|
326
|
+<template>
|
|
|
327
|
+ <view class="knowledgebase_exam_explanation">
|
|
|
328
|
+ <view class="knowledgebase_exam_explanation_title">
|
|
|
329
|
+ {{ examInfo.examName || '' }}
|
|
|
330
|
+ </view>
|
|
|
331
|
+ <view class="knowledgebase_exam_explanation_content">
|
|
|
332
|
+ <view class="knowledgebase_exam_explanation_content_title">
|
|
|
333
|
+ 考试说明
|
|
|
334
|
+ </view>
|
|
|
335
|
+ <view class="knowledgebase_exam_explanation_content_text">
|
|
|
336
|
+ {{ examInfo.remark || '' }}
|
|
|
337
|
+ </view>
|
|
|
338
|
+ </view>
|
|
|
339
|
+ <view class="knowledgebase_exam_explanation_float">
|
|
|
340
|
+ <view class="knowledgebase_exam_explanation_float_title">
|
|
|
341
|
+ 考试总分
|
|
|
342
|
+ <span class="knowledgebase_exam_explanation_float_title_score">{{ examInfo.totalScore || 0 }}分</span>
|
|
|
343
|
+ </view>
|
|
|
344
|
+ <view class="knowledgebase_exam_explanation_float_title">
|
|
|
345
|
+ 及格分数
|
|
|
346
|
+ <span class="knowledgebase_exam_explanation_float_title_score">{{ examInfo.passScore }}分</span>
|
|
|
347
|
+ </view>
|
|
|
348
|
+ <view class="knowledgebase_exam_explanation_float_title">
|
|
|
349
|
+ 考试时长
|
|
|
350
|
+ <span class="knowledgebase_exam_explanation_float_title_score">{{ examInfo.examDuration }}分钟</span>
|
|
|
351
|
+ </view>
|
|
|
352
|
+ <view class="knowledgebase_exam_explanation_float_title">
|
|
|
353
|
+ 考生得分
|
|
|
354
|
+ <span
|
|
|
355
|
+ class="knowledgebase_exam_explanation_float_title_score"
|
|
|
356
|
+ style="color: #215acd"
|
|
|
357
|
+ >{{ participantInfo.score || 0 }}分</span>
|
|
|
358
|
+ </view>
|
|
|
359
|
+ <view class="knowledgebase_exam_explanation_float_title">
|
|
|
360
|
+ 考试结果
|
|
|
361
|
+ <span
|
|
|
362
|
+ v-if="participantInfo.score >= examInfo.passScore"
|
|
|
363
|
+ class="knowledgebase_exam_explanation_float_title_score"
|
|
|
364
|
+ style="color: #38b865"
|
|
|
365
|
+ >及格</span>
|
|
|
366
|
+ <span
|
|
|
367
|
+ v-else
|
|
|
368
|
+ class="knowledgebase_exam_explanation_float_title_score"
|
|
|
369
|
+ style="color: #eb5e12"
|
|
|
370
|
+ >不及格</span>
|
|
|
371
|
+ </view>
|
|
|
372
|
+ </view>
|
|
|
373
|
+ <view class="AnswerDetails">
|
|
|
374
|
+ <view class="AnswerDetails_title">
|
|
|
375
|
+ 答题详情
|
|
|
376
|
+ </view>
|
|
|
377
|
+ <view
|
|
|
378
|
+ v-for="(bigQuestion, bigIndex) in examInfo?.paper?.bigQuestionNames"
|
|
|
379
|
+ :key="bigIndex" class="AnswerDetails_content"
|
|
|
380
|
+ >
|
|
|
381
|
+ <view class="AnswerDetails_content_box">
|
|
|
382
|
+ <view class="AnswerDetails_content_title">
|
|
|
383
|
+ {{ bigQuestion.name }}(本题分值{{ bigQuestion.score }}分)
|
|
|
384
|
+ </view>
|
|
|
385
|
+ <view
|
|
|
386
|
+ v-for="(question, questionIndex) in getQuestionsByBigIndex()[
|
|
|
387
|
+ +bigIndex
|
|
|
388
|
+ ] || []"
|
|
|
389
|
+ :key="question.id"
|
|
|
390
|
+ class="AnswerDetails_content_item"
|
|
|
391
|
+ >
|
|
|
392
|
+ <view class="Thisquestiontitle">
|
|
|
393
|
+ <view class="AnswerDetails_content_item_title">
|
|
|
394
|
+ {{ +questionIndex + 1 }}.
|
|
|
395
|
+ <span v-html="question.info.questionContent" />({{
|
|
|
396
|
+ getQuestionTypeName(question.questionType)
|
|
|
397
|
+ }},{{ question.smallQuestionScore }}分)
|
|
|
398
|
+ </view>
|
|
|
399
|
+ <view
|
|
|
400
|
+ v-if="
|
|
|
401
|
+ ['single_choice', 'multiple_choice', 'judgment'].includes(
|
|
|
402
|
+ question.questionType,
|
|
|
403
|
+ )
|
|
|
404
|
+ " class="AnswerDetails_content_item_answer"
|
|
|
405
|
+ >
|
|
|
406
|
+ <text
|
|
|
407
|
+ v-for="(option, optionIndex) in parseJson(
|
|
|
408
|
+ question.info.options,
|
|
|
409
|
+ )"
|
|
|
410
|
+ :key="optionIndex"
|
|
|
411
|
+ :style="
|
|
|
412
|
+ getAnswerByPaperQuestionId(question.id).isCorrect === 1
|
|
|
413
|
+ ? 'color: #38B865'
|
|
|
414
|
+ : getAnswerByPaperQuestionId(question.id).isCorrect === 0
|
|
|
415
|
+ ? 'color: #EB5E12'
|
|
|
416
|
+ : ''
|
|
|
417
|
+ "
|
|
|
418
|
+ >
|
|
|
419
|
+ <text>
|
|
|
420
|
+ {{ String.fromCharCode(65 + +optionIndex) }}.
|
|
|
421
|
+ <span v-html="option" />
|
|
|
422
|
+ </text>
|
|
|
423
|
+ <wd-icon
|
|
|
424
|
+ v-if="
|
|
|
425
|
+ getAnswerByPaperQuestionId(question.id).isCorrect === 1
|
|
|
426
|
+ "
|
|
|
427
|
+ style="
|
|
|
428
|
+ color: #38b865;
|
|
|
429
|
+ text-align: center;
|
|
|
430
|
+ margin-left: 20rpx;
|
|
|
431
|
+ "
|
|
|
432
|
+ name="check-circle-filled"
|
|
|
433
|
+ size="16px"
|
|
|
434
|
+ />
|
|
|
435
|
+ <wd-icon
|
|
|
436
|
+ v-else
|
|
|
437
|
+ style="
|
|
|
438
|
+ color: #eb5e12;
|
|
|
439
|
+ text-align: center;
|
|
|
440
|
+ margin-left: 20rpx;
|
|
|
441
|
+ "
|
|
|
442
|
+ name="close-circle-filled"
|
|
|
443
|
+ size="16px"
|
|
|
444
|
+ />
|
|
|
445
|
+ </text>
|
|
|
446
|
+ </view>
|
|
|
447
|
+ <view
|
|
|
448
|
+ v-else-if="question.questionType === 'fill_blank'"
|
|
|
449
|
+ class="AnswerDetails_content_item_answer"
|
|
|
450
|
+ >
|
|
|
451
|
+ <text
|
|
|
452
|
+ v-for="(option, optionIndex) in parseJson(
|
|
|
453
|
+ getAnswerByPaperQuestionId(question.id).userAnswer
|
|
|
454
|
+ || '[]',
|
|
|
455
|
+ )"
|
|
|
456
|
+ :key="optionIndex"
|
|
|
457
|
+ :style="
|
|
|
458
|
+ getAnswerByPaperQuestionId(question.id).isCorrect === 1
|
|
|
459
|
+ ? 'color: #38B865'
|
|
|
460
|
+ : getAnswerByPaperQuestionId(question.id).isCorrect === 0
|
|
|
461
|
+ ? 'color: #EB5E12'
|
|
|
462
|
+ : ''
|
|
|
463
|
+ "
|
|
|
464
|
+ >
|
|
|
465
|
+ <text>
|
|
|
466
|
+ {{ option }}
|
|
|
467
|
+ </text>
|
|
|
468
|
+ <wd-icon
|
|
|
469
|
+ v-if="
|
|
|
470
|
+ getAnswerByPaperQuestionId(question.id).isCorrect === 1
|
|
|
471
|
+ "
|
|
|
472
|
+ style="
|
|
|
473
|
+ color: #38b865;
|
|
|
474
|
+ text-align: center;
|
|
|
475
|
+ margin-left: 20rpx;
|
|
|
476
|
+ "
|
|
|
477
|
+ name="check-circle-filled"
|
|
|
478
|
+ size="16px"
|
|
|
479
|
+ />
|
|
|
480
|
+ <wd-icon
|
|
|
481
|
+ v-else
|
|
|
482
|
+ style="
|
|
|
483
|
+ color: #eb5e12;
|
|
|
484
|
+ text-align: center;
|
|
|
485
|
+ margin-left: 20rpx;
|
|
|
486
|
+ "
|
|
|
487
|
+ name="close-circle-filled"
|
|
|
488
|
+ size="16px"
|
|
|
489
|
+ />
|
|
|
490
|
+ </text>
|
|
|
491
|
+ </view>
|
|
|
492
|
+ <view
|
|
|
493
|
+ v-else-if="question.questionType === 'essay'"
|
|
|
494
|
+ class="AnswerDetails_content_item_answer"
|
|
|
495
|
+ >
|
|
|
496
|
+ <text
|
|
|
497
|
+ :style="
|
|
|
498
|
+ getAnswerByPaperQuestionId(question.id).isCorrect === 1
|
|
|
499
|
+ ? 'color: #38B865'
|
|
|
500
|
+ : getAnswerByPaperQuestionId(question.id).isCorrect === 0
|
|
|
501
|
+ ? 'color: #EB5E12'
|
|
|
502
|
+ : ''
|
|
|
503
|
+ "
|
|
|
504
|
+ >
|
|
|
505
|
+ <text>
|
|
|
506
|
+ {{ getAnswerByPaperQuestionId(question.id).userAnswer
|
|
|
507
|
+ || '未作答' }}
|
|
|
508
|
+ </text>
|
|
|
509
|
+ <wd-icon
|
|
|
510
|
+ v-if="
|
|
|
511
|
+ getAnswerByPaperQuestionId(question.id).isCorrect === 1
|
|
|
512
|
+ "
|
|
|
513
|
+ style="
|
|
|
514
|
+ color: #38b865;
|
|
|
515
|
+ text-align: center;
|
|
|
516
|
+ margin-left: 20rpx;
|
|
|
517
|
+ "
|
|
|
518
|
+ name="check-circle-filled"
|
|
|
519
|
+ size="16px"
|
|
|
520
|
+ />
|
|
|
521
|
+ <wd-icon
|
|
|
522
|
+ v-else
|
|
|
523
|
+ style="
|
|
|
524
|
+ color: #eb5e12;
|
|
|
525
|
+ text-align: center;
|
|
|
526
|
+ margin-left: 20rpx;
|
|
|
527
|
+ "
|
|
|
528
|
+ name="close-circle-filled"
|
|
|
529
|
+ size="16px"
|
|
|
530
|
+ />
|
|
|
531
|
+ </text>
|
|
|
532
|
+ </view>
|
|
|
533
|
+ </view>
|
|
|
534
|
+ <!-- 答案解析 -->
|
|
|
535
|
+ <view class="AnswerExplanation_box">
|
|
|
536
|
+ <view class="Correctanswer" style="margin-bottom: 48rpx">
|
|
|
537
|
+ <text class="Correctanswer_title">正确答案 : </text>
|
|
|
538
|
+ <!-- <text
|
|
|
539
|
+ v-for="values in items?.answer.filter((a) => a.isRight)"
|
|
|
540
|
+ v-if="value.title.includes('简答题')"
|
|
|
541
|
+ :key="values.title"
|
|
|
542
|
+ class="Correctanswer_title Content"
|
|
|
543
|
+ >
|
|
|
544
|
+ {{ `${values.Correctanswer};` }}
|
|
|
545
|
+ </text> -->
|
|
|
546
|
+ <text
|
|
|
547
|
+ v-if="
|
|
|
548
|
+ ['single_choice', 'multiple_choice', 'judgment', 'fill_blank'].includes(
|
|
|
549
|
+ question.questionType,
|
|
|
550
|
+ )
|
|
|
551
|
+ "
|
|
|
552
|
+ class="Correctanswer_title Content"
|
|
|
553
|
+ >
|
|
|
554
|
+ <span
|
|
|
555
|
+ v-html="
|
|
|
556
|
+ parseJson(question.info.correctAnswer || '[]')
|
|
|
557
|
+ .map((idx: number) => String.fromCharCode(65 + idx))
|
|
|
558
|
+ .join('、')
|
|
|
559
|
+ "
|
|
|
560
|
+ />
|
|
|
561
|
+ </text>
|
|
|
562
|
+ <text
|
|
|
563
|
+ v-else
|
|
|
564
|
+ class="Correctanswer_title Content"
|
|
|
565
|
+ >
|
|
|
566
|
+ <span
|
|
|
567
|
+ v-html="question.info.correctAnswer || '无'"
|
|
|
568
|
+ />
|
|
|
569
|
+ </text>
|
|
|
570
|
+ </view>
|
|
|
571
|
+ <view class="AnswerExplanation">
|
|
|
572
|
+ <view class="Correctanswer_title" style="margin-bottom: 32rpx">
|
|
|
573
|
+ 答案解析:
|
|
|
574
|
+ </view>
|
|
|
575
|
+ <text class="Correctanswer_Content">
|
|
|
576
|
+ <span
|
|
|
577
|
+ v-html="question.info.answerAnalysis || '暂无解析'"
|
|
|
578
|
+ />
|
|
|
579
|
+ </text>
|
|
|
580
|
+ </view>
|
|
|
581
|
+ </view>
|
|
|
582
|
+ </view>
|
|
|
583
|
+ </view>
|
|
|
584
|
+ </view>
|
|
|
585
|
+ </view>
|
|
|
586
|
+ </view>
|
|
|
587
|
+</template>
|
|
|
588
|
+
|
|
|
589
|
+<style scoped lang="scss">
|
|
|
590
|
+html,
|
|
|
591
|
+body {
|
|
|
592
|
+ overflow: hidden;
|
|
|
593
|
+}
|
|
|
594
|
+.knowledgebase_exam_explanation {
|
|
|
595
|
+ height: calc(100vh - 88rpx);
|
|
|
596
|
+ display: flex;
|
|
|
597
|
+ flex-direction: column;
|
|
|
598
|
+ padding: 24rpx;
|
|
|
599
|
+ box-sizing: border-box;
|
|
|
600
|
+}
|
|
|
601
|
+.knowledgebase_exam_explanation_title {
|
|
|
602
|
+ font-family: Alibaba PuHuiTi 2;
|
|
|
603
|
+ font-weight: 500;
|
|
|
604
|
+ font-style: 65 Medium;
|
|
|
605
|
+ font-size: 48rpx;
|
|
|
606
|
+ leading-trim: NONE;
|
|
|
607
|
+ line-height: 48rpx;
|
|
|
608
|
+ letter-spacing: 0px;
|
|
|
609
|
+ color: #31373d;
|
|
|
610
|
+}
|
|
|
611
|
+.knowledgebase_exam_explanation_content {
|
|
|
612
|
+ margin-top: 80rpx;
|
|
|
613
|
+ width: 100%;
|
|
|
614
|
+ display: flex;
|
|
|
615
|
+ flex-direction: column;
|
|
|
616
|
+ gap: 32rpx;
|
|
|
617
|
+ .knowledgebase_exam_explanation_content_title {
|
|
|
618
|
+ font-weight: 500;
|
|
|
619
|
+ font-style: 65 Medium;
|
|
|
620
|
+ font-size: 36rpx;
|
|
|
621
|
+ leading-trim: NONE;
|
|
|
622
|
+ letter-spacing: 0px;
|
|
|
623
|
+ color: #31373d;
|
|
|
624
|
+ }
|
|
|
625
|
+ .knowledgebase_exam_explanation_content_text {
|
|
|
626
|
+ font-weight: 400;
|
|
|
627
|
+ font-style: 55 Regular;
|
|
|
628
|
+ font-size: 28rpx;
|
|
|
629
|
+ line-height: 48rpx;
|
|
|
630
|
+ letter-spacing: 0px;
|
|
|
631
|
+ color: #4e5969;
|
|
|
632
|
+ }
|
|
|
633
|
+}
|
|
|
634
|
+.knowledgebase_exam_explanation_float {
|
|
|
635
|
+ margin-top: 48rpx;
|
|
|
636
|
+ margin-bottom: 48rpx;
|
|
|
637
|
+ border-top: 1rpx solid #eeeeee;
|
|
|
638
|
+ border-bottom: 1rpx solid #eeeeee;
|
|
|
639
|
+ padding-top: 48rpx;
|
|
|
640
|
+ padding-bottom: 48rpx;
|
|
|
641
|
+ box-sizing: border-box;
|
|
|
642
|
+ display: flex;
|
|
|
643
|
+ flex-direction: column;
|
|
|
644
|
+ gap: 32rpx;
|
|
|
645
|
+ .knowledgebase_exam_explanation_float_title {
|
|
|
646
|
+ font-weight: 400;
|
|
|
647
|
+ font-style: 55 Regular;
|
|
|
648
|
+ font-size: 28rpx;
|
|
|
649
|
+ letter-spacing: 0px;
|
|
|
650
|
+ color: #4e5969;
|
|
|
651
|
+ .knowledgebase_exam_explanation_float_title_score {
|
|
|
652
|
+ margin-left: 48rpx;
|
|
|
653
|
+ color: #31373d;
|
|
|
654
|
+ }
|
|
|
655
|
+ }
|
|
|
656
|
+}
|
|
|
657
|
+.AnswerDetails {
|
|
|
658
|
+ flex: 1;
|
|
|
659
|
+ overflow-y: auto;
|
|
|
660
|
+ .AnswerDetails_title {
|
|
|
661
|
+ font-weight: 500;
|
|
|
662
|
+ font-style: 65 Medium;
|
|
|
663
|
+ font-size: 36rpx;
|
|
|
664
|
+ leading-trim: NONE;
|
|
|
665
|
+ letter-spacing: 0px;
|
|
|
666
|
+ color: #31373d;
|
|
|
667
|
+ margin-bottom: 48rpx;
|
|
|
668
|
+ }
|
|
|
669
|
+ .AnswerDetails_content {
|
|
|
670
|
+ // width: 100%;
|
|
|
671
|
+ // display: flex;
|
|
|
672
|
+ // flex-direction: column;
|
|
|
673
|
+ // gap: 24rpx;
|
|
|
674
|
+ margin-bottom: 24rpx;
|
|
|
675
|
+ .AnswerDetails_content_box {
|
|
|
676
|
+ display: flex;
|
|
|
677
|
+ flex-direction: column;
|
|
|
678
|
+ gap: 24rpx;
|
|
|
679
|
+ }
|
|
|
680
|
+ .AnswerDetails_content_title {
|
|
|
681
|
+ width: 100%;
|
|
|
682
|
+ height: 96rpx;
|
|
|
683
|
+ background-color: #f7f9fa;
|
|
|
684
|
+ padding-left: 32rpx;
|
|
|
685
|
+ box-sizing: border-box;
|
|
|
686
|
+ line-height: 88rpx;
|
|
|
687
|
+
|
|
|
688
|
+ font-weight: 500;
|
|
|
689
|
+ font-size: 32rpx;
|
|
|
690
|
+ color: #31373d;
|
|
|
691
|
+ }
|
|
|
692
|
+ .AnswerDetails_content_item {
|
|
|
693
|
+ box-sizing: border-box;
|
|
|
694
|
+ padding: 32rpx;
|
|
|
695
|
+ width: 100%;
|
|
|
696
|
+ background-color: #f7f9fa;
|
|
|
697
|
+ .Thisquestiontitle {
|
|
|
698
|
+ border-bottom: 1rpx solid #e6e8eb;
|
|
|
699
|
+ box-sizing: border-box;
|
|
|
700
|
+ padding-bottom: 48rpx;
|
|
|
701
|
+ margin-bottom: 48rpx;
|
|
|
702
|
+ .AnswerDetails_content_item_title {
|
|
|
703
|
+ margin-bottom: 48rpx;
|
|
|
704
|
+ font-weight: 400;
|
|
|
705
|
+ font-size: 32rpx;
|
|
|
706
|
+ color: #31373d;
|
|
|
707
|
+ }
|
|
|
708
|
+ .AnswerDetails_content_item_answer {
|
|
|
709
|
+ display: flex;
|
|
|
710
|
+ flex-direction: column;
|
|
|
711
|
+ gap: 52rpx;
|
|
|
712
|
+
|
|
|
713
|
+ font-weight: 400;
|
|
|
714
|
+ font-size: 28rpx;
|
|
|
715
|
+ color: #31373d;
|
|
|
716
|
+ }
|
|
|
717
|
+ }
|
|
|
718
|
+ .AnswerExplanation_box {
|
|
|
719
|
+ .Correctanswer_title {
|
|
|
720
|
+ font-weight: 400;
|
|
|
721
|
+ font-size: 28rpx;
|
|
|
722
|
+ color: #31373d;
|
|
|
723
|
+ }
|
|
|
724
|
+ .Content {
|
|
|
725
|
+ color: #38b865;
|
|
|
726
|
+ margin-right: 10rpx;
|
|
|
727
|
+ }
|
|
|
728
|
+ .Correctanswer_Content {
|
|
|
729
|
+ font-weight: 400;
|
|
|
730
|
+ font-size: 32rpx;
|
|
|
731
|
+ color: #4e5969;
|
|
|
732
|
+ line-height: 56rpx;
|
|
|
733
|
+ }
|
|
|
734
|
+ }
|
|
|
735
|
+ }
|
|
|
736
|
+ }
|
|
|
737
|
+}
|
|
|
738
|
+</style>
|