Commit 23659274bde62549853b77aeb186fe6d6212f1d1
1 parent
e17ec739
备题接口对接
Showing
4 changed files
with
258 additions
and
247 deletions
src/mock/index.js
... | ... | @@ -245,194 +245,225 @@ Mock.mock( |
245 | 245 | data: { |
246 | 246 | "name": "@ctitle", |
247 | 247 | "id|+1": 11, |
248 | + // "questionList": [ | |
249 | + // { | |
250 | + // "examQuestionId|+1": 0, | |
251 | + // "questionId|+1": 1, | |
252 | + // "questionTitle": "@cname", | |
253 | + // "questionType|1-4": 1, | |
254 | + // "score|1-2": 1, | |
255 | + // "partScore|0.5-1": 0.5, | |
256 | + // "answerOptions": "A,B,C,D", | |
257 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
258 | + // "subQuestions": [ | |
259 | + // { | |
260 | + // "questionType": 2, | |
261 | + // "score": 1, | |
262 | + // "partScore": 0, | |
263 | + // "selectNum": 4, | |
264 | + // "answerOptions": "A,B,C,D", | |
265 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
266 | + // "screenshot": "./1.html", | |
267 | + // "knowledge": "数与式#有理数#正数和负数,数与式#有理数#有理数" | |
268 | + // }, | |
269 | + // { | |
270 | + // "questionType": 2, | |
271 | + // "score": 1, | |
272 | + // "partScore": 0, | |
273 | + // "selectNum": 4, | |
274 | + // "answerOptions": "A,B,C,D", | |
275 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
276 | + // "screenshot": "./1.html", | |
277 | + // "knowledge": "数与式#有理数#正数和负数" | |
278 | + // }, | |
279 | + // { | |
280 | + // "questionType": 2, | |
281 | + // "score": 1, | |
282 | + // "partScore": 0, | |
283 | + // "selectNum": 4, | |
284 | + // "answerOptions": "A,B,C,D", | |
285 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
286 | + // "screenshot": "./1.html", | |
287 | + // }, | |
288 | + // { | |
289 | + // "questionType": 2, | |
290 | + // "score": 1, | |
291 | + // "partScore": 0, | |
292 | + // "selectNum": 4, | |
293 | + // "answerOptions": "A,B,C,D", | |
294 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
295 | + // "screenshot": "./1.html", | |
296 | + // }, | |
297 | + // { | |
298 | + // "questionType": 2, | |
299 | + // "score": 1, | |
300 | + // "partScore": 0, | |
301 | + // "selectNum": 4, | |
302 | + // "answerOptions": "A,B,C,D", | |
303 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
304 | + // "screenshot": "./1.html", | |
305 | + // }, | |
306 | + // { | |
307 | + // "questionType": 3, | |
308 | + // "score": 1, | |
309 | + // "partScore": 0, | |
310 | + // "selectNum": 4, | |
311 | + // "answerOptions": "A,B,C,D", | |
312 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
313 | + // "screenshot": "./1.html", | |
314 | + // }, | |
315 | + // ] | |
316 | + // }, | |
317 | + // { | |
318 | + // "examQuestionId|+1": 0, | |
319 | + // "questionId|+1": 1, | |
320 | + // "questionTitle": "@cname", | |
321 | + // "questionType|1-4": 1, | |
322 | + // "score|1-2": 1, | |
323 | + // "partScore|0.5-1": 0.5, | |
324 | + // "answerOptions": "A,B,C,D", | |
325 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
326 | + // "subQuestions": [ | |
327 | + // { | |
328 | + // "questionType": 2, | |
329 | + // "score": 1, | |
330 | + // "partScore": 0, | |
331 | + // "selectNum": 4, | |
332 | + // "answerOptions": "A,B,C,D", | |
333 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
334 | + // "screenshot": "./1.html", | |
335 | + // }, | |
336 | + // { | |
337 | + // "questionType": 2, | |
338 | + // "score": 1, | |
339 | + // "partScore": 0, | |
340 | + // "selectNum": 4, | |
341 | + // "answerOptions": "A,B,C,D", | |
342 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
343 | + // "screenshot": "./1.html", | |
344 | + // }, | |
345 | + // { | |
346 | + // "questionType": 2, | |
347 | + // "score": 1, | |
348 | + // "partScore": 0, | |
349 | + // "selectNum": 4, | |
350 | + // "answerOptions": "A,B,C,D", | |
351 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
352 | + // "screenshot": "./1.html", | |
353 | + // }, | |
354 | + // { | |
355 | + // "questionType": 2, | |
356 | + // "score": 1, | |
357 | + // "partScore": 0, | |
358 | + // "selectNum": 4, | |
359 | + // "answerOptions": "A,B,C,D", | |
360 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
361 | + // "screenshot": "./1.html", | |
362 | + // }, | |
363 | + // { | |
364 | + // "questionType": 2, | |
365 | + // "score": 1, | |
366 | + // "partScore": 0, | |
367 | + // "selectNum": 4, | |
368 | + // "answerOptions": "A,B,C,D", | |
369 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
370 | + // "screenshot": "./1.html", | |
371 | + // }, | |
372 | + // { | |
373 | + // "questionType": 3, | |
374 | + // "score": 1, | |
375 | + // "partScore": 0, | |
376 | + // "selectNum": 4, | |
377 | + // "answerOptions": "A,B,C,D", | |
378 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
379 | + // "screenshot": "./1.html", | |
380 | + // }, | |
381 | + // { | |
382 | + // "questionType": 2, | |
383 | + // "score": 1, | |
384 | + // "partScore": 0, | |
385 | + // "selectNum": 4, | |
386 | + // "answerOptions": "A,B,C,D", | |
387 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
388 | + // "screenshot": "./1.html", | |
389 | + // }, | |
390 | + // { | |
391 | + // "questionType": 2, | |
392 | + // "score": 1, | |
393 | + // "partScore": 0, | |
394 | + // "selectNum": 4, | |
395 | + // "answerOptions": "A,B,C,D", | |
396 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
397 | + // "screenshot": "./1.html", | |
398 | + // }, | |
399 | + // { | |
400 | + // "questionType": 2, | |
401 | + // "score": 1, | |
402 | + // "partScore": 0, | |
403 | + // "selectNum": 4, | |
404 | + // "answerOptions": "A,B,C,D", | |
405 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
406 | + // "screenshot": "./1.html", | |
407 | + // }, | |
408 | + // { | |
409 | + // "questionType": 2, | |
410 | + // "score": 1, | |
411 | + // "partScore": 0, | |
412 | + // "selectNum": 4, | |
413 | + // "answerOptions": "A,B,C,D", | |
414 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
415 | + // "screenshot": "./1.html", | |
416 | + // }, | |
417 | + // { | |
418 | + // "questionType": 2, | |
419 | + // "score": 1, | |
420 | + // "partScore": 0, | |
421 | + // "selectNum": 4, | |
422 | + // "answerOptions": "A,B,C,D", | |
423 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
424 | + // "screenshot": "./1.html", | |
425 | + // }, | |
426 | + // { | |
427 | + // "questionType": 2, | |
428 | + // "score": 1, | |
429 | + // "partScore": 0, | |
430 | + // "selectNum": 4, | |
431 | + // "answerOptions": "A,B,C,D", | |
432 | + // "correctAnswer|1": ["A", "B", "C", "D"], | |
433 | + // "screenshot": "./1.html", | |
434 | + // } | |
435 | + // ] | |
436 | + // }, | |
437 | + // ], | |
248 | 438 | "questionList": [ |
249 | 439 | { |
250 | - "examQuestionId|+1": 0, | |
251 | - "questionId|+1": 1, | |
252 | - "questionTitle": "@cname", | |
253 | - "questionType|1-4": 1, | |
254 | - "score|1-2": 1, | |
255 | - "partScore|0.5-1": 0.5, | |
440 | + "questionType": 2, | |
441 | + "score": 1, | |
442 | + "partScore": 0, | |
443 | + "selectNum": 4, | |
256 | 444 | "answerOptions": "A,B,C,D", |
257 | 445 | "correctAnswer|1": ["A", "B", "C", "D"], |
258 | - "subQuestions": [ | |
259 | - { | |
260 | - "questionType": 2, | |
261 | - "score": 1, | |
262 | - "partScore": 0, | |
263 | - "selectNum": 4, | |
264 | - "answerOptions": "A,B,C,D", | |
265 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
266 | - "screenshot": "./1.html", | |
267 | - "knowledge": "数与式#有理数#正数和负数,数与式#有理数#有理数" | |
268 | - }, | |
269 | - { | |
270 | - "questionType": 2, | |
271 | - "score": 1, | |
272 | - "partScore": 0, | |
273 | - "selectNum": 4, | |
274 | - "answerOptions": "A,B,C,D", | |
275 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
276 | - "screenshot": "./1.html", | |
277 | - "knowledge": "数与式#有理数#正数和负数" | |
278 | - }, | |
279 | - { | |
280 | - "questionType": 2, | |
281 | - "score": 1, | |
282 | - "partScore": 0, | |
283 | - "selectNum": 4, | |
284 | - "answerOptions": "A,B,C,D", | |
285 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
286 | - "screenshot": "./1.html", | |
287 | - }, | |
288 | - { | |
289 | - "questionType": 2, | |
290 | - "score": 1, | |
291 | - "partScore": 0, | |
292 | - "selectNum": 4, | |
293 | - "answerOptions": "A,B,C,D", | |
294 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
295 | - "screenshot": "./1.html", | |
296 | - }, | |
297 | - { | |
298 | - "questionType": 2, | |
299 | - "score": 1, | |
300 | - "partScore": 0, | |
301 | - "selectNum": 4, | |
302 | - "answerOptions": "A,B,C,D", | |
303 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
304 | - "screenshot": "./1.html", | |
305 | - }, | |
306 | - { | |
307 | - "questionType": 3, | |
308 | - "score": 1, | |
309 | - "partScore": 0, | |
310 | - "selectNum": 4, | |
311 | - "answerOptions": "A,B,C,D", | |
312 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
313 | - "screenshot": "./1.html", | |
314 | - }, | |
315 | - ] | |
446 | + "screenshot": "./1.html", | |
447 | + "knowledge": "数与式#有理数#正数和负数,数与式#有理数#有理数" | |
316 | 448 | }, |
317 | 449 | { |
318 | - "examQuestionId|+1": 0, | |
319 | - "questionId|+1": 1, | |
320 | - "questionTitle": "@cname", | |
321 | - "questionType|1-4": 1, | |
322 | - "score|1-2": 1, | |
323 | - "partScore|0.5-1": 0.5, | |
450 | + "questionType": 2, | |
451 | + "score": 1, | |
452 | + "partScore": 0, | |
453 | + "selectNum": 4, | |
324 | 454 | "answerOptions": "A,B,C,D", |
325 | 455 | "correctAnswer|1": ["A", "B", "C", "D"], |
326 | - "subQuestions": [ | |
327 | - { | |
328 | - "questionType": 2, | |
329 | - "score": 1, | |
330 | - "partScore": 0, | |
331 | - "selectNum": 4, | |
332 | - "answerOptions": "A,B,C,D", | |
333 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
334 | - "screenshot": "./1.html", | |
335 | - }, | |
336 | - { | |
337 | - "questionType": 2, | |
338 | - "score": 1, | |
339 | - "partScore": 0, | |
340 | - "selectNum": 4, | |
341 | - "answerOptions": "A,B,C,D", | |
342 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
343 | - "screenshot": "./1.html", | |
344 | - }, | |
345 | - { | |
346 | - "questionType": 2, | |
347 | - "score": 1, | |
348 | - "partScore": 0, | |
349 | - "selectNum": 4, | |
350 | - "answerOptions": "A,B,C,D", | |
351 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
352 | - "screenshot": "./1.html", | |
353 | - }, | |
354 | - { | |
355 | - "questionType": 2, | |
356 | - "score": 1, | |
357 | - "partScore": 0, | |
358 | - "selectNum": 4, | |
359 | - "answerOptions": "A,B,C,D", | |
360 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
361 | - "screenshot": "./1.html", | |
362 | - }, | |
363 | - { | |
364 | - "questionType": 2, | |
365 | - "score": 1, | |
366 | - "partScore": 0, | |
367 | - "selectNum": 4, | |
368 | - "answerOptions": "A,B,C,D", | |
369 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
370 | - "screenshot": "./1.html", | |
371 | - }, | |
372 | - { | |
373 | - "questionType": 3, | |
374 | - "score": 1, | |
375 | - "partScore": 0, | |
376 | - "selectNum": 4, | |
377 | - "answerOptions": "A,B,C,D", | |
378 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
379 | - "screenshot": "./1.html", | |
380 | - }, | |
381 | - { | |
382 | - "questionType": 2, | |
383 | - "score": 1, | |
384 | - "partScore": 0, | |
385 | - "selectNum": 4, | |
386 | - "answerOptions": "A,B,C,D", | |
387 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
388 | - "screenshot": "./1.html", | |
389 | - }, | |
390 | - { | |
391 | - "questionType": 2, | |
392 | - "score": 1, | |
393 | - "partScore": 0, | |
394 | - "selectNum": 4, | |
395 | - "answerOptions": "A,B,C,D", | |
396 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
397 | - "screenshot": "./1.html", | |
398 | - }, | |
399 | - { | |
400 | - "questionType": 2, | |
401 | - "score": 1, | |
402 | - "partScore": 0, | |
403 | - "selectNum": 4, | |
404 | - "answerOptions": "A,B,C,D", | |
405 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
406 | - "screenshot": "./1.html", | |
407 | - }, | |
408 | - { | |
409 | - "questionType": 2, | |
410 | - "score": 1, | |
411 | - "partScore": 0, | |
412 | - "selectNum": 4, | |
413 | - "answerOptions": "A,B,C,D", | |
414 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
415 | - "screenshot": "./1.html", | |
416 | - }, | |
417 | - { | |
418 | - "questionType": 2, | |
419 | - "score": 1, | |
420 | - "partScore": 0, | |
421 | - "selectNum": 4, | |
422 | - "answerOptions": "A,B,C,D", | |
423 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
424 | - "screenshot": "./1.html", | |
425 | - }, | |
426 | - { | |
427 | - "questionType": 2, | |
428 | - "score": 1, | |
429 | - "partScore": 0, | |
430 | - "selectNum": 4, | |
431 | - "answerOptions": "A,B,C,D", | |
432 | - "correctAnswer|1": ["A", "B", "C", "D"], | |
433 | - "screenshot": "./1.html", | |
434 | - } | |
435 | - ] | |
456 | + "screenshot": "./1.html", | |
457 | + "knowledge": "数与式#有理数#正数和负数" | |
458 | + }, | |
459 | + { | |
460 | + "questionType": 2, | |
461 | + "score": 1, | |
462 | + "partScore": 0, | |
463 | + "selectNum": 4, | |
464 | + "answerOptions": "A,B,C,D", | |
465 | + "correctAnswer|1": ["A", "B", "C", "D"], | |
466 | + "screenshot": "./1.html", | |
436 | 467 | }, |
437 | 468 | ] |
438 | 469 | } | ... | ... |
src/views/examinationPaper/add.vue
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | <div v-show="step == 0"> |
16 | 16 | <el-form ref="forms" :model="form" :rules="formRules" label-width="140px"> |
17 | 17 | <el-form-item label="答题卡名称:" prop="title"> |
18 | - <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="30" size="45" | |
18 | + <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="50" size="45" | |
19 | 19 | show-word-limit> |
20 | 20 | </el-input> |
21 | 21 | </el-form-item> |
... | ... | @@ -642,8 +642,8 @@ export default { |
642 | 642 | { required: true, message: "请输入答题卡名称", trigger: "blur" }, |
643 | 643 | { |
644 | 644 | min: 1, |
645 | - max: 30, | |
646 | - message: "长度在 1 到 30 个字符", | |
645 | + max: 50, | |
646 | + message: "长度在 1 到 50 个字符", | |
647 | 647 | trigger: "blur", |
648 | 648 | }, |
649 | 649 | ], |
... | ... | @@ -1489,7 +1489,7 @@ export default { |
1489 | 1489 | }, |
1490 | 1490 | async _QuerySubjectList(grade) { |
1491 | 1491 | //查询科目列表 |
1492 | - if (!grade && this.role != "ROLE_PERSONAL") { | |
1492 | + if (!grade) { | |
1493 | 1493 | return; |
1494 | 1494 | } |
1495 | 1495 | let query = {}; |
... | ... | @@ -1565,7 +1565,7 @@ export default { |
1565 | 1565 | item.subQuestions?.map((items) => { |
1566 | 1566 | return { |
1567 | 1567 | ...items, |
1568 | - selectNum: items.answerOptions.split(",").length, | |
1568 | + selectNum: items.answerOptions?.split(",").length, | |
1569 | 1569 | answerOptions: items.answerOptions || "A,B,C,D", |
1570 | 1570 | screenshot: items.screenshot || "", |
1571 | 1571 | correctAnswer: items.correctAnswer || "", | ... | ... |
src/views/examinationPaper/addAsk.vue
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | <div v-show="step == 0"> |
15 | 15 | <el-form ref="forms" :model="form" :rules="formRules" label-width="140px"> |
16 | 16 | <el-form-item label="课件名称:" prop="title"> |
17 | - <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="30" size="45" | |
17 | + <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="50" size="45" | |
18 | 18 | show-word-limit> |
19 | 19 | </el-input> |
20 | 20 | </el-form-item> |
... | ... | @@ -57,8 +57,8 @@ |
57 | 57 | <div class="qs-options qs-options2">选项设置</div> |
58 | 58 | <div class="qs-upload">提干</div> |
59 | 59 | <div class="qs-upload">题目解析</div> |
60 | - <div class="qs-upload">知识点</div> | |
61 | - <div class="qs-set"></div> | |
60 | + <div class="qs-upload" v-if="knowledgeData.length">知识点</div> | |
61 | + <div class="qs-set">操作</div> | |
62 | 62 | </li> |
63 | 63 | <li v-for="(subQuestions, index) in form.questionList" :key="index"> |
64 | 64 | <p class="set-ans-btn" v-if="subQuestions.qusType && |
... | ... | @@ -142,7 +142,7 @@ |
142 | 142 | icon="el-icon-tickets"></el-button> |
143 | 143 | </el-popover> |
144 | 144 | </div> |
145 | - <div class="qs-upload"> | |
145 | + <div class="qs-upload" v-if="knowledgeData.length"> | |
146 | 146 | <el-button type="primary" circle size="mini" icon="el-icon-price-tag" |
147 | 147 | @click="openKnowledge(subQuestions, index)"></el-button> |
148 | 148 | </div> |
... | ... | @@ -274,33 +274,6 @@ |
274 | 274 | import { deepClone, checkAnswer } from "utils"; |
275 | 275 | import knowledgeList from "assets/js/knowledgeList.js"; |
276 | 276 | export default { |
277 | - computed: { | |
278 | - // 知识点列表 根据学段-科目筛选 | |
279 | - knowledgeData: function () { | |
280 | - let jsons = [] | |
281 | - if (this.form.gradeName && this.form.subjectName) { | |
282 | - let sectionName = "" | |
283 | - this.gradeClassList.map(item => { | |
284 | - if (this.form.gradeName == item.gradeName) { | |
285 | - sectionName = item.sectionName | |
286 | - } | |
287 | - }) | |
288 | - if (sectionName && Object.keys(this.knowledgeList).includes(sectionName)) { | |
289 | - if (Object.keys(this.knowledgeList[sectionName]).includes(this.form.subjectName)) { | |
290 | - jsons = this.knowledgeList[sectionName][this.form.subjectName] | |
291 | - } | |
292 | - } | |
293 | - } | |
294 | - return jsons | |
295 | - }, | |
296 | - }, | |
297 | - watch: { | |
298 | - step: function () { | |
299 | - this.$nextTick(function () { | |
300 | - this.$refs.content.scrollTop = 0; | |
301 | - }); | |
302 | - }, | |
303 | - }, | |
304 | 277 | data() { |
305 | 278 | return { |
306 | 279 | role: "", |
... | ... | @@ -322,8 +295,8 @@ export default { |
322 | 295 | { required: true, message: "请输入答题卡名称", trigger: "blur" }, |
323 | 296 | { |
324 | 297 | min: 1, |
325 | - max: 30, | |
326 | - message: "长度在 1 到 30 个字符", | |
298 | + max: 50, | |
299 | + message: "长度在 1 到 50 个字符", | |
327 | 300 | trigger: "blur", |
328 | 301 | }, |
329 | 302 | ], |
... | ... | @@ -363,6 +336,33 @@ export default { |
363 | 336 | knowledgeList: { ...knowledgeList } |
364 | 337 | }; |
365 | 338 | }, |
339 | + computed: { | |
340 | + // 知识点列表 根据学段-科目筛选 | |
341 | + knowledgeData: function () { | |
342 | + let jsons = [] | |
343 | + if (this.form.gradeName && this.form.subjectName) { | |
344 | + let sectionName = "" | |
345 | + this.gradeClassList.map(item => { | |
346 | + if (this.form.gradeName == item.gradeName) { | |
347 | + sectionName = item.sectionName | |
348 | + } | |
349 | + }) | |
350 | + if (sectionName && Object.keys(this.knowledgeList).includes(sectionName)) { | |
351 | + if (Object.keys(this.knowledgeList[sectionName]).includes(this.form.subjectName)) { | |
352 | + jsons = this.knowledgeList[sectionName][this.form.subjectName] | |
353 | + } | |
354 | + } | |
355 | + } | |
356 | + return jsons | |
357 | + }, | |
358 | + }, | |
359 | + watch: { | |
360 | + step: function () { | |
361 | + this.$nextTick(function () { | |
362 | + this.$refs.content.scrollTop = 0; | |
363 | + }); | |
364 | + }, | |
365 | + }, | |
366 | 366 | async created() { |
367 | 367 | this.type = this.$route.query.type ? this.$route.query.type : 1; |
368 | 368 | this.role = |
... | ... | @@ -391,6 +391,7 @@ export default { |
391 | 391 | openStem(obj, index, type) { |
392 | 392 | this.stem.index = index; |
393 | 393 | this.stem.screenshot = obj.screenshot || ""; |
394 | + this.stem.type = type | |
394 | 395 | if (type == 1) { |
395 | 396 | this.stem.screenshot = obj.screenshot || ""; |
396 | 397 | this.stem.answerScreenshot = ""; |
... | ... | @@ -710,7 +711,7 @@ export default { |
710 | 711 | this.form.questionList.splice(index, 1); |
711 | 712 | this.formateQuestion() |
712 | 713 | }, |
713 | - //切换多题型-小题题型 | |
714 | + //切换题型 | |
714 | 715 | changeSubQuestions(val, subQuestions) { |
715 | 716 | const that = this; |
716 | 717 | subQuestions.score = 1; |
... | ... | @@ -737,28 +738,6 @@ export default { |
737 | 738 | break; |
738 | 739 | } |
739 | 740 | }, |
740 | - //添加选项 | |
741 | - addOptions(subQuestions) { | |
742 | - let length = subQuestions.answerOptions.split(",").length; | |
743 | - if (length > 9) return; | |
744 | - subQuestions.selectNum = length + 1; | |
745 | - subQuestions.answerOptions = this.rightOptions | |
746 | - .slice(0, subQuestions.selectNum) | |
747 | - .join(","); | |
748 | - }, | |
749 | - //删除选项 | |
750 | - removeOptions(subQuestions) { | |
751 | - let length = subQuestions.answerOptions.split(",").length; | |
752 | - if (length < 3) return; | |
753 | - subQuestions.selectNum = length - 1; | |
754 | - subQuestions.answerOptions = this.rightOptions | |
755 | - .slice(0, subQuestions.selectNum) | |
756 | - .join(","); | |
757 | - subQuestions.correctAnswer = subQuestions.correctAnswer.slice( | |
758 | - 0, | |
759 | - subQuestions.selectNum | |
760 | - ); | |
761 | - }, | |
762 | 741 | //设置多选答案 |
763 | 742 | changAnswer(sub, option) { |
764 | 743 | let str = new RegExp(option, "g"); |
... | ... | @@ -900,12 +879,12 @@ export default { |
900 | 879 | } |
901 | 880 | this.form.questionList = data.questionList?.map((item) => { |
902 | 881 | return { |
903 | - ...items, | |
904 | - selectNum: items.answerOptions.split(",").length, | |
905 | - answerOptions: items.answerOptions || "A,B,C,D", | |
906 | - screenshot: items.screenshot || "", | |
907 | - correctAnswer: items.correctAnswer || "", | |
908 | - knowledge: items.knowledge || "", | |
882 | + ...item, | |
883 | + selectNum: item.answerOptions?.split(",").length || 4, | |
884 | + answerOptions: item.answerOptions || "A,B,C,D", | |
885 | + screenshot: item.screenshot || "", | |
886 | + correctAnswer: item.correctAnswer || "", | |
887 | + knowledge: item.knowledge || "", | |
909 | 888 | } |
910 | 889 | }); |
911 | 890 | } | ... | ... |