@zykjcommon/questions 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +3 -0
- package/.env +7 -0
- package/.env.buildTest +9 -0
- package/.env.development +9 -0
- package/.env.production +13 -0
- package/.env.test +12 -0
- package/@types/global.d.ts +33 -0
- package/@types/shims-vue.d.ts +6 -0
- package/@types/shims-vuex.d.ts +15 -0
- package/auto-imports.d.ts +6 -0
- package/babel.config.js +5 -0
- package/components.d.ts +23 -0
- package/design/App.vue +60 -0
- package/design/main.js +23 -0
- package/design/views/dialog/contentDialog.vue +18 -0
- package/design/views/dialog/contentDialog2.vue +18 -0
- package/design/views/dialog/contentDialog3.vue +19 -0
- package/design/views/exam/analysis.vue +208 -0
- package/design/views/exam/exam.vue +355 -0
- package/design/views/home/illustrate.vue +45 -0
- package/design/views/home/login.vue +43 -0
- package/design/vueMapper.js +8 -0
- package/design/vueMapperTree.js +2 -0
- package/dist/demo.html +1 -0
- package/dist/zykjcommon-questions.common.js +12817 -0
- package/dist/zykjcommon-questions.css +1 -0
- package/dist/zykjcommon-questions.umd.js +12836 -0
- package/dist/zykjcommon-questions.umd.min.js +18 -0
- package/index.js +10 -0
- package/package.json +61 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +19 -0
- package/public/static/js/jquery.html2json.js +169 -0
- package/public/static/js/jquery.json2html.js +137 -0
- package/public/static/js/jquery.min.js +2 -0
- package/public/static/js/json2html.js +447 -0
- package/readme +8 -0
- package/src/App.vue +37 -0
- package/src/assets/img/afei.jpg +0 -0
- package/src/assets/img/audio-ico.gif +0 -0
- package/src/assets/img/audio-ico.png +0 -0
- package/src/assets/img/bc-type-bg.png +0 -0
- package/src/assets/img/big-close.png +0 -0
- package/src/assets/img/big-next.png +0 -0
- package/src/assets/img/big-pre.png +0 -0
- package/src/assets/img/book-bg.png +0 -0
- package/src/assets/img/checkbox-cur.png +0 -0
- package/src/assets/img/checkbox.png +0 -0
- package/src/assets/img/cpp-bg.png +0 -0
- package/src/assets/img/deer-logo.png +0 -0
- package/src/assets/img/header-bg-2.png +0 -0
- package/src/assets/img/header-bg.png +0 -0
- package/src/assets/img/illustrate-bg.png +0 -0
- package/src/assets/img/loading.gif +0 -0
- package/src/assets/img/login-bg.png +0 -0
- package/src/assets/img/login-box-bg.png +0 -0
- package/src/assets/img/login-box-logo.png +0 -0
- package/src/assets/img/logo.png +0 -0
- package/src/assets/img/logoByText.png +0 -0
- package/src/assets/img/py-bg.png +0 -0
- package/src/assets/img/pygame-bg.png +0 -0
- package/src/assets/img/radio-cur.png +0 -0
- package/src/assets/img/radio.png +0 -0
- package/src/assets/img/return-top-hover.png +0 -0
- package/src/assets/img/return-top.png +0 -0
- package/src/assets/img/sb3-bg.png +0 -0
- package/src/assets/img/star-ico.png +0 -0
- package/src/assets/img/tab-mark.png +0 -0
- package/src/assets/img/video-play-btn.png +0 -0
- package/src/assets/js/arms.js +16 -0
- package/src/assets/js/bus.js +14 -0
- package/src/assets/js/fun.js +883 -0
- package/src/assets/js/helper.js +575 -0
- package/src/assets/js/http.js +219 -0
- package/src/assets/js/md5.js +260 -0
- package/src/assets/js/rem.js +33 -0
- package/src/assets/js/validation.js +216 -0
- package/src/assets/js/zykjcommon-questions.umd.min.js +18 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/scss/dialog/dialog.scss +144 -0
- package/src/assets/scss/exam/exam.scss +256 -0
- package/src/assets/scss/home/home.scss +222 -0
- package/src/assets/scss/index.scss +80 -0
- package/src/assets/scss/questions/index.scss +345 -0
- package/src/common/const.ts +15 -0
- package/src/components/common/ContentDialog.vue +172 -0
- package/src/components/common/IframeComponent.vue +101 -0
- package/src/components/common/Loading.vue +45 -0
- package/src/components/common/MediaLooker.vue +171 -0
- package/src/components/common/TextAreaEditor.vue +121 -0
- package/src/components/exam/QuestionCard.vue +494 -0
- package/src/components/exam/QuestionHeader.vue +87 -0
- package/src/components/exam/TimeCounter.vue +107 -0
- package/src/components/questions/QuestionReader.js +20 -0
- package/src/components/questions/Question_SingleChoice.vue +208 -0
- package/src/components/questions/buildEntry.js +12 -0
- package/src/components/questions/developmentEntry.js +11 -0
- package/src/components/questions/mixin.js +64 -0
- package/src/main.ts +176 -0
- package/src/router/exam.ts +50 -0
- package/src/router/index.ts +33 -0
- package/src/store/exam.ts +199 -0
- package/src/store/index.ts +22 -0
- package/src/types/common/index.ts +4 -0
- package/src/types/exam/exam.ts +10 -0
- package/src/views/exam/Analysis.vue +516 -0
- package/src/views/exam/Default.vue +28 -0
- package/src/views/exam/Exam.vue +594 -0
- package/src/views/exam/ReviewPaper.vue +178 -0
- package/src/views/exam/ReviewQuestion.vue +167 -0
- package/tasks/vueMapper.js +37 -0
- package/tasks/vueMapperTree.js +42 -0
- package/tsconfig.json +46 -0
- package/tslint.json +19 -0
- package/vue.config.js +107 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="exam">
|
|
3
|
+
<QuestionHeader :resData="responsiveObj.resData"></QuestionHeader>
|
|
4
|
+
<div class="content-outter">
|
|
5
|
+
<div class="content">
|
|
6
|
+
<div class="content-left">
|
|
7
|
+
<div class="return-top" v-returnTop></div>
|
|
8
|
+
<div class="intro">
|
|
9
|
+
<div class="intro-tit">测评说明:</div>
|
|
10
|
+
<div class="intro-txt">{{responsiveObj.resData.exam_description}}</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="question-main">
|
|
13
|
+
<ul class="tab-list" >
|
|
14
|
+
<li :class="{'current':item.checked}"
|
|
15
|
+
@click="clickTab(item)"
|
|
16
|
+
v-for="(item,index) in tabList">{{item.name}}<div class="count" v-if="responsiveObj.questionListMapper && responsiveObj.questionListMapper[item.type] && item.type!=1">({{responsiveObj.questionListMapper[item.type].length}})</div><span v-if="item.checked" class="line"></span></li>
|
|
17
|
+
</ul>
|
|
18
|
+
<ul class="question-list">
|
|
19
|
+
<li v-for="(item,index) in responsiveObj.questionList" :id="'question'+ index">
|
|
20
|
+
<component :is="item.questionComponent"
|
|
21
|
+
:mode="'analysis'"
|
|
22
|
+
:questionInfo="item"
|
|
23
|
+
:key="'question'+ index"
|
|
24
|
+
:ref="'question'+ index"/>
|
|
25
|
+
</li>
|
|
26
|
+
</ul>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="content-right">
|
|
30
|
+
<!-- {{responsiveObj.questionList}}-->
|
|
31
|
+
<QuestionCard v-model:questionList="responsiveObj.questionList"></QuestionCard>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<ContentDialog v-model:visible="warnVisible"
|
|
37
|
+
@confirm="quitQuestion"
|
|
38
|
+
:hide-cancel="true"
|
|
39
|
+
:confirmText="'确定'">
|
|
40
|
+
<template #content>
|
|
41
|
+
<div class="con-text-1" style="margin-top: 0.3rem">{{warnText}}</div>
|
|
42
|
+
</template>
|
|
43
|
+
</ContentDialog>
|
|
44
|
+
<Loading :loading="loading"></Loading>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script lang="ts">
|
|
48
|
+
import {defineComponent, ref, toRefs, reactive, watch, computed, onMounted,getCurrentInstance} from 'vue'
|
|
49
|
+
// import QuestionReader from '@src/components/questions/QuestionReader.js'
|
|
50
|
+
import QuestionCard from '@src/components/exam/QuestionCard.vue'
|
|
51
|
+
import TimeCounter from '@src/components/exam/TimeCounter.vue'
|
|
52
|
+
import QuestionHeader from '@src/components/exam/QuestionHeader.vue'
|
|
53
|
+
import {createNamespacedHelpers} from 'vuex-composition-helpers';
|
|
54
|
+
import {useRouter,useRoute} from 'vue-router'
|
|
55
|
+
import fun from "@/assets/js/fun";
|
|
56
|
+
import {questionMapper} from '@src/common/const.ts'
|
|
57
|
+
|
|
58
|
+
interface dataInterface{
|
|
59
|
+
autoSubmitTimer:any,
|
|
60
|
+
tabList:Array<{
|
|
61
|
+
name:string,
|
|
62
|
+
type:string
|
|
63
|
+
}>,
|
|
64
|
+
loading:boolean,
|
|
65
|
+
warnVisible:boolean,
|
|
66
|
+
warnText:string
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface responsiveData{
|
|
70
|
+
questionList:Array<any>,
|
|
71
|
+
resData:any,
|
|
72
|
+
questionListMapper:any
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
export default defineComponent({
|
|
77
|
+
components: {
|
|
78
|
+
// ...QuestionReader,
|
|
79
|
+
QuestionHeader,
|
|
80
|
+
QuestionCard,
|
|
81
|
+
TimeCounter
|
|
82
|
+
},
|
|
83
|
+
setup(props,context) {
|
|
84
|
+
const {useState, useActions,useMutations} = createNamespacedHelpers('exam'); // specific module name
|
|
85
|
+
const {getExamReviewActions} = useActions(['getExamReviewActions'])
|
|
86
|
+
let route = useRoute()
|
|
87
|
+
let router = useRouter()
|
|
88
|
+
let errQuestionList:Array<any> = []
|
|
89
|
+
let allQuestionList:Array<any> = []
|
|
90
|
+
//不需要响应式或者写死的数据放里面
|
|
91
|
+
let data:dataInterface = reactive({
|
|
92
|
+
autoSubmitTimer:null,
|
|
93
|
+
tabList:[{name:'全部',type:'1',checked:true},{name:'错题',type:'2',checked:false}],
|
|
94
|
+
loading:false,
|
|
95
|
+
warnVisible:false,
|
|
96
|
+
warnText:''
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
//需要响应式放里面
|
|
100
|
+
let responsiveObj:{value:responsiveData} = ref({
|
|
101
|
+
questionList:[],
|
|
102
|
+
resData:{},
|
|
103
|
+
questionListMapper:{}
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
onMounted(()=>{
|
|
108
|
+
getExamReview()
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
function clickTab(item:any){
|
|
112
|
+
if(item.checked){
|
|
113
|
+
return
|
|
114
|
+
}
|
|
115
|
+
data.tabList.forEach((tab:any)=>{
|
|
116
|
+
tab.checked = false
|
|
117
|
+
})
|
|
118
|
+
item.checked = true
|
|
119
|
+
let whichList = responsiveObj.value.questionListMapper[item.type]
|
|
120
|
+
responsiveObj.value.questionList = (fun.copyDeepObject(whichList) as Array<any>)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
function getExamReview(){
|
|
125
|
+
let res = {
|
|
126
|
+
"data": {
|
|
127
|
+
"question_list": [
|
|
128
|
+
{
|
|
129
|
+
"question_type_str": "单选题",
|
|
130
|
+
"data_mode": 1,
|
|
131
|
+
"correct_judge": "",
|
|
132
|
+
"is_auto_check": "",
|
|
133
|
+
"content": "[{\"<>\":\"p\",\"text\":\"He arrived here ________. The teacher felt ________.\"}]",
|
|
134
|
+
"correct_subjective_answer": "",
|
|
135
|
+
"auto_check": true,
|
|
136
|
+
"options_data": [
|
|
137
|
+
{
|
|
138
|
+
"file_url": "",
|
|
139
|
+
"content_type": 1,
|
|
140
|
+
"file_type": 0,
|
|
141
|
+
"name": "",
|
|
142
|
+
"id": 0,
|
|
143
|
+
"thumbnail_url": "",
|
|
144
|
+
"option_content": "late, angry"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"file_url": "",
|
|
148
|
+
"content_type": 1,
|
|
149
|
+
"file_type": 0,
|
|
150
|
+
"name": "",
|
|
151
|
+
"id": 0,
|
|
152
|
+
"thumbnail_url": "",
|
|
153
|
+
"option_content": "lately, angrily"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"file_url": "",
|
|
157
|
+
"content_type": 1,
|
|
158
|
+
"file_type": 0,
|
|
159
|
+
"name": "",
|
|
160
|
+
"id": 0,
|
|
161
|
+
"thumbnail_url": "",
|
|
162
|
+
"option_content": " late, angrily"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"file_url": "",
|
|
166
|
+
"content_type": 1,
|
|
167
|
+
"file_type": 0,
|
|
168
|
+
"name": "",
|
|
169
|
+
"id": 0,
|
|
170
|
+
"thumbnail_url": "",
|
|
171
|
+
"option_content": "lately, angry"
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"score": "1.00",
|
|
175
|
+
"sub_questions": [],
|
|
176
|
+
"style_type": "SELECT_R-T",
|
|
177
|
+
"template_file_full_url": "",
|
|
178
|
+
"question_name": "He arrived here ________. The teacher felt ________.",
|
|
179
|
+
"correct_rate": "",
|
|
180
|
+
"knowledge_name": "词汇",
|
|
181
|
+
"page_location_list": [],
|
|
182
|
+
"code_type": 0,
|
|
183
|
+
"difficulty_level": "1",
|
|
184
|
+
"question_index": "",
|
|
185
|
+
"correct_single_index": 2,
|
|
186
|
+
"question_type": "1",
|
|
187
|
+
"media_resources": [],
|
|
188
|
+
"analysis": "[{\"<>\":\"p\",\"text\":\"我是解析哈哈哈哈\"}]",
|
|
189
|
+
"question_id": "13091",
|
|
190
|
+
"difficulty_level_str": "简单",
|
|
191
|
+
"update_date": "",
|
|
192
|
+
"exam_options_data": [
|
|
193
|
+
{
|
|
194
|
+
"data": {
|
|
195
|
+
"file_url": "",
|
|
196
|
+
"content_type": 1,
|
|
197
|
+
"file_type": 0,
|
|
198
|
+
"name": "",
|
|
199
|
+
"id": 0,
|
|
200
|
+
"thumbnail_url": "",
|
|
201
|
+
"option_content": "late, angry"
|
|
202
|
+
},
|
|
203
|
+
"index": 1
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"data": {
|
|
207
|
+
"file_url": "",
|
|
208
|
+
"content_type": 1,
|
|
209
|
+
"file_type": 0,
|
|
210
|
+
"name": "",
|
|
211
|
+
"id": 0,
|
|
212
|
+
"thumbnail_url": "",
|
|
213
|
+
"option_content": "lately, angrily"
|
|
214
|
+
},
|
|
215
|
+
"index": 2
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"data": {
|
|
219
|
+
"file_url": "",
|
|
220
|
+
"content_type": 1,
|
|
221
|
+
"file_type": 0,
|
|
222
|
+
"name": "",
|
|
223
|
+
"id": 0,
|
|
224
|
+
"thumbnail_url": "",
|
|
225
|
+
"option_content": " late, angrily"
|
|
226
|
+
},
|
|
227
|
+
"index": 3
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"data": {
|
|
231
|
+
"file_url": "",
|
|
232
|
+
"content_type": 1,
|
|
233
|
+
"file_type": 0,
|
|
234
|
+
"name": "",
|
|
235
|
+
"id": 0,
|
|
236
|
+
"thumbnail_url": "",
|
|
237
|
+
"option_content": "lately, angry"
|
|
238
|
+
},
|
|
239
|
+
"index": 4
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"exam_link_answer_data": [],
|
|
243
|
+
"reference_file_full_url": "",
|
|
244
|
+
"correct_multiple_index_set": [],
|
|
245
|
+
"hint": "Multiple choice.1",
|
|
246
|
+
"knowledge_id": "2"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"question_type_str": "单选题",
|
|
250
|
+
"data_mode": 1,
|
|
251
|
+
"correct_judge": "",
|
|
252
|
+
"is_auto_check": "",
|
|
253
|
+
"content": "[{\"<>\":\"p\",\"text\":\"Your brother is very noisy. Please tell him _________ in the library.\"}]",
|
|
254
|
+
"correct_subjective_answer": "",
|
|
255
|
+
"auto_check": true,
|
|
256
|
+
"options_data": [
|
|
257
|
+
{
|
|
258
|
+
"file_url": "",
|
|
259
|
+
"content_type": 1,
|
|
260
|
+
"file_type": 0,
|
|
261
|
+
"name": "",
|
|
262
|
+
"id": 0,
|
|
263
|
+
"thumbnail_url": "",
|
|
264
|
+
"option_content": "not talk loudly"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"file_url": "",
|
|
268
|
+
"content_type": 1,
|
|
269
|
+
"file_type": 0,
|
|
270
|
+
"name": "",
|
|
271
|
+
"id": 0,
|
|
272
|
+
"thumbnail_url": "",
|
|
273
|
+
"option_content": " talk loudly"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"file_url": "",
|
|
277
|
+
"content_type": 1,
|
|
278
|
+
"file_type": 0,
|
|
279
|
+
"name": "",
|
|
280
|
+
"id": 0,
|
|
281
|
+
"thumbnail_url": "",
|
|
282
|
+
"option_content": " to talk loudly"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"file_url": "",
|
|
286
|
+
"content_type": 1,
|
|
287
|
+
"file_type": 0,
|
|
288
|
+
"name": "",
|
|
289
|
+
"id": 0,
|
|
290
|
+
"thumbnail_url": "",
|
|
291
|
+
"option_content": "not to talk loudly"
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
"score": "1.00",
|
|
295
|
+
"sub_questions": [],
|
|
296
|
+
"style_type": "SELECT_R-T",
|
|
297
|
+
"template_file_full_url": "",
|
|
298
|
+
"question_name": "Your brother is very noisy. Please tell him _________ in the library.",
|
|
299
|
+
"correct_rate": "",
|
|
300
|
+
"knowledge_name": "",
|
|
301
|
+
"page_location_list": [],
|
|
302
|
+
"code_type": 0,
|
|
303
|
+
"difficulty_level": "2",
|
|
304
|
+
"question_index": "",
|
|
305
|
+
"correct_single_index": 1,
|
|
306
|
+
"question_type": "1",
|
|
307
|
+
"media_resources": [],
|
|
308
|
+
"analysis": "[{\"<>\":\"p\",\"text\":\"我是解析哈哈哈哈2222222\"}]",
|
|
309
|
+
"question_id": "13092",
|
|
310
|
+
"difficulty_level_str": "困难",
|
|
311
|
+
"update_date": "",
|
|
312
|
+
"exam_options_data": [
|
|
313
|
+
{
|
|
314
|
+
"data": {
|
|
315
|
+
"file_url": "",
|
|
316
|
+
"content_type": 1,
|
|
317
|
+
"file_type": 0,
|
|
318
|
+
"name": "",
|
|
319
|
+
"id": 0,
|
|
320
|
+
"thumbnail_url": "",
|
|
321
|
+
"option_content": "not talk loudly"
|
|
322
|
+
},
|
|
323
|
+
"index": 1
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"data": {
|
|
327
|
+
"file_url": "",
|
|
328
|
+
"content_type": 1,
|
|
329
|
+
"file_type": 0,
|
|
330
|
+
"name": "",
|
|
331
|
+
"id": 0,
|
|
332
|
+
"thumbnail_url": "",
|
|
333
|
+
"option_content": " talk loudly"
|
|
334
|
+
},
|
|
335
|
+
"index": 2
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"data": {
|
|
339
|
+
"file_url": "",
|
|
340
|
+
"content_type": 1,
|
|
341
|
+
"file_type": 0,
|
|
342
|
+
"name": "",
|
|
343
|
+
"id": 0,
|
|
344
|
+
"thumbnail_url": "",
|
|
345
|
+
"option_content": " to talk loudly"
|
|
346
|
+
},
|
|
347
|
+
"index": 3
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"data": {
|
|
351
|
+
"file_url": "",
|
|
352
|
+
"content_type": 1,
|
|
353
|
+
"file_type": 0,
|
|
354
|
+
"name": "",
|
|
355
|
+
"id": 0,
|
|
356
|
+
"thumbnail_url": "",
|
|
357
|
+
"option_content": "not to talk loudly"
|
|
358
|
+
},
|
|
359
|
+
"index": 4
|
|
360
|
+
}
|
|
361
|
+
],
|
|
362
|
+
"exam_link_answer_data": [],
|
|
363
|
+
"reference_file_full_url": "",
|
|
364
|
+
"correct_multiple_index_set": [],
|
|
365
|
+
"hint": "Multiple choice.2",
|
|
366
|
+
"knowledge_id": ""
|
|
367
|
+
}
|
|
368
|
+
],
|
|
369
|
+
"online_exam_name": "校招考试(仿真数据,勿调整)",
|
|
370
|
+
"remain_second": 59920,
|
|
371
|
+
"exam_description": "",
|
|
372
|
+
"applicant_simple_info": {
|
|
373
|
+
"applicant_id": "154",
|
|
374
|
+
"phone": "12345678905",
|
|
375
|
+
"applicant_name": "李老丹"
|
|
376
|
+
},
|
|
377
|
+
"user_answer_map": {
|
|
378
|
+
"13091": {
|
|
379
|
+
"answer_use_time": 0,
|
|
380
|
+
"scratch_answer_json": "",
|
|
381
|
+
"question_type": 0,
|
|
382
|
+
"code_file_oss_temp_path": "",
|
|
383
|
+
"multiple_index_set": [],
|
|
384
|
+
"single_index": 1,
|
|
385
|
+
"judge": false,
|
|
386
|
+
"question_id": 13091,
|
|
387
|
+
"is_correct": "0",
|
|
388
|
+
"gap_data": [],
|
|
389
|
+
"subjective_answer": "",
|
|
390
|
+
"oss_temp_url": ""
|
|
391
|
+
},
|
|
392
|
+
"13092": {
|
|
393
|
+
"answer_use_time": 0,
|
|
394
|
+
"scratch_answer_json": "",
|
|
395
|
+
"question_type": 0,
|
|
396
|
+
"code_file_oss_temp_path": "",
|
|
397
|
+
"multiple_index_set": [],
|
|
398
|
+
"single_index": 4,
|
|
399
|
+
"judge": false,
|
|
400
|
+
"question_id": 13092,
|
|
401
|
+
"is_correct": "1",
|
|
402
|
+
"gap_data": [],
|
|
403
|
+
"subjective_answer": "",
|
|
404
|
+
"oss_temp_url": ""
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"error_code": 0,
|
|
409
|
+
"message": "success",
|
|
410
|
+
"tid": "8f4f6e7b2287471fbc22ff5a3f4182e5.1822.16892350452200069",
|
|
411
|
+
"ts": 1689235045453
|
|
412
|
+
}
|
|
413
|
+
let {question_list,user_answer_map} = res.data
|
|
414
|
+
responsiveObj.value.resData = res.data
|
|
415
|
+
parseQuestionListItem(question_list,user_answer_map)
|
|
416
|
+
//错题
|
|
417
|
+
errQuestionList = (fun.copyDeepObject(question_list) as Array<any>).filter((item:any)=>{
|
|
418
|
+
return item.answerMap && item.answerMap.is_correct === '0'
|
|
419
|
+
})
|
|
420
|
+
//全部题目
|
|
421
|
+
allQuestionList = (fun.copyDeepObject(question_list) as Array<any>)
|
|
422
|
+
responsiveObj.value.questionListMapper = {'1':allQuestionList,'2':errQuestionList}
|
|
423
|
+
responsiveObj.value.questionList = question_list
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
function parseQuestionListItem(question_list:Array<any>,answer_map:any,parentIndex:any = undefined){
|
|
428
|
+
question_list.forEach((item:any,index:number)=>{
|
|
429
|
+
item.questionComponent = questionMapper[item.question_type]
|
|
430
|
+
// item.questionIndex = index + 1
|
|
431
|
+
if(parentIndex === undefined){
|
|
432
|
+
item.questionIndex = index + 1
|
|
433
|
+
}else{
|
|
434
|
+
item.questionIndex = (parentIndex + 1) + '-' + (index + 1)
|
|
435
|
+
item.questionIndex2 = index + 1
|
|
436
|
+
}
|
|
437
|
+
if(answer_map && answer_map.hasOwnProperty(item.question_id)){
|
|
438
|
+
item.answerMap = answer_map[item.question_id]
|
|
439
|
+
|
|
440
|
+
//analysis页面特殊处理
|
|
441
|
+
if(item.answerMap.user_coding_file){
|
|
442
|
+
item.answerMap.oss_temp_url = item.answerMap.user_coding_file
|
|
443
|
+
}
|
|
444
|
+
//analysis页面特殊处理score字段为 answerMap.question_max_score
|
|
445
|
+
item.score = item.answerMap.question_max_score
|
|
446
|
+
//预览接口学生答案以user_开头,为适配考试的学生答案,做处理
|
|
447
|
+
let answerMapKeys = Object.keys(item.answerMap)
|
|
448
|
+
let reg = /^user_/ig
|
|
449
|
+
answerMapKeys.forEach((answerMapKeysItem)=>{
|
|
450
|
+
if(reg.test(answerMapKeysItem)){
|
|
451
|
+
let newProp = answerMapKeysItem.replace(reg,'')
|
|
452
|
+
item.answerMap[newProp] = item.answerMap[answerMapKeysItem]
|
|
453
|
+
}
|
|
454
|
+
})
|
|
455
|
+
// data.code_file_oss_temp_path
|
|
456
|
+
}else{
|
|
457
|
+
item.answerMap = null
|
|
458
|
+
}
|
|
459
|
+
let question_type = item.question_type
|
|
460
|
+
if(question_type == 3){
|
|
461
|
+
//判断题手动构造选项数组
|
|
462
|
+
item.exam_options_data = [
|
|
463
|
+
{
|
|
464
|
+
index:1,data:{
|
|
465
|
+
name:'正确'
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
index:2,data:{
|
|
470
|
+
name:'错误'
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
]
|
|
474
|
+
}else{
|
|
475
|
+
if(item.exam_options_data && item.exam_options_data.length){
|
|
476
|
+
item.exam_options_data.forEach((subItem:any,subIndex:number)=>{
|
|
477
|
+
subItem.enIndex = fun.indexToEnIndex(subIndex+1)
|
|
478
|
+
})
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
//转化富文本
|
|
483
|
+
try{
|
|
484
|
+
item.htmlContent = $.json2html({}, JSON.parse(item.content));
|
|
485
|
+
if(item.analysis){
|
|
486
|
+
item.analysisHtmlContent = $.json2html({}, JSON.parse(item.analysis));
|
|
487
|
+
}else{
|
|
488
|
+
item.analysisHtmlContent = ''
|
|
489
|
+
}
|
|
490
|
+
}catch(e){
|
|
491
|
+
item.htmlContent = item.content
|
|
492
|
+
item.analysisHtmlContent = item.analysis
|
|
493
|
+
// console.log('json2html转化出错:', e);
|
|
494
|
+
}
|
|
495
|
+
//如果是阅读题要递归解析
|
|
496
|
+
if(item.sub_questions && item.sub_questions.length){
|
|
497
|
+
parseQuestionListItem(item.sub_questions,answer_map,index)
|
|
498
|
+
}
|
|
499
|
+
})
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function quitQuestion(){
|
|
503
|
+
fun.postMessageByType('close')
|
|
504
|
+
}
|
|
505
|
+
return {
|
|
506
|
+
...toRefs(data),
|
|
507
|
+
responsiveObj,
|
|
508
|
+
clickTab,
|
|
509
|
+
quitQuestion
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
})
|
|
513
|
+
</script>
|
|
514
|
+
<style lang="scss" scoped>
|
|
515
|
+
|
|
516
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<router-view v-slot="{ Component }">
|
|
3
|
+
<keep-alive>
|
|
4
|
+
<component :is="Component"
|
|
5
|
+
:key="Component"
|
|
6
|
+
v-if="$route.meta.keepAlive"/>
|
|
7
|
+
</keep-alive>
|
|
8
|
+
<component :is="Component"
|
|
9
|
+
:key="Component"
|
|
10
|
+
v-if="!$route.meta.keepAlive"/>
|
|
11
|
+
</router-view>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
|
|
16
|
+
import {defineComponent} from 'vue'
|
|
17
|
+
export default defineComponent({
|
|
18
|
+
methods: {
|
|
19
|
+
goRouter(goWhere: string) {
|
|
20
|
+
this.$router.push({
|
|
21
|
+
name: goWhere,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
components: {
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
</script>
|