zydx-plus 1.32.228 → 1.32.229
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/package.json
CHANGED
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<div class="choice-box" v-for="(ts,ind) in item.testKey">
|
|
53
53
|
<label>
|
|
54
54
|
<input class="choice-input" v-if="chooseAnswer" :disabled="disabled" :checked="ts.checked" @change="answerChange($event,item,`${id}${index}`)" :type="ques(item.quesType)?'radio':'checkbox'" :name="`${id}${index}`" />
|
|
55
|
-
<span :class="{'choice-span': chooseAnswer,'choice-color': disabled&&ts.checked&&!item.
|
|
55
|
+
<span :class="{'choice-span': chooseAnswer,'choice-color': disabled&&ts.checked&&!item.error,'choice-red': disabled&&ts.checked&&item.error}">{{ ts.index }}. {{ ts.content[0] }}</span>
|
|
56
56
|
</label>
|
|
57
57
|
</div>
|
|
58
58
|
</div>
|
|
@@ -195,53 +195,7 @@ export default {
|
|
|
195
195
|
data: {
|
|
196
196
|
handler: function (val, oldVal) {
|
|
197
197
|
if(this.state) return
|
|
198
|
-
this.
|
|
199
|
-
this.value.map((item,index) => { // 转换html
|
|
200
|
-
item.choice = true
|
|
201
|
-
item.right = 0
|
|
202
|
-
item.top = 0
|
|
203
|
-
item.open = item.open? item.open: true
|
|
204
|
-
item.replace = item.replace? item.replace: true
|
|
205
|
-
item.reasoning = item.reasoning? item.reasoning: true
|
|
206
|
-
item.review = item.review? item.review: true
|
|
207
|
-
item.subject = item.subject? item.subject: true
|
|
208
|
-
item.red = item.red? item.red: false
|
|
209
|
-
if(item.alist) {
|
|
210
|
-
item.alist.map(x => {
|
|
211
|
-
x.annexContent = json2html({node: "root",child: JSON.parse(x.annexContent)})
|
|
212
|
-
return x
|
|
213
|
-
})
|
|
214
|
-
}
|
|
215
|
-
if(item.testKey) {
|
|
216
|
-
item.testKey = typeof item.testKey === 'string'? JSON.parse(item.testKey): item.testKey
|
|
217
|
-
item.testKey = item.testKey.map(x => {
|
|
218
|
-
if(this.ques(item.quesType)) { // 判断是否单选
|
|
219
|
-
x.checked = x.index === item?.judgeAnswer; //答案
|
|
220
|
-
}else {
|
|
221
|
-
for(let i=0; i<item?.judgeAnswer?.length; i++) {
|
|
222
|
-
if(x.index === item.judgeAnswer[i]) {
|
|
223
|
-
x.checked = true
|
|
224
|
-
break
|
|
225
|
-
}else {
|
|
226
|
-
x.checked = false
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return x
|
|
231
|
-
})
|
|
232
|
-
}
|
|
233
|
-
console.log(item)
|
|
234
|
-
return item
|
|
235
|
-
})
|
|
236
|
-
this.$nextTick(() => { // 保证所有的数据都渲染完毕
|
|
237
|
-
const w = this.$refs.parer.offsetWidth // 获取父级宽度
|
|
238
|
-
for(let i = 0; i< this.$refs?.subject?.length; i++) {
|
|
239
|
-
this.value[i].right = w - this.$refs.subject[i].offsetLeft
|
|
240
|
-
if(this.$refs.b && this.$refs.b.length > 0) {
|
|
241
|
-
if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25 // 判断是否换行
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
})
|
|
198
|
+
this.init()
|
|
245
199
|
},
|
|
246
200
|
immediate: true,
|
|
247
201
|
},
|
|
@@ -261,55 +215,60 @@ export default {
|
|
|
261
215
|
mounted() {
|
|
262
216
|
this.id = this.randomId()
|
|
263
217
|
if(!this.state) return
|
|
264
|
-
this.
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
item
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
item.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
218
|
+
this.init()
|
|
219
|
+
},
|
|
220
|
+
emits: ['change','modify','del','changeAll','replaceData','choiceData','judgeAnswer','openReasoning','review','subject'],
|
|
221
|
+
methods: {
|
|
222
|
+
init() {
|
|
223
|
+
this.value = JSON.parse(JSON.stringify(this.data))
|
|
224
|
+
this.value.map((item,index) => { // 转换html
|
|
225
|
+
item.choice = true
|
|
226
|
+
item.right = 0
|
|
227
|
+
item.top = 0
|
|
228
|
+
item.open = item.open !== undefined? item.open: true
|
|
229
|
+
item.replace = item.replace !== undefined? item.replace: true
|
|
230
|
+
item.reasoning = item.reasoning !== undefined? item.reasoning: true
|
|
231
|
+
item.review = item.review !== undefined? item.review: true
|
|
232
|
+
item.subject = item.subject !== undefined? item.subject: true
|
|
233
|
+
item.error = item.error !== undefined? item.error: false
|
|
234
|
+
if(item.alist) {
|
|
235
|
+
item.alist.map(x => {
|
|
236
|
+
x.annexContent = json2html({node: "root",child: JSON.parse(x.annexContent)})
|
|
237
|
+
return x
|
|
238
|
+
})
|
|
239
|
+
}
|
|
240
|
+
if(item.testKey) {
|
|
241
|
+
item.testKey = typeof item.testKey === 'string'? JSON.parse(item.testKey): item.testKey
|
|
242
|
+
let judge = item?.judgeAnswer
|
|
243
|
+
if(item.stuAnswer) judge = item.stuAnswer?.answer
|
|
244
|
+
item.testKey = item.testKey.map(x => {
|
|
245
|
+
if(this.ques(item.quesType)) { // 判断是否单选
|
|
246
|
+
x.checked = x.index === judge; //答案
|
|
247
|
+
}else {
|
|
248
|
+
for(let i=0; i<judge?.length; i++) {
|
|
249
|
+
if(x.index === judge[i]) {
|
|
250
|
+
x.checked = true
|
|
251
|
+
break
|
|
252
|
+
}else {
|
|
253
|
+
x.checked = false
|
|
254
|
+
}
|
|
293
255
|
}
|
|
294
256
|
}
|
|
257
|
+
return x
|
|
258
|
+
})
|
|
259
|
+
}
|
|
260
|
+
return item
|
|
261
|
+
})
|
|
262
|
+
this.$nextTick(() => { // 保证所有的数据都渲染完毕
|
|
263
|
+
const w = this.$refs.parer.offsetWidth // 获取父级宽度
|
|
264
|
+
for(let i = 0; i< this.$refs?.subject?.length; i++) {
|
|
265
|
+
this.value[i].right = w - this.$refs.subject[i].offsetLeft
|
|
266
|
+
if(this.$refs.b && this.$refs.b.length > 0) {
|
|
267
|
+
if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25 // 判断是否换行
|
|
295
268
|
}
|
|
296
|
-
return x
|
|
297
|
-
})
|
|
298
|
-
}
|
|
299
|
-
return item
|
|
300
|
-
})
|
|
301
|
-
this.$nextTick(() => { // 保证所有的数据都渲染完毕
|
|
302
|
-
const w = this.$refs.parer.offsetWidth // 获取父级宽度
|
|
303
|
-
for(let i = 0; i< this.$refs?.subject?.length; i++) {
|
|
304
|
-
this.value[i].right = w - this.$refs.subject[i].offsetLeft
|
|
305
|
-
if(this.$refs.b && this.$refs.b.length > 0) {
|
|
306
|
-
if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25 // 判断是否换行
|
|
307
269
|
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
emits: ['change','modify','del','changeAll','replaceData','choiceData','judgeAnswer','openReasoning','review','subject'],
|
|
312
|
-
methods: {
|
|
270
|
+
})
|
|
271
|
+
},
|
|
313
272
|
randomId() { // 生成随机id
|
|
314
273
|
const id = Math.random().toString(36).substr(2)
|
|
315
274
|
return id.replace(/[0-9]/g, '')
|