Blame view

src/views/examinationPaper/add.vue 77 KB
ce278878   梁保满   2-2 bugfix
1
  <!-- 组卷 -->
77ebf04d   梁保满   个人版
2
3
4
5
6
7
8
9
  <template>
    <div ref="content" class="content-box">
      <back-box>
        <template slot="title">
          <span>{{ "创建答题卡" }}</span>
        </template>
      </back-box>
      <div class="content">
df616627   梁保满   添加修改试卷 题目解析样式问题
10
        
b0cd2598   梁保满   fix:测试问题
11
12
13
14
15
16
        <el-steps
          :active="step"
          finish-status="success"
          simple
          style="margin: 20px 0"
        >
77ebf04d   梁保满   个人版
17
          <el-step title="基础信息" icon="el-icon-edit"></el-step>
b0cd2598   梁保满   fix:测试问题
18
19
20
21
22
          <el-step
            v-if="!isUpload"
            title="题目编辑"
            icon="el-icon-tickets"
          ></el-step>
77ebf04d   梁保满   个人版
23
          <el-step title="设置答案" icon="el-icon-edit-outline"></el-step>
b0cd2598   梁保满   fix:测试问题
24
25
26
27
28
          <el-step
            v-if="isUpload"
            title="试卷预览"
            icon="el-icon-edit-outline"
          ></el-step>
77ebf04d   梁保满   个人版
29
30
        </el-steps>
        <div v-show="step == 0">
b0cd2598   梁保满   fix:测试问题
31
32
33
34
35
36
          <el-form
            ref="forms"
            :model="form"
            :rules="formRules"
            label-width="140px"
          >
77ebf04d   梁保满   个人版
37
            <el-form-item label="答题卡名称:" prop="title">
b0cd2598   梁保满   fix:测试问题
38
39
40
41
42
43
44
45
46
              <el-input
                class="sel2"
                type="text"
                placeholder="请输入答题卡名称"
                v-model.trim="form.title"
                maxlength="50"
                size="45"
                show-word-limit
              >
77ebf04d   梁保满   个人版
47
48
49
50
51
              </el-input>
            </el-form-item>
            <el-form-item label="测验类型:">
              <el-select v-model="form.tagId" placeholder="选择测验类型">
                <el-option label="--" value=""> </el-option>
b0cd2598   梁保满   fix:测试问题
52
53
54
55
56
57
58
                <el-option
                  v-for="item in answerTypeList"
                  :key="item.id"
                  :label="item.typeName"
                  :value="item.id"
                  >{{ item.typeName }}</el-option
                >
77ebf04d   梁保满   个人版
59
              </el-select>
b0cd2598   梁保满   fix:测试问题
60
61
62
63
64
65
66
67
              <el-button
                class="ml-20"
                type="primary"
                round
                circle
                icon="el-icon-edit"
                @click="openTagDia"
              ></el-button>
77ebf04d   梁保满   个人版
68
            </el-form-item>
b0cd2598   梁保满   fix:测试问题
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
            <el-form-item
              v-if="role != 'ROLE_PERSONAL'"
              label="年级:"
              prop="gradeName"
            >
              <el-select
                class="sel"
                v-model="form.gradeName"
                placeholder=""
                @change="changeGrade"
              >
                <el-option
                  v-for="item in gradeList"
                  :key="item"
                  :label="item"
                  :value="item"
                >
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
86
87
88
                </el-option>
              </el-select>
            </el-form-item>
77ebf04d   梁保满   个人版
89
90
            <el-form-item label="科目:" prop="subjectName">
              <el-select class="sel" v-model="form.subjectName" placeholder="">
b0cd2598   梁保满   fix:测试问题
91
92
93
94
95
96
                <el-option
                  v-for="item in subjectList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  >{{ item.label }}
77ebf04d   梁保满   个人版
97
98
99
100
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="考试时长:">
b0cd2598   梁保满   fix:测试问题
101
102
103
104
105
106
107
108
109
              <el-input-number
                size="medium"
                :min="1"
                :max="140"
                :step-strictly="true"
                :step="1"
                v-model="form.examsDuration"
                label="考试时长"
              ></el-input-number>
77ebf04d   梁保满   个人版
110
            </el-form-item>
b0cd2598   梁保满   fix:测试问题
111
112
113
114
115
            <el-form-item
              v-if="role != 'ROLE_PERSONAL'"
              label="分享范围:"
              prop="sharingType"
            >
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
116
117
118
119
120
              <el-radio-group v-model="form.sharingType">
                <el-radio :label="0">任课班级分享</el-radio>
                <el-radio :label="1">全年级分享</el-radio>
              </el-radio-group>
            </el-form-item>
77ebf04d   梁保满   个人版
121
122
          </el-form>
          <div class="btn-box">
b0cd2598   梁保满   fix:测试问题
123
124
125
126
127
128
129
130
131
            <el-button type="danger" plain round @click="linkBack"
              >取消</el-button
            >
            <el-button
              type="primary"
              round
              @click="isUpload ? setStep2() : setStep1()"
              >下一步</el-button
            >
77ebf04d   梁保满   个人版
132
          </div>
b0cd2598   梁保满   fix:测试问题
133
134
135
136
137
138
          <el-dialog
            :close-on-click-modal="false"
            title="设置测验类型"
            :visible.sync="dialogVisible"
            width="500px"
          >
77ebf04d   梁保满   个人版
139
140
141
            <div class="dia-content">
              <p class="add-type" v-for="item in tagList" :key="item.id">
                <el-row :gutter="10">
b0cd2598   梁保满   fix:测试问题
142
143
144
145
146
147
148
                  <el-col :span="18"
                    ><el-input
                      v-model="item.typeName"
                      :maxlength="10"
                      placeholder="请输入答题卡类型名称"
                    ></el-input
                  ></el-col>
77ebf04d   梁保满   个人版
149
150
                  <el-col :span="6">
                    <el-tooltip effect="dark" content="保存" placement="top">
b0cd2598   梁保满   fix:测试问题
151
152
153
154
155
156
157
158
159
                      <el-button
                        class="js-set"
                        type="primary"
                        size="small"
                        round
                        circle
                        icon="el-icon-check"
                        @click="editTypeName(item)"
                      ></el-button>
77ebf04d   梁保满   个人版
160
161
                    </el-tooltip>
                    <el-tooltip effect="dark" content="删除" placement="right">
b0cd2598   梁保满   fix:测试问题
162
163
164
165
166
167
168
169
170
171
172
173
174
                      <el-popconfirm
                        title="确定删除这道大题吗?"
                        @confirm="removeTypeName(item)"
                      >
                        <el-button
                          class="js-set"
                          type="danger"
                          size="small"
                          round
                          circle
                          icon="el-icon-delete"
                          slot="reference"
                        ></el-button>
77ebf04d   梁保满   个人版
175
176
177
178
179
180
181
182
                      </el-popconfirm>
                    </el-tooltip>
                  </el-col>
                </el-row>
              </p>
              <p class="add-type">
                <el-row :gutter="10">
                  <el-col :span="18">
b0cd2598   梁保满   fix:测试问题
183
184
185
186
187
188
                    <el-input
                      type="text"
                      placeholder="请输入答题卡类型名称"
                      v-model.trim="answerTypeName"
                      :maxlength="10"
                    >
77ebf04d   梁保满   个人版
189
190
191
192
                    </el-input>
                  </el-col>
                  <el-col :span="6">
                    <el-tooltip effect="dark" content="添加" placement="right">
b0cd2598   梁保满   fix:测试问题
193
194
195
196
197
198
199
200
201
                      <el-button
                        class="js-set"
                        type="primary"
                        size="small"
                        round
                        circle
                        icon="el-icon-plus"
                        @click="addPaperType"
                      ></el-button>
77ebf04d   梁保满   个人版
202
203
204
205
206
207
208
209
210
211
                    </el-tooltip>
                  </el-col>
                </el-row>
              </p>
            </div>
            <div class="" slot="footer">
              <el-button @click="dialogVisible = false">关 闭</el-button>
            </div>
          </el-dialog>
        </div>
352c53cc   梁保满   上传word回传数据
212
213
        <template v-if="!isUpload">
          <div v-show="step == 1">
b0cd2598   梁保满   fix:测试问题
214
215
216
217
218
            <div
              class="question-box"
              v-for="(question, index) in form.questionList"
              :key="index"
            >
352c53cc   梁保满   上传word回传数据
219
              <p class="question-title">
b0cd2598   梁保满   fix:测试问题
220
221
222
223
224
225
226
227
228
229
                <el-tooltip
                  effect="dark"
                  :content="question.show ? '收起' : '展开'"
                  placement="left"
                >
                  <i
                    class="el-icon-caret-right"
                    :class="question.show ? 'active' : ''"
                    @click="question.show = !question.show"
                  ></i>
352c53cc   梁保满   上传word回传数据
230
231
                </el-tooltip>
                <span>{{ setBigNum(index) }}、</span>
b0cd2598   梁保满   fix:测试问题
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
                <el-input
                  class="ipt"
                  v-model.trim="question.questionTitle"
                  maxlength="30"
                  placeholder="填写大题名称"
                ></el-input>
                <el-popconfirm
                  title="确定删除这道大题吗?"
                  @confirm="form.questionList.splice(index, 1)"
                >
                  <el-button
                    slot="reference"
                    class="delete"
                    type="danger"
                    size="mini"
                    circle
                    icon="el-icon-delete"
                  ></el-button>
352c53cc   梁保满   上传word回传数据
250
251
252
253
254
255
256
257
258
259
260
261
262
263
                </el-popconfirm>
                <span class="m20">共:{{ question.subQuestions?.length }}题</span>
                <span>共:{{ setScore(question) }}分</span>
              </p>
              <transition name="el-zoom-in-top">
                <ul v-show="question.show" class="questions-ul">
                  <li class="sub-questions">
                    <div class="qs-num">题号</div>
                    <div class="qs-type">题型</div>
                    <div class="qs-score">分数</div>
                    <div class="qs-partScore">漏选得分</div>
                    <div class="qs-options">选项设置</div>
                    <div class="qs-set">操作</div>
                  </li>
d4e9b596   梁保满   手动创建组卷 删除题目,批量设置显示问题
264
                  <template
b0cd2598   梁保满   fix:测试问题
265
                    v-for="(subQuestions, indexs) in question.subQuestions"
b0cd2598   梁保满   fix:测试问题
266
                  >
d4e9b596   梁保满   手动创建组卷 删除题目,批量设置显示问题
267
268
269
270
271
272
273
274
275
276
277
                    <li
                      v-if="!subQuestions.qusType && !subQuestions.subNum"
                      class="sub-questions"
                      :key="indexs"
                    >
                      <div class="qs-num">{{ setNum(index, indexs) }}</div>
                      <div class="qs-type">
                        <el-select
                          v-model="subQuestions.questionType"
                          placeholder="选择题目类型"
                          @change="changeSubQuestions($event, subQuestions)"
b0cd2598   梁保满   fix:测试问题
278
                        >
d4e9b596   梁保满   手动创建组卷 删除题目,批量设置显示问题
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
                          <el-option label="单选题" :value="2"></el-option>
                          <el-option label="多选题" :value="3"></el-option>
                          <el-option label="判断题" :value="4"></el-option>
                          <el-option label="主观题" :value="5"></el-option>
                        </el-select>
                      </div>
                      <div class="qs-score">
                        <el-input-number
                          class="number-ipt"
                          size="medium"
                          :min="1"
                          :max="200"
                          :precision="2"
                          :step="1"
                          v-model="subQuestions.score"
                          label="单题分值"
                        ></el-input-number>
                      </div>
                      <div class="qs-partScore">
                        <p v-if="subQuestions.questionType != 3">--</p>
                        <el-input-number
                          class="number-ipt"
                          v-else
                          size="medium"
                          :min="0"
                          :precision="2"
                          :max="subQuestions.score"
                          :step="0.5"
                          v-model="subQuestions.partScore"
                          label="漏选得分"
                        ></el-input-number>
                      </div>
                      <div class="qs-options">
                        <p v-if="subQuestions.questionType == 5">--</p>
                        <p
                          v-if="subQuestions.questionType == 4"
                          class="answer-box"
b0cd2598   梁保满   fix:测试问题
316
                        >
d4e9b596   梁保满   手动创建组卷 删除题目,批量设置显示问题
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
                          <span
                            class="answer-s"
                            :class="
                              subQuestions.correctAnswer == 1 ? 'active' : ''
                            "
                            @click="subQuestions.correctAnswer = 1"
                            >✓</span
                          >
                          <span
                            class="answer-s"
                            :class="
                              subQuestions.correctAnswer == 2 ? 'active' : ''
                            "
                            @click="subQuestions.correctAnswer = 2"
                            >✗</span
                          >
                        </p>
                        <p
                          v-if="subQuestions.questionType == 3"
                          class="answer-box"
b0cd2598   梁保满   fix:测试问题
337
                        >
d4e9b596   梁保满   手动创建组卷 删除题目,批量设置显示问题
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
                          <span
                            class="answer-s"
                            v-for="option in subQuestions.answerOptions.split(
                              ','
                            )"
                            :class="
                              subQuestions.correctAnswer?.includes(option)
                                ? 'active'
                                : ''
                            "
                            :key="option"
                            @click="changAnswer(subQuestions, option)"
                            >{{ option }}</span
                          >
                        </p>
                        <p
                          v-if="subQuestions.questionType == 2"
                          class="answer-box"
                        >
                          <span
                            class="answer-s"
                            v-for="option in subQuestions.answerOptions.split(
                              ','
                            )"
                            :class="
                              subQuestions.correctAnswer == option ? 'active' : ''
                            "
                            :key="option"
                            @click="subQuestions.correctAnswer = option"
                            >{{ option }}</span
                          >
                        </p>
                        <p
                          v-if="
                            subQuestions.questionType == 3 ||
                            subQuestions.questionType == 2
b0cd2598   梁保满   fix:测试问题
374
                          "
d4e9b596   梁保满   手动创建组卷 删除题目,批量设置显示问题
375
                          class="answer-box answer-box2"
b0cd2598   梁保满   fix:测试问题
376
                        >
d4e9b596   梁保满   手动创建组卷 删除题目,批量设置显示问题
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
                          <el-button
                            size="mini"
                            type="primary"
                            icon="el-icon-plus"
                            circle
                            @click="addOptions(subQuestions)"
                          ></el-button>
                          <el-button
                            size="mini"
                            type="primary"
                            icon="el-icon-minus"
                            round
                            circle
                            @click="removeOptions(subQuestions)"
                          ></el-button>
                        </p>
                      </div>
                      <div class="qs-set">
                        <el-popconfirm
                          title="确定删除这道题吗?"
                          @confirm="delTabData(indexs, index)"
                        >
                          <el-button
                            slot="reference"
                            class="delete"
                            type="danger"
                            size="mini"
                            circle
                            icon="el-icon-delete"
                          ></el-button>
                        </el-popconfirm>
                      </div>
                    </li>
                  </template>
352c53cc   梁保满   上传word回传数据
411
412
413
                  <li class="sub-questions">
                    <div class="qs-num">添加</div>
                    <div class="qs-type">
b0cd2598   梁保满   fix:测试问题
414
415
416
417
418
                      <el-select
                        v-model="addSubQuestionsType"
                        placeholder="选择题目类型"
                        @change="changeAddSubQuestions($event, question)"
                      >
352c53cc   梁保满   上传word回传数据
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
                        <el-option label="单选题" :value="2"></el-option>
                        <el-option label="多选题" :value="3"></el-option>
                        <el-option label="判断题" :value="4"></el-option>
                        <el-option label="主观题" :value="5"></el-option>
                      </el-select>
                    </div>
                    <div class="qs-score"></div>
                    <div class="qs-partScore"></div>
                    <div class="qs-options"></div>
                    <div class="qs-set"></div>
                  </li>
                </ul>
              </transition>
            </div>
            <div class="add-box">
              <p class="add-question" @click="openQuestion">
b0cd2598   梁保满   fix:测试问题
435
436
437
438
439
440
                <el-button
                  size="mini"
                  type="primary"
                  icon="el-icon-plus"
                  circle
                ></el-button>
352c53cc   梁保满   上传word回传数据
441
442
443
444
                <span class="s1">添加大题</span>
              </p>
            </div>
            <div class="btn-box">
b0cd2598   梁保满   fix:测试问题
445
446
447
              <el-button type="danger" plain round @click="linkBack"
                >取消</el-button
              >
352c53cc   梁保满   上传word回传数据
448
              <el-button round @click="step = 0">上一步</el-button>
b0cd2598   梁保满   fix:测试问题
449
450
451
452
453
454
              <el-button
                :type="form.questionList.length == 0 ? 'info' : 'primary'"
                round
                @click="setStep2"
                >下一步</el-button
              >
352c53cc   梁保满   上传word回传数据
455
            </div>
b0cd2598   梁保满   fix:测试问题
456
457
458
459
460
461
            <el-dialog
              :close-on-click-modal="false"
              title="添加大题"
              :visible.sync="addQuestionVisible"
              width="600px"
            >
352c53cc   梁保满   上传word回传数据
462
              <div class="dia-content">
b0cd2598   梁保满   fix:测试问题
463
464
465
466
467
468
                <el-form
                  ref="form"
                  :model="questionForm"
                  :rules="questionFormRules"
                  label-width="100px"
                >
352c53cc   梁保满   上传word回传数据
469
470
                  <el-form-item label="标题:">
                    <el-col :span="20">
b0cd2598   梁保满   fix:测试问题
471
472
473
474
475
                      <el-input
                        v-model.trim="questionForm.questionTitle"
                        maxlength="30"
                        placeholder="输入大题名称"
                      ></el-input>
352c53cc   梁保满   上传word回传数据
476
477
478
                    </el-col>
                  </el-form-item>
                  <el-form-item label="选择题型:">
b0cd2598   梁保满   fix:测试问题
479
480
481
482
483
484
485
486
487
488
489
                    <el-select
                      v-model="questionForm.questionType"
                      placeholder=""
                      @change="setQuestionForm"
                    >
                      <el-option
                        v-for="item in questionOptions"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      >
352c53cc   梁保满   上传word回传数据
490
491
                      </el-option>
                      <el-option label="混合题" :value="6"> </el-option>
77ebf04d   梁保满   个人版
492
                    </el-select>
352c53cc   梁保满   上传word回传数据
493
494
                  </el-form-item>
                  <el-form-item label="题数:">
b0cd2598   梁保满   fix:测试问题
495
496
497
498
499
500
501
502
503
                    <el-input-number
                      v-model="questionForm.number"
                      @change="changeQesNum"
                      :min="1"
                      :max="100"
                      :step-strictly="true"
                      :step="1"
                      label="label"
                    ></el-input-number>
352c53cc   梁保满   上传word回传数据
504
                  </el-form-item>
b0cd2598   梁保满   fix:测试问题
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
                  <el-form-item
                    label="选项个数:"
                    v-show="
                      questionForm.questionType != 4 &&
                      questionForm.questionType != 5
                    "
                  >
                    <el-input-number
                      v-model="questionForm.selectNum"
                      :min="3"
                      :max="10"
                      :step-strictly="true"
                      :step="1"
                      label="label"
                    ></el-input-number>
352c53cc   梁保满   上传word回传数据
520
521
                  </el-form-item>
                  <el-form-item label="单题分数:">
b0cd2598   梁保满   fix:测试问题
522
523
524
525
526
527
528
529
                    <el-input-number
                      v-model="questionForm.score"
                      :min="1"
                      :max="200"
                      :precision="2"
                      :step="1"
                      label="label"
                    ></el-input-number>
352c53cc   梁保满   上传word回传数据
530
                  </el-form-item>
b0cd2598   梁保满   fix:测试问题
531
532
533
534
535
536
537
538
539
540
541
542
                  <el-form-item
                    label="漏选得分:"
                    v-if="questionForm.questionType == 3"
                  >
                    <el-input-number
                      v-model="questionForm.partScore"
                      :min="0"
                      :max="questionForm.score"
                      :precision="2"
                      :step="0.5"
                      label="label"
                    ></el-input-number>
352c53cc   梁保满   上传word回传数据
543
                  </el-form-item>
b0cd2598   梁保满   fix:测试问题
544
545
546
547
548
549
550
                  <el-form-item
                    label="设置答案:"
                    v-show="
                      questionForm.questionType != 5 &&
                      questionForm.questionType != 6
                    "
                  >
352c53cc   梁保满   上传word回传数据
551
552
                    <div class="qs-options">
                      <p class="ipt">
b0cd2598   梁保满   fix:测试问题
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
                        <el-input
                          v-if="
                            questionForm.questionType == 2 ||
                            questionForm.questionType == 3 ||
                            questionForm.questionType == 6
                          "
                          ref="formAnsIpt2"
                          v-model="questionForm.answerList"
                          @keydown.native="
                            keydownAnswer($event, questionForm.questionType, 1)
                          "
                          @input="
                            setAllAnswer($event, questionForm.questionType, 1)
                          "
                        ></el-input>
                        <el-input
                          v-if="questionForm.questionType == 4"
                          v-model="questionForm.answerList"
                          readonly=""
                        ></el-input>
352c53cc   梁保满   上传word回传数据
573
574
575
                      </p>
                      <p class="answer-box">
                        <template v-if="questionForm.questionType == 4">
b0cd2598   梁保满   fix:测试问题
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
                          <span
                            class="answer-s active"
                            @click="
                              questionForm.answerList.length < questionForm.number
                                ? (questionForm.answerList += '✓')
                                : ''
                            "
                            >✓</span
                          >
                          <span
                            class="answer-s active"
                            @click="
                              questionForm.answerList.length < questionForm.number
                                ? (questionForm.answerList += '✗')
                                : ''
                            "
                            >✗</span
                          >
352c53cc   梁保满   上传word回传数据
594
595
596
                        </template>
                        <template v-if="questionForm.questionType == 3">
                          <template v-for="(option, opIdx) in rightOptions">
b0cd2598   梁保满   fix:测试问题
597
598
599
600
601
602
603
                            <span
                              v-if="opIdx < questionForm.selectNum"
                              class="answer-s active"
                              :key="option"
                              @click="setMultiple(questionForm, option, 1)"
                              >{{ option }}</span
                            >
352c53cc   梁保满   上传word回传数据
604
                          </template>
b0cd2598   梁保满   fix:测试问题
605
606
607
608
609
                          <span
                            class="answer-s active"
                            @click="setMultiple(questionForm, ',', 1)"
                            >,</span
                          >
77ebf04d   梁保满   个人版
610
                        </template>
b0cd2598   梁保满   fix:测试问题
611
612
613
614
615
616
                        <template
                          v-if="
                            questionForm.questionType == 2 ||
                            questionForm.questionType == 6
                          "
                        >
352c53cc   梁保满   上传word回传数据
617
                          <template v-for="(option, opIdx) in rightOptions">
b0cd2598   梁保满   fix:测试问题
618
619
620
621
622
623
624
625
626
627
628
629
                            <span
                              v-if="opIdx < questionForm.selectNum"
                              class="answer-s active"
                              :key="option"
                              @click="
                                questionForm.answerList.length <
                                questionForm.number
                                  ? (questionForm.answerList += option)
                                  : ''
                              "
                              >{{ option }}</span
                            >
352c53cc   梁保满   上传word回传数据
630
                          </template>
77ebf04d   梁保满   个人版
631
                        </template>
b0cd2598   梁保满   fix:测试问题
632
633
634
635
636
637
638
639
640
641
642
643
644
                        <span
                          class="answer-s delButton"
                          @click="
                            questionForm.answerList =
                              questionForm.answerList.slice(0, -1)
                          "
                          >x</span
                        >
                        <span
                          class="answer-s ac"
                          @click="questionForm.answerList = ''"
                          >ac</span
                        >
352c53cc   梁保满   上传word回传数据
645
646
647
648
649
650
651
652
653
654
655
656
                      </p>
                    </div>
                  </el-form-item>
                </el-form>
              </div>
              <div class="dialog-footer" slot="footer">
                <el-button type="primary" @click="addQuestion">确 定</el-button>
                <el-button @click="addQuestionVisible = false">取 消</el-button>
              </div>
            </el-dialog>
          </div>
        </template>
77ebf04d   梁保满   个人版
657
658
659
660
661
        <div v-show="step == 2">
          <div class="answer-title">
            <p class="name">{{ form.title }}</p>
            <p class="totals">卷面总分:{{ allScore }}分</p>
          </div>
b0cd2598   梁保满   fix:测试问题
662
663
664
665
666
          <div
            class="question-box"
            v-for="(question, index) in form.questionList"
            :key="index"
          >
77ebf04d   梁保满   个人版
667
668
669
670
671
            <p class="question-title">
              <span>{{ setBigNum(index) }}、</span>
              <span class="title-txt">{{ question.questionTitle }}</span>
              <span class="m20">共:{{ setNums(question.subQuestions) }}题</span>
              <span>共:{{ setScore(question) }} 分</span>
b0cd2598   梁保满   fix:测试问题
672
673
674
675
676
677
678
679
680
681
682
683
              <el-popconfirm
                title="确定删除这道大题吗?"
                @confirm="form.questionList.splice(index, 1)"
              >
                <el-button
                  slot="reference"
                  class="delete"
                  type="danger"
                  size="mini"
                  circle
                  icon="el-icon-delete"
                ></el-button>
77da338a   梁保满   自测问题修改
684
              </el-popconfirm>
77ebf04d   梁保满   个人版
685
686
687
688
689
690
691
692
            </p>
            <ul class="questions-ul">
              <li class="sub-questions">
                <div class="qs-num">题号</div>
                <div class="qs-type">题型</div>
                <div class="qs-score">分数</div>
                <div class="qs-partScore">漏选得分</div>
                <div class="qs-options qs-options2">选项设置</div>
b248db27   梁保满   课件模版区分,错别字修改,录分成功...
693
                <div class="qs-upload" v-if="isUpload">题干</div>
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
694
695
                <div class="qs-upload" v-if="isUpload">题目解析</div>
                <div class="qs-upload" v-if="isUpload">知识点</div>
8af7657f   梁保满   修改添加备题,组卷
696
                <div class="qs-set">操作</div>
77ebf04d   梁保满   个人版
697
              </li>
b0cd2598   梁保满   fix:测试问题
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
              <li
                v-for="(subQuestions, indexs) in question.subQuestions"
                :key="indexs"
              >
                <p
                  class="set-ans-btn"
                  v-if="
                    subQuestions.qusType &&
                    subQuestions.subNum &&
                    subQuestions.subNum > 4
                  "
                >
                  <el-button type="primary" @click="setFormAns(indexs, index)"
                    >批量设置答案</el-button
                  >
77ebf04d   梁保满   个人版
713
714
715
716
717
718
                </p>
                <div v-else class="sub-questions">
                  <div class="qs-num">
                    {{ setNum(index, indexs, subQuestions) }}
                  </div>
                  <div class="qs-type">
8af7657f   梁保满   修改添加备题,组卷
719
                    <template v-if="isUpload">
b0cd2598   梁保满   fix:测试问题
720
721
722
723
724
725
726
727
728
729
730
                      <el-select
                        v-model="subQuestions.questionType"
                        placeholder="选择题目类型"
                        @change="changeSubQuestions($event, subQuestions)"
                      >
                        <el-option
                          v-for="options in questionOptions"
                          :key="options.value"
                          :label="options.label"
                          :value="options.value"
                        ></el-option>
8af7657f   梁保满   修改添加备题,组卷
731
732
733
734
735
                      </el-select>
                    </template>
                    <template v-else>
                      {{ setSubPro(subQuestions.questionType) }}
                    </template>
77ebf04d   梁保满   个人版
736
737
                  </div>
                  <div class="qs-score">
b0cd2598   梁保满   fix:测试问题
738
739
740
741
742
743
744
745
746
                    <el-input-number
                      class="number-ipt"
                      size="medium"
                      :min="1"
                      :max="200"
                      :precision="2"
                      v-model="subQuestions.score"
                      label="单题分值"
                    ></el-input-number>
77ebf04d   梁保满   个人版
747
748
749
                  </div>
                  <div class="qs-partScore">
                    <p v-if="subQuestions.questionType != 3">--</p>
b0cd2598   梁保满   fix:测试问题
750
751
752
753
754
755
756
757
758
759
760
                    <el-input-number
                      class="number-ipt"
                      v-else
                      size="medium"
                      :min="0"
                      :precision="2"
                      :max="subQuestions.score"
                      :step="0.5"
                      v-model="subQuestions.partScore"
                      label="漏选得分"
                    ></el-input-number>
77ebf04d   梁保满   个人版
761
762
763
764
                  </div>
                  <div class="qs-options qs-options2">
                    <p v-if="subQuestions.questionType == 5">--</p>
                    <p v-if="subQuestions.questionType == 4" class="answer-box">
b0cd2598   梁保满   fix:测试问题
765
766
767
768
769
770
771
772
773
774
775
776
                      <span
                        class="answer-s"
                        :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
                        @click="subQuestions.correctAnswer = 1"
                        >✓</span
                      >
                      <span
                        class="answer-s"
                        :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
                        @click="subQuestions.correctAnswer = 2"
                        >✗</span
                      >
77ebf04d   梁保满   个人版
777
778
                    </p>
                    <p v-if="subQuestions.questionType == 3" class="answer-box">
b0cd2598   梁保满   fix:测试问题
779
780
781
782
783
784
785
786
787
788
789
790
                      <span
                        class="answer-s"
                        v-for="option in subQuestions.answerOptions.split(',')"
                        :class="
                          subQuestions.correctAnswer?.includes(option)
                            ? 'active'
                            : ''
                        "
                        :key="option"
                        @click="changAnswer(subQuestions, option)"
                        >{{ option }}</span
                      >
77ebf04d   梁保满   个人版
791
792
                    </p>
                    <p v-if="subQuestions.questionType == 2" class="answer-box">
b0cd2598   梁保满   fix:测试问题
793
794
795
796
797
798
799
800
801
802
                      <span
                        class="answer-s"
                        v-for="option in subQuestions.answerOptions.split(',')"
                        :class="
                          subQuestions.correctAnswer == option ? 'active' : ''
                        "
                        :key="option"
                        @click="subQuestions.correctAnswer = option"
                        >{{ option }}</span
                      >
77ebf04d   梁保满   个人版
803
                    </p>
b0cd2598   梁保满   fix:测试问题
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
                    <p
                      v-if="
                        subQuestions.questionType == 3 ||
                        subQuestions.questionType == 2
                      "
                      class="answer-box answer-box2"
                    >
                      <el-button
                        size="mini"
                        type="primary"
                        icon="el-icon-plus"
                        circle
                        @click="addOptions(subQuestions)"
                      ></el-button>
                      <el-button
                        size="mini"
                        type="primary"
                        icon="el-icon-minus"
                        round
                        circle
                        @click="removeOptions(subQuestions)"
                      ></el-button>
ce278878   梁保满   2-2 bugfix
826
                    </p>
77ebf04d   梁保满   个人版
827
                  </div>
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
828
829
                  <template v-if="isUpload">
                    <div class="qs-upload">
ddcd75d7   梁保满   教师二次管理数据问题
830
831
832
833
834
835
836
837
838
                      <el-button
                        slot="reference"
                        class="icon-tickets"
                        type="primary"
                        circle
                        size="mini"
                        icon="el-icon-tickets"
                        @click="openStem(subQuestions, index, indexs, 1)"
                      ></el-button>
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
839
840
                    </div>
                    <div class="qs-upload">
ddcd75d7   梁保满   教师二次管理数据问题
841
842
843
844
845
846
847
848
849
                      <el-button
                        slot="reference"
                        class="icon-tickets"
                        type="primary"
                        circle
                        size="mini"
                        icon="el-icon-tickets"
                        @click="openStem(subQuestions, index, indexs, 2)"
                      ></el-button>
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
850
851
                    </div>
                    <div class="qs-upload">
b0cd2598   梁保满   fix:测试问题
852
853
854
855
856
857
858
                      <el-button
                        type="primary"
                        circle
                        size="mini"
                        icon="el-icon-price-tag"
                        @click="openKnowledge(subQuestions, index, indexs)"
                      ></el-button>
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
859
860
                    </div>
                  </template>
8af7657f   梁保满   修改添加备题,组卷
861
                  <div class="qs-set">
b0cd2598   梁保满   fix:测试问题
862
863
864
865
866
867
868
869
870
871
872
873
                    <el-popconfirm
                      title="确定删除这道题吗?"
                      @confirm="delTabData(indexs, index)"
                    >
                      <el-button
                        slot="reference"
                        class="delete"
                        type="danger"
                        size="mini"
                        circle
                        icon="el-icon-delete"
                      ></el-button>
8af7657f   梁保满   修改添加备题,组卷
874
875
                    </el-popconfirm>
                  </div>
77ebf04d   梁保满   个人版
876
877
878
879
                </div>
              </li>
            </ul>
          </div>
b0cd2598   梁保满   fix:测试问题
880
881
882
883
884
885
886
          <el-dialog
            :close-on-click-modal="false"
            title="批量设置答案"
            :visible.sync="diaSetAns"
            width="400"
            :modal-append-to-body="false"
          >
77ebf04d   梁保满   个人版
887
888
889
890
891
892
            <div class="qs-options">
              <p class="dia-tips">
                请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
              </p>
              <p>{{ setSubPro(formAns.qusType) }}:</p>
              <p class="ipt">
b0cd2598   梁保满   fix:测试问题
893
894
895
896
                <el-input
                  v-if="formAns.qusType == 2 || formAns.qusType == 3"
                  ref="formAnsIpt"
                  v-model="formAns.answerList"
77ebf04d   梁保满   个人版
897
                  @keydown.native="keydownAnswer($event, formAns.qusType)"
b0cd2598   梁保满   fix:测试问题
898
899
900
901
902
903
904
                  @input="setAllAnswer($event, formAns.qusType)"
                ></el-input>
                <el-input
                  v-if="formAns.qusType == 4"
                  v-model="formAns.answerList"
                  readonly=""
                ></el-input>
77ebf04d   梁保满   个人版
905
906
907
              </p>
              <p class="answer-box">
                <template v-if="formAns.qusType == 4">
b0cd2598   梁保满   fix:测试问题
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
                  <span
                    class="answer-s active"
                    @click="
                      formAns.answerList.length < formAns.subNum
                        ? (formAns.answerList += '✓')
                        : ''
                    "
                    >✓</span
                  >
                  <span
                    class="answer-s active"
                    @click="
                      formAns.answerList.length < formAns.subNum
                        ? (formAns.answerList += '✗')
                        : ''
                    "
                    >✗</span
                  >
77ebf04d   梁保满   个人版
926
927
                </template>
                <template v-if="formAns.qusType == 3">
b0cd2598   梁保满   fix:测试问题
928
929
930
931
932
933
934
935
936
937
938
939
                  <span
                    class="answer-s active"
                    v-for="option in formAns.answerOptions.split(',')"
                    :key="option"
                    @click="setMultiple(formAns, option, 2)"
                    >{{ option }}</span
                  >
                  <span
                    class="answer-s active"
                    @click="setMultiple(formAns, ',', 2)"
                    >,</span
                  >
77ebf04d   梁保满   个人版
940
941
                </template>
                <template v-if="formAns.qusType == 2">
b0cd2598   梁保满   fix:测试问题
942
943
944
945
946
947
948
949
950
951
952
                  <span
                    class="answer-s active"
                    v-for="option in formAns.answerOptions.split(',')"
                    :key="option"
                    @click="
                      formAns.answerList.length < formAns.subNum
                        ? (formAns.answerList += option)
                        : ''
                    "
                    >{{ option }}</span
                  >
77ebf04d   梁保满   个人版
953
                </template>
b0cd2598   梁保满   fix:测试问题
954
955
956
957
958
959
960
961
                <span
                  class="answer-s delButton"
                  @click="formAns.answerList = formAns.answerList.slice(0, -1)"
                  >x</span
                >
                <span class="answer-s ac" @click="formAns.answerList = ''"
                  >ac</span
                >
77ebf04d   梁保满   个人版
962
963
964
965
966
967
968
969
              </p>
            </div>
            <div class="dialog-footer" slot="footer">
              <el-button @click="saveFormAns">确 定</el-button>
              <el-button @click="diaSetAns = false">取 消</el-button>
            </div>
          </el-dialog>
          <div class="btn-box">
b0cd2598   梁保满   fix:测试问题
970
971
972
            <el-button type="danger" plain round @click="linkBack"
              >取消</el-button
            >
8af7657f   梁保满   修改添加备题,组卷
973
974
975
976
977
978
            <template v-if="!isUpload">
              <el-button round @click="toStep(1)">上一步</el-button>
              <el-button type="primary" round @click="save">保存</el-button>
            </template>
            <template v-else>
              <el-button round @click="step = 0">上一步</el-button>
b0cd2598   梁保满   fix:测试问题
979
980
981
              <el-button type="primary" round @click="toStep(3)"
                >下一步</el-button
              >
8af7657f   梁保满   修改添加备题,组卷
982
983
984
985
986
987
            </template>
          </div>
        </div>
        <div v-show="step == 3">
          <div class="answer-title">
            <p class="name">{{ form.title }}</p>
b248db27   梁保满   课件模版区分,错别字修改,录分成功...
988
            <p class="totals">卷面总分:{{ allScore }}分</p>
8af7657f   梁保满   修改添加备题,组卷
989
990
991
          </div>
          <div class="question-box">
            <template v-for="(question, index) in form.questionList">
b248db27   梁保满   课件模版区分,错别字修改,录分成功...
992
993
994
995
996
997
998
999
              <p class="question-title">
                <span>{{ setBigNum(index) }}、</span>
                <span class="title-txt">{{ question.questionTitle }}</span>
                <span class="m20"
                  >共:{{ setNums(question.subQuestions) }}题</span
                >
                <span>共:{{ setScore(question) }} 分</span>
              </p>
98dec083   梁保满   复制试卷问题,题干列表样式,题目解...
1000
1001
1002
              <div v-for="(subQuestions, indexs) in question.subQuestions">
                <div
                  class="screenshot-box"
b0cd2598   梁保满   fix:测试问题
1003
                  v-if="subQuestions.screenshot"
98dec083   梁保满   复制试卷问题,题干列表样式,题目解...
1004
1005
1006
1007
1008
1009
1010
                  :key="index + '-' + indexs"
                >
                  <iframe
                    class="screenshot"
                    :src="subQuestions.screenshot"
                  ></iframe>
                </div>
8af7657f   梁保满   修改添加备题,组卷
1011
1012
1013
1014
              </div>
            </template>
          </div>
          <div class="btn-box">
b0cd2598   梁保满   fix:测试问题
1015
1016
1017
            <el-button type="danger" plain round @click="linkBack"
              >取消</el-button
            >
8af7657f   梁保满   修改添加备题,组卷
1018
            <el-button round @click="toStep(2)">上一步</el-button>
77ebf04d   梁保满   个人版
1019
1020
1021
            <el-button type="primary" round @click="save">保存</el-button>
          </div>
        </div>
b0cd2598   梁保满   fix:测试问题
1022
1023
1024
1025
1026
        <el-dialog
          :close-on-click-modal="false"
          :title="stem.type == 1 ? '上传题干' : '上传题目解析'"
          :visible.sync="dialogStem"
          v-if="dialogStem"
df616627   梁保满   添加修改试卷 题目解析样式问题
1027
          width="800px"
b0cd2598   梁保满   fix:测试问题
1028
        >
352c53cc   梁保满   上传word回传数据
1029
          <div class="upload-box">
ddcd75d7   梁保满   教师二次管理数据问题
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
            <div v-loading="iframeLoading">
              <template v-if="stem.type == 1">
                <iframe
                  ref="screenshot"
                  class="screenshot"
                  v-if="stem.screenshot"
                  :src="stem.screenshot"
                  @load="iframeLoading = false"
                ></iframe>
              </template>
              <template v-else="stem.type == 2">
                <iframe
                  ref="screenshot"
                  class="screenshot"
                  v-if="stem.answerScreenshot"
                  :src="stem.answerScreenshot"
                  @load="iframeLoading = false"
                ></iframe>
              </template>
            </div>
b0cd2598   梁保满   fix:测试问题
1050
1051
1052
1053
1054
1055
1056
1057
            <el-upload
              class="upload-demo"
              :action="uploadUrl"
              :limit="1"
              :on-success="upSuccess"
              :on-error="upError"
              accept="image/*"
            >
ce278878   梁保满   2-2 bugfix
1058
              <el-button size="small" type="primary">选择照片</el-button>
352c53cc   梁保满   上传word回传数据
1059
1060
1061
            </el-upload>
          </div>
          <div slot="footer">
8af7657f   梁保满   修改添加备题,组卷
1062
            <el-button @click="dialogStem = false">确定</el-button>
352c53cc   梁保满   上传word回传数据
1063
1064
          </div>
        </el-dialog>
b0cd2598   梁保满   fix:测试问题
1065
1066
1067
1068
        <el-dialog
          :close-on-click-modal="false"
          title="知识点"
          :visible.sync="dialogKnowledge"
df616627   梁保满   添加修改试卷 题目解析样式问题
1069
          width="500px"
b0cd2598   梁保满   fix:测试问题
1070
        >
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1071
1072
1073
          <div>
            <el-form ref="form" :model="stem" label-width="160px">
              <el-form-item label="知识点:">
b0cd2598   梁保满   fix:测试问题
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
                <el-cascader
                  size="small"
                  filterable
                  :show-all-levels="false"
                  collapse
                  clearable
                  placeholder="选择知识点"
                  v-model="stem.knowledge"
                  :options="knowledgeData"
                  :props="{ expandTrigger: 'hover', multiple: true }"
                ></el-cascader>
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1085
1086
1087
1088
1089
1090
1091
1092
              </el-form-item>
            </el-form>
          </div>
          <div slot="footer">
            <el-button @click="dialogKnowledge = false">取 消</el-button>
            <el-button type="primary" @click="setKnowledge">确 定</el-button>
          </div>
        </el-dialog>
77ebf04d   梁保满   个人版
1093
1094
1095
1096
1097
      </div>
    </div>
  </template>
  
  <script>
8af7657f   梁保满   修改添加备题,组卷
1098
  import { deepClone, checkAnswer, cNum } from "utils";
77ebf04d   梁保满   个人版
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
  const questionForm = {
    questionTitle: "",
    questionType: 2,
    number: 10,
    selectNum: 4,
    score: 1,
    partScore: 0,
    answerList: "",
  };
  const subQuesOptions = {
    questionType: 2,
    score: 1,
    partScore: 0,
    selectNum: 4,
    answerOptions: "A,B,C,D",
    correctAnswer: "",
  };
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1116
  import knowledgeList from "assets/js/knowledgeList.js";
77ebf04d   梁保满   个人版
1117
1118
1119
1120
1121
  export default {
    computed: {
      allScore: function () {
        let score = 0;
        this.form.questionList.map((item) => {
352c53cc   梁保满   上传word回传数据
1122
          score += item.subQuestions?.reduce((a, b) => {
77ebf04d   梁保满   个人版
1123
1124
1125
1126
1127
            return a + Number(b.score ? b.score : 0);
          }, 0);
        }, 0);
        return Number(score).toFixed(2);
      },
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1128
1129
      // 知识点列表 根据学段-科目筛选
      knowledgeData: function () {
b0cd2598   梁保满   fix:测试问题
1130
        let jsons = [];
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1131
        if (this.form.gradeName && this.form.subjectName) {
b0cd2598   梁保满   fix:测试问题
1132
1133
          let sectionName = "";
          this.gradeClassList.map((item) => {
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1134
            if (this.form.gradeName == item.gradeName) {
b0cd2598   梁保满   fix:测试问题
1135
              sectionName = item.sectionName;
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1136
            }
b0cd2598   梁保满   fix:测试问题
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
          });
          if (
            sectionName &&
            Object.keys(this.knowledgeList).includes(sectionName)
          ) {
            if (
              Object.keys(this.knowledgeList[sectionName]).includes(
                this.form.subjectName
              )
            ) {
              jsons = this.knowledgeList[sectionName][this.form.subjectName];
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1148
1149
1150
            }
          }
        }
b0cd2598   梁保满   fix:测试问题
1151
        return jsons;
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1152
      },
77ebf04d   梁保满   个人版
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
    },
    watch: {
      step: function () {
        this.$nextTick(function () {
          this.$refs.content.scrollTop = 0;
        });
      },
    },
    data() {
      return {
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1163
1164
        role: "",
        step: 0, //步骤
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1165
        gradeClassList: [], //年级-班级数据
77ebf04d   梁保满   个人版
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
        gradeList: [], //年级
        subjectList: [], //科目
        answerTypeList: [], //测验类型
        answerTypeName: "", //测验类型名称
        form: {
          //答题卡详情
          title: "",
          tagId: "",
          subjectName: "",
          examsDuration: 90,
          questionList: [],
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1177
1178
          gradeName: "",
          sharingType: 0,
77ebf04d   梁保满   个人版
1179
1180
1181
1182
1183
1184
1185
        },
        formRules: {
          //答题卡验证
          title: [
            { required: true, message: "请输入答题卡名称", trigger: "blur" },
            {
              min: 1,
23659274   梁保满   备题接口对接
1186
1187
              max: 50,
              message: "长度在 1 到 50 个字符",
77ebf04d   梁保满   个人版
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
              trigger: "blur",
            },
          ],
          subjectName: [
            { required: true, message: "请选择科目", trigger: "blur" },
          ],
          examsDuration: [
            { required: true, message: "请设置考试时长", trigger: "blur" },
          ],
        },
        tagList: [],
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1199
        diaSetAns: false, //答案开关
77ebf04d   梁保满   个人版
1200
1201
1202
1203
1204
1205
1206
1207
1208
        formAns: {
          listIndex: 0, //大题位置
          endIndex: 0, //相同题目最后一位题目的questionIndex
          index: 0, //相同题目最后一位题目的位置
          qusType: "", //题目类型
          subNum: 0, //数量
          answerOptions: [], //答案选项
          answerList: "", //答案列表-字符串
        },
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
        type: 1, //1-创建,2-复制答题卡
        dialogVisible: false, //测验类型设置弹窗
        addQuestionVisible: false, //添加大题弹窗
        questionForm: { ...questionForm },
        questionFormRules: {
          questionTitle: [
            { required: true, message: "请输入大题名称", trigger: "blur" },
            {
              min: 1,
              max: 30,
              message: "长度在 1 到 30 个字符",
              trigger: "blur",
            },
          ],
        },
        questionOptions: [
          { label: "单选题", value: 2 },
          { label: "多选题", value: 3 },
          { label: "判断题", value: 4 },
          { label: "主观题", value: 5 },
        ],
ec6394d1   梁保满   v1.3.1。细节调整
1230
        rightOptions: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"],
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1231
        addSubQuestionsType: "",
352c53cc   梁保满   上传word回传数据
1232
1233
  
        //v1.5
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1234
        knowledgeList: { ...knowledgeList },
352c53cc   梁保满   上传word回传数据
1235
1236
        isUpload: false,
        dialogStem: false, //截图开关
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1237
        dialogKnowledge: false, //知识点开关
352c53cc   梁保满   上传word回传数据
1238
        stem: {
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1239
          type: 1,
352c53cc   梁保满   上传word回传数据
1240
1241
1242
          index: 0, //大题位置
          indexs: 0, //小题位置
          screenshot: "", //题干图片地址
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1243
1244
          answerScreenshot: "", //题目解析图片地址
          knowledge: [], //知识点
352c53cc   梁保满   上传word回传数据
1245
        },
77da338a   梁保满   自测问题修改
1246
1247
1248
1249
  
        //返回列表页参数记录
        listType: 1,
        listShare: 0,
b0cd2598   梁保满   fix:测试问题
1250
        uploadUrl: "/file/uploadImgToHtml",
ddcd75d7   梁保满   教师二次管理数据问题
1251
        iframeLoading: false,
77ebf04d   梁保满   个人版
1252
1253
1254
      };
    },
    async created() {
77da338a   梁保满   自测问题修改
1255
      this.listType = this.$route.query.listType ? this.$route.query.listType : 1;
b0cd2598   梁保满   fix:测试问题
1256
1257
1258
      this.listShare = this.$route.query.listShare
        ? this.$route.query.listShare
        : 0;
77ebf04d   梁保满   个人版
1259
      this.type = this.$route.query.type ? this.$route.query.type : 1;
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1260
1261
1262
1263
1264
1265
1266
1267
1268
      this.role =
        this.$store.getters.info.showRole ||
        this.$store.getters.info.permissions[0].role;
      if (this.role != "ROLE_PERSONAL") {
        this.formRules.gradeName = [
          { required: true, message: "请选择年级", trigger: "blur" },
        ];
        await this._GradeList();
      }
b0cd2598   梁保满   fix:测试问题
1269
      this.isUpload = this.$route.query.isUpload || false;
352c53cc   梁保满   上传word回传数据
1270
      if (this.isUpload) {
b0cd2598   梁保满   fix:测试问题
1271
1272
1273
1274
1275
1276
1277
1278
        let params =
          (this.$route.query.params && JSON.parse(this.$route.query.params)) ||
          null;
        this.form.title = params?.name;
        this.form.id = params?.id;
        this.form.examsDuration = params?.examsDuration || 90;
        this.form.sharingType = params?.sharingType || 0;
        this.formatData(params);
352c53cc   梁保满   上传word回传数据
1279
      }
77ebf04d   梁保满   个人版
1280
1281
1282
1283
1284
1285
1286
      await this._QuerySubjectList(this.gradeList[0]);
      await this._TypeList();
      if (this.type == 2) {
        this._QueryDetail();
      }
    },
    methods: {
352c53cc   梁保满   上传word回传数据
1287
1288
      // v1.5
      //上传截图
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1289
      openStem(obj, index, indexs, type) {
ddcd75d7   梁保满   教师二次管理数据问题
1290
        this.iframeLoading = true;
352c53cc   梁保满   上传word回传数据
1291
1292
        this.stem.index = index;
        this.stem.indexs = indexs;
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1293
1294
        this.stem.type = type;
        if (type == 1) {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
1295
          if (!obj.screenshot || obj.screenshot == "") {
ddcd75d7   梁保满   教师二次管理数据问题
1296
1297
            this.iframeLoading = false;
          }
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1298
1299
1300
          this.stem.screenshot = obj.screenshot || "";
          this.stem.answerScreenshot = "";
        } else {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
1301
          if (!obj.answerScreenshot || obj.answerScreenshot == "") {
ddcd75d7   梁保满   教师二次管理数据问题
1302
1303
            this.iframeLoading = false;
          }
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1304
1305
1306
1307
          this.stem.answerScreenshot = obj.answerScreenshot || "";
          this.stem.screenshot = "";
        }
  
352c53cc   梁保满   上传word回传数据
1308
1309
        this.dialogStem = true;
      },
cb6ceaa8   梁保满   添加备题,组卷参数调整
1310
  
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1311
1312
      // 图片上传成功
      upSuccess(res) {
352c53cc   梁保满   上传word回传数据
1313
        if (res && res.status == 0) {
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1314
1315
          if (this.stem.type == 1) {
            this.stem.screenshot = res.data.url;
b0cd2598   梁保满   fix:测试问题
1316
1317
1318
            this.form.questionList[this.stem.index].subQuestions[
              this.stem.indexs
            ].screenshot = this.stem.screenshot;
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1319
1320
          } else {
            this.stem.answerScreenshot = res.data.url;
b0cd2598   梁保满   fix:测试问题
1321
1322
1323
            this.form.questionList[this.stem.index].subQuestions[
              this.stem.indexs
            ].answerScreenshot = this.stem.answerScreenshot;
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1324
          }
352c53cc   梁保满   上传word回传数据
1325
1326
1327
1328
1329
          this.$message.success("上传成功");
        } else {
          this.$message.error(res.info);
        }
      },
352c53cc   梁保满   上传word回传数据
1330
1331
1332
      upError(res) {
        this.$message.error("上传失败");
      },
cb6ceaa8   梁保满   添加备题,组卷参数调整
1333
1334
1335
1336
      // 打开知识点
      openKnowledge(obj, index, indexs) {
        this.stem.index = index;
        this.stem.indexs = indexs;
384a2a54   梁保满   请求头添加班主任信息,bug修改
1337
        this.stem.knowledge = (obj.knowledge && obj.knowledge.split("#")) || [];
cb6ceaa8   梁保满   添加备题,组卷参数调整
1338
1339
1340
        this.dialogKnowledge = true;
      },
      // 选择知识点
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1341
      setKnowledge() {
b0cd2598   梁保满   fix:测试问题
1342
1343
1344
        this.form.questionList[this.stem.index].subQuestions[
          this.stem.indexs
        ].knowledge = this.stem.knowledge.join("#");
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
1345
1346
        this.dialogKnowledge = false;
      },
352c53cc   梁保满   上传word回传数据
1347
1348
      //end
  
8af7657f   梁保满   修改添加备题,组卷
1349
      //取消创建
77ebf04d   梁保满   个人版
1350
1351
1352
      linkBack() {
        this.$confirm(
          (this.type == 2 ? "修改复制的" : "组建的") +
b0cd2598   梁保满   fix:测试问题
1353
            "答题卡未保存,确认退出吗?",
77ebf04d   梁保满   个人版
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
          "提示",
          {
            confirmButtonText: "取消",
            cancelButtonText: "确定",
            confirmButtonClass: "el-button--danger1",
            cancelButtonClass: "el-button--primary",
            showClose: false,
            roundButton: true,
            center: true,
            type: "warning",
          }
        )
b0cd2598   梁保满   fix:测试问题
1366
          .then(() => {})
77ebf04d   梁保满   个人版
1367
1368
1369
          .catch(() => {
            this.$router.push({
              path: "/examinationPaper",
384a2a54   梁保满   请求头添加班主任信息,bug修改
1370
1371
1372
              query: {
                type: this.listType,
                share: this.listShare,
b0cd2598   梁保满   fix:测试问题
1373
              },
77ebf04d   梁保满   个人版
1374
1375
1376
            });
          });
      },
8af7657f   梁保满   修改添加备题,组卷
1377
      //转换题型显示方式
77ebf04d   梁保满   个人版
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
      setSubPro(type) {
        let tit;
        switch (type) {
          case 2:
            tit = "单选题";
            break;
          case 3:
            tit = "多选题";
            break;
          case 4:
            tit = "判断题";
            break;
          case 5:
            tit = "主观题";
            break;
        }
        return tit;
      },
8af7657f   梁保满   修改添加备题,组卷
1396
      //计算题号
77ebf04d   梁保满   个人版
1397
      setNum(index, indexs, sub) {
b0cd2598   梁保满   fix:测试问题
1398
1399
        let lengths = 0; //所在大题之前的所有小题数量
        let subIndex = 0; //所在大题的位置
77ebf04d   梁保满   个人版
1400
1401
1402
1403
1404
1405
        for (let i = 0; i < index; i++) {
          let subArr = this.form.questionList[i].subQuestions.filter((item) => {
            return !!item.questionType;
          });
          lengths += subArr.length;
        }
77ebf04d   梁保满   个人版
1406
1407
1408
1409
1410
1411
1412
        for (let i = 0; i < indexs; i++) {
          if (!!this.form.questionList[index].subQuestions[i].questionType) {
            subIndex += 1;
          }
        }
        return lengths + subIndex + 1;
      },
8af7657f   梁保满   修改添加备题,组卷
1413
      //统计小题数量
77ebf04d   梁保满   个人版
1414
1415
      setNums(ques) {
        let lengths = 0;
b0cd2598   梁保满   fix:测试问题
1416
1417
1418
1419
        let subArr =
          ques?.filter((item) => {
            return !!item.questionType;
          }) || [];
77ebf04d   梁保满   个人版
1420
1421
1422
        lengths = subArr.length;
        return lengths;
      },
8af7657f   梁保满   修改添加备题,组卷
1423
      //转换中文大题题号
77ebf04d   梁保满   个人版
1424
1425
      setBigNum(num) {
        let txt = "";
b0cd2598   梁保满   fix:测试问题
1426
        let bigNum = [...cNum];
77ebf04d   梁保满   个人版
1427
1428
1429
1430
        txt = bigNum[num];
  
        return txt;
      },
b31444fa   梁保满   复制归档答题卡后续流程
1431
      //切换题型清空答案
77ebf04d   梁保满   个人版
1432
      setQuestionForm(val) {
77ebf04d   梁保满   个人版
1433
1434
        this.questionForm.answerList = "";
      },
b31444fa   梁保满   复制归档答题卡后续流程
1435
      //减少题数设置答案
77ebf04d   梁保满   个人版
1436
      changeQesNum(val) {
77ebf04d   梁保满   个人版
1437
1438
1439
1440
1441
1442
1443
1444
1445
        if (
          this.questionForm.questionType == 2 ||
          this.questionForm.questionType == 4
        ) {
          this.questionForm.answerList = this.questionForm.answerList.substring(
            0,
            val
          );
        } else {
77ebf04d   梁保满   个人版
1446
1447
1448
1449
1450
1451
          this.questionForm.answerList = this.questionForm.answerList
            .split(",")
            .splice(0, val)
            .join(",");
        }
      },
b31444fa   梁保满   复制归档答题卡后续流程
1452
      //初始化要修改的答案
77ebf04d   梁保满   个人版
1453
      setFormAns(indexs, index) {
77ebf04d   梁保满   个人版
1454
1455
        this.formAns = { ...this.form.questionList[index].subQuestions[indexs] };
        this.formAns.listIndex = index;
77ebf04d   梁保满   个人版
1456
        let answerList = "";
8af7657f   梁保满   修改添加备题,组卷
1457
        let startIndex = indexs - this.formAns.subNum; //批量设置大难开始位置
77ebf04d   梁保满   个人版
1458
        this.form.questionList[index].subQuestions.map((item, subIdx) => {
8af7657f   梁保满   修改添加备题,组卷
1459
          if (subIdx >= startIndex && subIdx < indexs) {
77ebf04d   梁保满   个人版
1460
            answerList += this.setAnswer(item.questionType, item.correctAnswer);
8af7657f   梁保满   修改添加备题,组卷
1461
1462
1463
  
            if (item.qusType == 3) {
              answerList = answerList.slice(0, -1);
77ebf04d   梁保满   个人版
1464
1465
1466
            }
          }
        });
8af7657f   梁保满   修改添加备题,组卷
1467
        this.formAns.answerList = answerList;
77ebf04d   梁保满   个人版
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
  
        this.diaSetAns = true;
      },
      insertTxtAndSetcursor(element, answerList, str) {
        let startPos = element.selectionStart; // 获取光标开始的位置
        if (startPos === undefined) {
          // 如果没有光标位置 不操作
          return answerList;
        } else {
          return {
            text:
              answerList.substring(0, startPos) +
              str +
              answerList.substring(startPos), // 将文本插入
            startPos: startPos + str.length,
          };
        }
      },
b31444fa   梁保满   复制归档答题卡后续流程
1486
      //多选答案设置
77ebf04d   梁保满   个人版
1487
      setMultiple(obj, answer, type) {
77ebf04d   梁保满   个人版
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
        let elements =
          type == 1
            ? this.$refs["formAnsIpt2"].$el.children[0]
            : this.$refs["formAnsIpt"].$el.children[0];
        let resault = this.insertTxtAndSetcursor(
          elements,
          obj.answerList || "",
          answer
        );
        obj.answerList = resault.text;
        let str = obj.answerList;
        let str2;
        if (!!obj.answerOptions) {
          str2 = checkAnswer(
            str,
            3,
            obj.answerOptions.split(",").length,
            obj.subNum
          );
        } else {
          str2 = checkAnswer(str, 3, obj.selectNum, obj.number);
        }
        obj.answerList = str2;
        elements.focus();
        elements.selectionStart = resault.startPos;
      },
b31444fa   梁保满   复制归档答题卡后续流程
1514
      //批量修改答案
77ebf04d   梁保满   个人版
1515
      saveFormAns() {
77ebf04d   梁保满   个人版
1516
1517
1518
1519
1520
1521
        let EndIndex;
        let subNum = this.formAns.subNum - 1;
        this.form.questionList[this.formAns.listIndex].subQuestions.some(
          (item, index) => {
            if (this.formAns.endIndex == item.questionIndex) {
              EndIndex = index;
77ebf04d   梁保满   个人版
1522
            }
b0cd2598   梁保满   fix:测试问题
1523
            return this.formAns.endIndex == item.questionIndex;
77ebf04d   梁保满   个人版
1524
1525
          }
        );
77ebf04d   梁保满   个人版
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
        for (let i = 0; i <= subNum; i++) {
          let correctAnswer = "";
          if (this.formAns.qusType == 2) {
            correctAnswer = this.formAns.answerList[subNum - i] || "";
          } else if (this.formAns.qusType == 3) {
            correctAnswer = this.formAns.answerList.split(",")[subNum - i] || "";
          } else if (this.formAns.qusType == 4) {
            correctAnswer =
              this.formAns.answerList[subNum - i] == "✓"
                ? 1
                : this.formAns.answerList[subNum - i] == "✗"
b0cd2598   梁保满   fix:测试问题
1537
1538
                ? 2
                : "";
77ebf04d   梁保满   个人版
1539
1540
1541
1542
1543
1544
1545
1546
          }
          this.form.questionList[this.formAns.listIndex].subQuestions[
            EndIndex - i
          ].correctAnswer = correctAnswer;
        }
        this.diaSetAns = false;
      },
      keydownAnswer(event, type, isAddBig) {
ec6394d1   梁保满   v1.3.1。细节调整
1547
1548
        let answerA = "ABCDEFGHIJ";
        let answer_a = "abcdefghij";
77ebf04d   梁保满   个人版
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
        if (isAddBig) {
          answerA = answerA.substring(0, this.questionForm.selectNum);
          answer_a = answer_a.substring(0, this.questionForm.selectNum);
        } else {
          answerA = answerA.substring(0, this.formAns.subNum);
          answer_a = answer_a.substring(0, this.formAns.subNum);
        }
        answerA += answer_a;
        answerA = type == 2 ? answerA : answerA + ",";
        if (
          event.key == "Meta" ||
          event.key == "CapsLock" ||
          event.key == "Shift" ||
          event.key == "Enter" ||
          event.key == "Alt" ||
          event.key == "Backspace" ||
          event.key == "Delete" ||
          event.key == "ArrowUp" ||
          event.key == "ArrowDown" ||
          event.key == "ArrowLeft" ||
          event.key == "v" ||
          event.key == "V" ||
          event.key == "ArrowRight"
        )
          return;
        if (!answerA.includes(event.key)) {
          event.returnValue = "";
        }
      },
      setAllAnswer(event, type, isAddBig) {
        if (isAddBig) {
          let str = this.questionForm.answerList;
          let str2 = checkAnswer(
            str,
            type,
            this.questionForm.selectNum,
            this.questionForm.number
          );
          this.questionForm.answerList = str2;
        } else {
          let str = this.formAns.answerList;
          let str2 = checkAnswer(
            str,
            type,
            this.formAns.answerOptions.split(",").length,
            this.formAns.subNum
          );
          this.formAns.answerList = str2;
        }
      },
      setAnswer(type, ans) {
        let txt = "";
        if (type == 2) {
          txt = ans;
        } else if (type == 3) {
          txt = ans + ",";
        } else if (type == 4) {
          txt = ans == 1 ? "✓" : ans == 2 ? "✗" : "";
        }
        return txt;
      },
8af7657f   梁保满   修改添加备题,组卷
1610
1611
      toStep(step) {
        if (step == 2) {
b0cd2598   梁保满   fix:测试问题
1612
          this.setStep2();
8af7657f   梁保满   修改添加备题,组卷
1613
1614
1615
1616
        } else {
          this.formatQuestionList();
          this.step = step;
        }
77ebf04d   梁保满   个人版
1617
1618
      },
      setStep1() {
b31444fa   梁保满   复制归档答题卡后续流程
1619
1620
1621
1622
        if (this.subjectList.length == 0) {
          this.$message.warning("暂无绑定年级信息,请先联系管理员设置。");
          return;
        }
77ebf04d   梁保满   个人版
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
        this.$refs["forms"].validate((valid) => {
          // 验证通过:保存
          if (valid) {
            this.step = 1;
          } else {
            this.$message.error("数据有误,请检查!");
            return false;
          }
        });
      },
      setStep2() {
        if (!this.form.questionList.length) {
          this.$message.warning("请添加题目!");
          return;
b0cd2598   梁保满   fix:测试问题
1637
1638
        }
        this.formatQuestionList();
77ebf04d   梁保满   个人版
1639
1640
1641
        //添加题目ID、序号
        this.form.questionList.map((item, index) => {
          item.questionType = 0;
352c53cc   梁保满   上传word回传数据
1642
          item.subQuestions?.map((items, indexs) => {
77ebf04d   梁保满   个人版
1643
1644
1645
1646
1647
            items.questionId = this.setNum(index, indexs);
            items.questionIndex = this.setNum(index, indexs);
          });
        });
        //整理问题
b0cd2598   梁保满   fix:测试问题
1648
        this.formateQuestion();
8af7657f   梁保满   修改添加备题,组卷
1649
1650
1651
1652
        this.step = 2;
        return;
      },
      formateQuestion() {
b0cd2598   梁保满   fix:测试问题
1653
        this.formatQuestionList();
77ebf04d   梁保满   个人版
1654
1655
        this.form.questionList?.map((item) => {
          let types = [{}];
509f152d   梁保满   参数命名修改
1656
          let addIndex = 0;
352c53cc   梁保满   上传word回传数据
1657
          item.subQuestions?.map((sub, index) => {
77ebf04d   梁保满   个人版
1658
1659
            if (!!sub.questionType) {
              if (
509f152d   梁保满   参数命名修改
1660
                sub.questionType == types[addIndex].qusType &&
77ebf04d   梁保满   个人版
1661
1662
1663
                sub.questionType != 5
              ) {
                //同类型批量答案+1
509f152d   梁保满   参数命名修改
1664
                types[addIndex].subNum += 1;
77ebf04d   梁保满   个人版
1665
                if (
509f152d   梁保满   参数命名修改
1666
                  types[addIndex].answerOptions.length < sub.answerOptions.length
77ebf04d   梁保满   个人版
1667
                ) {
509f152d   梁保满   参数命名修改
1668
                  types[addIndex].answerOptions = sub.answerOptions;
77ebf04d   梁保满   个人版
1669
1670
                }
  
509f152d   梁保满   参数命名修改
1671
                // types[addIndex].answerList += this.setAnswer(
77ebf04d   梁保满   个人版
1672
1673
1674
                //   sub.questionType,
                //   sub.correctAnswer
                // );
509f152d   梁保满   参数命名修改
1675
                types[addIndex].answerList = "";
77ebf04d   梁保满   个人版
1676
1677
                if (index == item.subQuestions.length - 1) {
                  //循环最后类型数量大于等于5,保存批量答案
509f152d   梁保满   参数命名修改
1678
1679
1680
                  if (types[addIndex].subNum && types[addIndex].subNum >= 5) {
                    types[addIndex].endIndex = sub.questionIndex;
                    types[addIndex].index = index;
77ebf04d   梁保满   个人版
1681
1682
1683
                  }
                }
              } else {
509f152d   梁保满   参数命名修改
1684
                if (types[addIndex].subNum && types[addIndex].subNum >= 5) {
77ebf04d   梁保满   个人版
1685
                  //不同类型时如果原有类型数量大于等于5,保存批量答案
509f152d   梁保满   参数命名修改
1686
                  types[addIndex].endIndex =
77ebf04d   梁保满   个人版
1687
                    item.subQuestions[index - 1].questionIndex;
509f152d   梁保满   参数命名修改
1688
1689
1690
                  types[addIndex].index = index - 1;
                  addIndex += 1;
                  types[addIndex] = {};
77ebf04d   梁保满   个人版
1691
1692
                }
                //不同类型初始化批量答案
509f152d   梁保满   参数命名修改
1693
1694
1695
1696
                types[addIndex].qusType = sub.questionType;
                types[addIndex].subNum = 1;
                types[addIndex].answerOptions = sub.answerOptions;
                types[addIndex].answerList = "";
77ebf04d   梁保满   个人版
1697
1698
1699
1700
1701
              }
            }
          });
          for (let i = 0; i < types.length; i++) {
            if (types[i].subNum >= 5) {
352c53cc   梁保满   上传word回传数据
1702
              item.subQuestions?.splice(
77ebf04d   梁保满   个人版
1703
1704
1705
1706
1707
1708
                types[i].index + i + 1,
                0,
                deepClone(types[i])
              );
            }
          }
77ebf04d   梁保满   个人版
1709
        });
77ebf04d   梁保满   个人版
1710
      },
8af7657f   梁保满   修改添加备题,组卷
1711
  
b31444fa   梁保满   复制归档答题卡后续流程
1712
      //删除批量操作数据
77ebf04d   梁保满   个人版
1713
      formatQuestionList() {
77ebf04d   梁保满   个人版
1714
1715
1716
        for (let i = 0; i < this.form.questionList.length; i++) {
          for (
            let j = 0;
352c53cc   梁保满   上传word回传数据
1717
            j < this.form.questionList[i].subQuestions?.length;
77ebf04d   梁保满   个人版
1718
1719
            j++
          ) {
352c53cc   梁保满   上传word回传数据
1720
1721
            if (this.form.questionList[i].subQuestions[j]?.qusType) {
              this.form.questionList[i].subQuestions?.splice(j, 1);
77ebf04d   梁保满   个人版
1722
1723
1724
            }
          }
        }
77ebf04d   梁保满   个人版
1725
1726
1727
1728
1729
      },
      openQuestion() {
        this.questionForm = { ...questionForm };
        this.addQuestionVisible = true;
      },
b31444fa   梁保满   复制归档答题卡后续流程
1730
      //添加大题
77ebf04d   梁保满   个人版
1731
      addQuestion() {
77ebf04d   梁保满   个人版
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
        let subQuestions = [];
        let questionsOptions = {
          ...subQuesOptions,
          selectNum: this.questionForm.selectNum,
          score: this.questionForm.score,
          partScore: this.questionForm.partScore,
          questionType:
            this.questionForm.questionType == 6
              ? 2
              : this.questionForm.questionType,
        };
        switch (questionsOptions.questionType) {
          case 2:
            questionsOptions.answerOptions = this.rightOptions
              .slice(0, questionsOptions.selectNum)
              .join(",");
            break;
          case 3:
            questionsOptions.answerOptions = this.rightOptions
              .slice(0, questionsOptions.selectNum)
              .join(",");
            break;
          case 4:
            questionsOptions.selectNum = 0;
            questionsOptions.answerOptions = "1,2";
            break;
          case 5:
            questionsOptions.selectNum = 0;
            break;
        }
        for (let i = 0; i < this.questionForm.number; i++) {
          let answer = "";
          if (questionsOptions.questionType == 4) {
            answer =
              this.questionForm.answerList[i] == "✓"
                ? 1
                : this.questionForm.answerList[i] == "✗"
b0cd2598   梁保满   fix:测试问题
1769
1770
                ? 2
                : "";
77ebf04d   梁保满   个人版
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
          } else if (questionsOptions.questionType == 3) {
            answer = this.questionForm.answerList.split(",")[i] || "";
          } else if (questionsOptions.questionType == 2) {
            answer = this.questionForm.answerList[i] || "";
          }
          questionsOptions.correctAnswer = answer;
          subQuestions.push({ ...questionsOptions });
        }
        this.form.questionList.push({
          questionTitle: this.questionForm.questionTitle,
          number: this.questionForm.number,
          source: 10,
          subQuestions: [...subQuestions],
          show: false,
        });
        this.addQuestionVisible = false;
      },
b31444fa   梁保满   复制归档答题卡后续流程
1788
      //删除小题
77ebf04d   梁保满   个人版
1789
      delTabData(subIndex, index) {
77ebf04d   梁保满   个人版
1790
        this.form.questionList[index].subQuestions.splice(subIndex, 1);
384a2a54   梁保满   请求头添加班主任信息,bug修改
1791
        if (this.form.questionList[index].subQuestions.length == 0) {
b0cd2598   梁保满   fix:测试问题
1792
          this.form.questionList.splice(index, 1);
77da338a   梁保满   自测问题修改
1793
        }
b0cd2598   梁保满   fix:测试问题
1794
        this.formateQuestion();
77ebf04d   梁保满   个人版
1795
1796
      },
      setScore(question) {
352c53cc   梁保满   上传word回传数据
1797
        let score = question.subQuestions?.reduce((a, b) => {
77ebf04d   梁保满   个人版
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
          return a + (b.score ? b.score : 0);
        }, 0);
        return Number(score).toFixed(2);
      },
      changeAddSubQuestions(val, question) {
        if (val) {
          let questionsOptions = {
            ...subQuesOptions,
            questionType: val,
          };
          switch (questionsOptions.questionType) {
            case 2:
              questionsOptions.answerOptions = this.rightOptions
                .slice(0, questionsOptions.selectNum)
                .join(",");
              break;
            case 3:
              questionsOptions.answerOptions = this.rightOptions
                .slice(0, questionsOptions.selectNum)
                .join(",");
              questionsOptions.partScore = 0;
              break;
            case 4:
              questionsOptions.selectNum = 0;
              questionsOptions.answerOptions = "1,2";
              break;
            case 5:
              questionsOptions.selectNum = 0;
              break;
          }
b0cd2598   梁保满   fix:测试问题
1828
1829
1830
          question.subQuestions
            ? question.subQuestions.push(questionsOptions)
            : (question.subQuestions = [questionsOptions]);
77ebf04d   梁保满   个人版
1831
1832
1833
          this.addSubQuestionsType = "";
        }
      },
b31444fa   梁保满   复制归档答题卡后续流程
1834
      //切换多题型-小题题型
77ebf04d   梁保满   个人版
1835
      changeSubQuestions(val, subQuestions) {
77ebf04d   梁保满   个人版
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
        const that = this;
        subQuestions.score = 1;
        subQuestions.partScore = 0;
        subQuestions.correctAnswer = "";
        subQuestions.selectNum = 4;
        switch (val) {
          case 2:
            subQuestions.answerOptions = that.rightOptions
              .slice(0, subQuestions.selectNum)
              .join(",");
            break;
          case 3:
            subQuestions.answerOptions = that.rightOptions
              .slice(0, subQuestions.selectNum)
              .join(",");
            break;
          case 4:
            subQuestions.selectNum = 0;
            subQuestions.answerOptions = "1,2";
            break;
          case 5:
            subQuestions.selectNum = 0;
            break;
        }
b0cd2598   梁保满   fix:测试问题
1860
        this.formateQuestion();
77ebf04d   梁保满   个人版
1861
      },
b31444fa   梁保满   复制归档答题卡后续流程
1862
      //添加选项
77ebf04d   梁保满   个人版
1863
      addOptions(subQuestions) {
77ebf04d   梁保满   个人版
1864
        let length = subQuestions.answerOptions.split(",").length;
ec6394d1   梁保满   v1.3.1。细节调整
1865
        if (length > 9) return;
77ebf04d   梁保满   个人版
1866
1867
1868
1869
1870
        subQuestions.selectNum = length + 1;
        subQuestions.answerOptions = this.rightOptions
          .slice(0, subQuestions.selectNum)
          .join(",");
      },
b31444fa   梁保满   复制归档答题卡后续流程
1871
      //删除选项
77ebf04d   梁保满   个人版
1872
      removeOptions(subQuestions) {
77ebf04d   梁保满   个人版
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
        let length = subQuestions.answerOptions.split(",").length;
        if (length < 3) return;
        subQuestions.selectNum = length - 1;
        subQuestions.answerOptions = this.rightOptions
          .slice(0, subQuestions.selectNum)
          .join(",");
        subQuestions.correctAnswer = subQuestions.correctAnswer.slice(
          0,
          subQuestions.selectNum
        );
      },
b31444fa   梁保满   复制归档答题卡后续流程
1884
      //设置多选答案
77ebf04d   梁保满   个人版
1885
      changAnswer(sub, option) {
77ebf04d   梁保满   个人版
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
        let str = new RegExp(option, "g");
        if (sub.correctAnswer?.includes(option)) {
          sub.correctAnswer = sub.correctAnswer.replace(str, "");
        } else {
          let arrs = (sub.correctAnswer && sub.correctAnswer.split("")) || [];
          arrs.push(option);
          sub.correctAnswer = arrs.sort().join("");
        }
      },
      openTagDia() {
        this.tagList = deepClone(this.answerTypeList);
        this.dialogVisible = true;
      },
      async editTypeName(obj) {
        let isRepeat = false;
        this.answerTypeList.map((item) => {
          if (item.typeName == obj.typeName) {
            isRepeat = true;
          }
        });
        if (isRepeat) {
          this.$message.error("类型已存在请重新填写!");
          return;
        }
        //修改测验类型
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1911
1912
1913
1914
1915
        let editPaperType =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pModifyPaperType
            : this.$request.editPaperType;
        const { data, status, info } = await editPaperType({
77ebf04d   梁保满   个人版
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
          tagId: obj.id,
          tag: obj.typeName,
        });
        if (status == 0) {
          await this._TypeList();
          this.tagList = deepClone(this.answerTypeList);
          this.$message.success("修改成功");
        } else {
          this.$message.error(info);
        }
      },
      async removeTypeName(obj) {
        //删除测验类型
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1929
1930
1931
1932
1933
        let delPaperType =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pDelPaperType
            : this.$request.delPaperType;
        const { data, status, info } = await delPaperType({
77ebf04d   梁保满   个人版
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
          tagId: obj.id,
        });
        if (status == 0) {
          await this._TypeList();
          this.tagList = deepClone(this.answerTypeList);
          this.$message.success("删除成功");
        } else {
          this.$message.error(info);
        }
      },
      async addPaperType() {
        //保存测验类型
        if (!this.answerTypeName) {
          this.$message.error("请填写测验名称!");
          return;
        }
        let isRepeat = false;
        this.answerTypeList.map((item) => {
          if (item.typeName == this.answerTypeName) {
            isRepeat = true;
          }
        });
        if (isRepeat) {
          this.$message.error("类型已存在请重新填写!");
          return;
        }
        //添加测验类型
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1961
1962
1963
1964
1965
        let addPaperType =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pAddPaperType
            : this.$request.addPaperType;
        const { data, status, info } = await addPaperType({
77ebf04d   梁保满   个人版
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
          tag: this.answerTypeName,
        });
        if (status == 0) {
          await this._TypeList();
          this.tagList = deepClone(this.answerTypeList);
          this.form.tagId = data || "";
          this.answerTypeName = "";
          this.$message.success("添加成功");
        } else {
          this.$message.error(info);
        }
      },
      async save() {
        if (this.saveLoading) return;
        this.saveLoading = true;
        this.formatQuestionList();
        let formDatas = deepClone(this.form);
        for (let i = 0; i < formDatas.questionList.length; i++) {
          delete formDatas.questionList[i].show;
77ebf04d   梁保满   个人版
1985
        }
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1986
1987
1988
1989
1990
        let addPaper =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pAddPaper
            : this.$request.addPaper;
        const { data, status, info } = await addPaper({
77ebf04d   梁保满   个人版
1991
1992
1993
1994
1995
1996
          ...formDatas,
        });
        this.saveLoading = false;
        if (status == 0) {
          this.$router.push({
            path: "/examinationPaper",
384a2a54   梁保满   请求头添加班主任信息,bug修改
1997
1998
1999
            query: {
              type: this.listType,
              share: this.listShare,
b0cd2598   梁保满   fix:测试问题
2000
            },
77ebf04d   梁保满   个人版
2001
2002
2003
2004
2005
          });
        } else {
          this.$message.error(info);
        }
      },
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
2006
2007
2008
2009
      async changeGrade() {
        //切换年级查询科目
        this._QuerySubjectList(this.form.gradeName);
      },
77ebf04d   梁保满   个人版
2010
2011
      async _TypeList() {
        //测验类型查询
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
2012
2013
2014
2015
2016
        let fetchTypeNames =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pPaperTagList
            : this.$request.fetchTypeNames;
        const { data, status, info } = await fetchTypeNames({
77ebf04d   梁保满   个人版
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
          type: 1,
        });
        if (status == 0) {
          this.answerTypeList =
            data.list?.map((item) => {
              return {
                typeName: item.tag,
                id: item.tagId,
              };
            }) || [];
696f2d42   梁保满   fix:报表导出问题
2027
2028
2029
          // if (this.type != 2) {
          //   this.form.tagId = this.answerTypeList[0]?.id || "";
          // }
77ebf04d   梁保满   个人版
2030
2031
2032
2033
        } else {
          this.$message.error(info);
        }
      },
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
2034
2035
      async _GradeList() {
        //查询年级列表
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
2036
2037
2038
2039
2040
2041
2042
2043
2044
        // const { data, status, info } = await this.$request.fetchGradeList();
        // 查找班级
  
        let fetchClassList =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pClassList
            : this.$request.fetchClassList;
  
        const { data, status, info } = await fetchClassList();
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
2045
        if (status == 0) {
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
2046
          this.gradeClassList = data.list?.map((item) => {
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
2047
            if (!this.gradeList.includes(item.gradeName)) {
b0cd2598   梁保满   fix:测试问题
2048
              this.gradeList.push(item.gradeName);
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
2049
            }
b0cd2598   梁保满   fix:测试问题
2050
2051
            return item;
          });
3ca58022   梁保满   修改添加组卷题目解析,知识点梳理等
2052
          // this.gradeList = (data.gradeNames && [...data.gradeNames]) || [];
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
2053
2054
2055
2056
2057
2058
2059
2060
          if (this.type != 2) {
            this.form.gradeName = this.gradeList[0];
          }
        } else {
          this.$message.error(info);
        }
      },
      async _QuerySubjectList(grade) {
77ebf04d   梁保满   个人版
2061
        //查询科目列表
23659274   梁保满   备题接口对接
2062
        if (!grade) {
b31444fa   梁保满   复制归档答题卡后续流程
2063
2064
          return;
        }
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
2065
2066
2067
2068
2069
2070
2071
2072
2073
        let query = {};
        let fetchSubjectList =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pSubjectList
            : this.$request.fetchSubjectList;
        if (this.role != "ROLE_PERSONAL") {
          query.gradeName = grade;
        }
        const { data, status, info } = await fetchSubjectList({ ...query });
77ebf04d   梁保满   个人版
2074
        if (status === 0) {
b0cd2598   梁保满   fix:测试问题
2075
          let subjectArr = [];
77ebf04d   梁保满   个人版
2076
2077
          this.subjectList =
            data.subjectNames?.map((item) => {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
2078
2079
2080
              let subName =
                this.role == "ROLE_PERSONAL" ? item.subjectName : item;
              subjectArr.push(subName);
77ebf04d   梁保满   个人版
2081
              return {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
2082
2083
                value: subName,
                label: subName,
77ebf04d   梁保满   个人版
2084
2085
              };
            }) || [];
77ebf04d   梁保满   个人版
2086
          if (this.subjectList.length) {
ce278878   梁保满   2-2 bugfix
2087
2088
2089
2090
2091
            if (subjectArr.includes(this.$route.query.subjectName)) {
              this.form.subjectName = this.$route.query.subjectName;
            } else {
              this.form.subjectName = this.subjectList[0].value;
            }
77ebf04d   梁保满   个人版
2092
          }
77ebf04d   梁保满   个人版
2093
2094
2095
2096
2097
        } else {
          this.$message.error(info);
        }
      },
      async _QueryDetail() {
03bce046   梁保满   个人版调整
2098
        //查询答题卡详情
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
2099
2100
2101
2102
2103
        let fetchPaperDetail =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pPaperDetail
            : this.$request.fetchPaperDetail;
        const { data, status, info } = await fetchPaperDetail({
77ebf04d   梁保满   个人版
2104
2105
2106
2107
          paperId: this.$route.query.paperId,
        });
        if (status == 0) {
          this.form.title = data.title + "_副本";
77da338a   梁保满   自测问题修改
2108
  
8af7657f   梁保满   修改添加备题,组卷
2109
2110
2111
2112
          this.form.examsDuration = data.examsDuration;
          if (this.role != "ROLE_PERSONAL") {
            this.form.sharingType = data.sharingType;
          }
ce278878   梁保满   2-2 bugfix
2113
          this.form.tagId = "";
b0cd2598   梁保满   fix:测试问题
2114
          this.formatData(data);
352c53cc   梁保满   上传word回传数据
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
        } else {
          this.$message.error(info);
        }
      },
  
      formatData(data) {
        if (this.subjectList.length) {
          this.subjectList.map((item) => {
            if (item.label == data.subjectName) {
              this.form.subjectName = item.value;
            }
          });
        } else {
          this.form.subjectName = "";
        }
8af7657f   梁保满   修改添加备题,组卷
2130
  
352c53cc   梁保满   上传word回传数据
2131
        if (this.role != "ROLE_PERSONAL") {
352c53cc   梁保满   上传word回传数据
2132
2133
2134
2135
          if (this.gradeList.length) {
            this.gradeList.map((item) => {
              if (item == data.gradeName) {
                this.form.gradeName = data.gradeName;
47a01cb6   梁保满   v1.3测试问题
2136
2137
2138
              }
            });
          } else {
352c53cc   梁保满   上传word回传数据
2139
            this.form.gradeName = "";
47a01cb6   梁保满   v1.3测试问题
2140
          }
77ebf04d   梁保满   个人版
2141
        }
352c53cc   梁保满   上传word回传数据
2142
2143
2144
2145
        this.form.questionList = data.questionList?.map((item) => {
          let subQuestions =
            item.subQuestions?.map((items) => {
              return {
cb6ceaa8   梁保满   添加备题,组卷参数调整
2146
                ...items,
23659274   梁保满   备题接口对接
2147
                selectNum: items.answerOptions?.split(",").length,
352c53cc   梁保满   上传word回传数据
2148
                answerOptions: items.answerOptions || "A,B,C,D",
352c53cc   梁保满   上传word回传数据
2149
                screenshot: items.screenshot || "",
cb6ceaa8   梁保满   添加备题,组卷参数调整
2150
2151
                correctAnswer: items.correctAnswer || "",
                knowledge: items.knowledge || "",
352c53cc   梁保满   上传word回传数据
2152
2153
2154
2155
2156
2157
2158
2159
              };
            }) || [];
          return {
            questionTitle: item.questionTitle,
            subQuestions: subQuestions,
            show: false,
          };
        });
b0cd2598   梁保满   fix:测试问题
2160
      },
77ebf04d   梁保满   个人版
2161
2162
2163
    },
  };
  </script>
77ebf04d   梁保满   个人版
2164
2165
2166
2167
  <style lang="scss" scoped>
  .red {
    color: #f30;
  }
352c53cc   梁保满   上传word回传数据
2168
  
77ebf04d   梁保满   个人版
2169
2170
  .qs-options {
    flex: 1;
352c53cc   梁保满   上传word回传数据
2171
  
77ebf04d   梁保满   个人版
2172
2173
2174
    .ipt {
      margin-bottom: 5px;
    }
352c53cc   梁保满   上传word回传数据
2175
  
77ebf04d   梁保满   个人版
2176
2177
2178
2179
    .answer-box {
      .answer-s {
        cursor: pointer;
        user-select: none;
ec6394d1   梁保满   v1.3.1。细节调整
2180
        margin-bottom: 10px;
352c53cc   梁保满   上传word回传数据
2181
  
77ebf04d   梁保满   个人版
2182
2183
2184
2185
2186
        &:first-of-type {
          margin-left: 0;
        }
      }
    }
352c53cc   梁保满   上传word回传数据
2187
  
ec6394d1   梁保满   v1.3.1。细节调整
2188
2189
2190
    .answer-box2 {
      margin-bottom: 10px;
    }
352c53cc   梁保满   上传word回传数据
2191
  
77ebf04d   梁保满   个人版
2192
2193
2194
    .delButton {
      text-indent: -9999999px;
      border-color: #ff6868;
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
2195
      background: #ff6868 url("../../assets/images/arrow.png") no-repeat center;
77ebf04d   梁保满   个人版
2196
2197
2198
      background-size: 19px;
      color: transparent;
    }
352c53cc   梁保满   上传word回传数据
2199
  
77ebf04d   梁保满   个人版
2200
2201
2202
    .answer-s.ac {
      border: none;
    }
352c53cc   梁保满   上传word回传数据
2203
  
77ebf04d   梁保满   个人版
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
    .ac {
      border-color: #ff6868;
      background: #ff6868;
      color: #fff !important;
    }
  }
  
  .sel2 {
    width: 480px;
  }
352c53cc   梁保满   上传word回传数据
2214
  
77ebf04d   梁保满   个人版
2215
2216
2217
2218
2219
2220
2221
  .set-ans-btn {
    width: 100%;
    padding: 10px 0 10px 630px;
    box-sizing: border-box;
    border-right: 1px solid #e2e2e2;
    border-bottom: 1px solid #e2e2e2;
  }
352c53cc   梁保满   上传word回传数据
2222
  
77ebf04d   梁保满   个人版
2223
2224
2225
2226
2227
  .content-box {
    width: 100%;
    height: 100%;
    overflow-y: auto;
  }
352c53cc   梁保满   上传word回传数据
2228
  
77ebf04d   梁保满   个人版
2229
2230
2231
2232
  .content {
    width: 100%;
    box-sizing: border-box;
    padding: 0 24px;
352c53cc   梁保满   上传word回传数据
2233
  
77ebf04d   梁保满   个人版
2234
2235
2236
    .ml-20 {
      margin-left: 20px;
    }
352c53cc   梁保满   上传word回传数据
2237
  
77ebf04d   梁保满   个人版
2238
2239
2240
2241
2242
    .btn-box {
      text-align: right;
      margin-left: 140px;
    }
  }
352c53cc   梁保满   上传word回传数据
2243
  
77ebf04d   梁保满   个人版
2244
2245
2246
2247
2248
2249
2250
  .dia-content {
    .dia-tit {
      font-size: 20px;
      color: #333;
      font-weight: 700;
      text-align: center;
    }
352c53cc   梁保满   上传word回传数据
2251
  
77ebf04d   梁保满   个人版
2252
2253
2254
    .add-type {
      width: 100%;
      margin-bottom: 10px;
352c53cc   梁保满   上传word回传数据
2255
  
77ebf04d   梁保满   个人版
2256
2257
2258
2259
2260
      .js-set {
        margin: 2.5px 10px 0 0;
        font-size: 14px;
      }
    }
352c53cc   梁保满   上传word回传数据
2261
  
77ebf04d   梁保满   个人版
2262
2263
2264
2265
    .add-btn {
      margin-left: 20px;
    }
  }
352c53cc   梁保满   上传word回传数据
2266
  
77ebf04d   梁保满   个人版
2267
2268
2269
2270
2271
  .el-message-box {
    :deep(.el-button--default) {
      color: #fff;
    }
  }
352c53cc   梁保满   上传word回传数据
2272
  
77ebf04d   梁保满   个人版
2273
2274
2275
2276
  .add-box {
    display: flex;
    justify-content: center;
    align-items: center;
352c53cc   梁保满   上传word回传数据
2277
  
77ebf04d   梁保满   个人版
2278
2279
2280
2281
2282
2283
2284
2285
    .add-question {
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 16px;
      font-weight: bolder;
      padding: 2px;
      cursor: pointer;
352c53cc   梁保满   上传word回传数据
2286
  
77ebf04d   梁保满   个人版
2287
2288
2289
      .s1 {
        margin-left: 6px;
      }
352c53cc   梁保满   上传word回传数据
2290
  
77ebf04d   梁保满   个人版
2291
2292
2293
2294
      :deep(.el-icon-plus) {
        font-size: 24px;
        font-weight: 900;
      }
352c53cc   梁保满   上传word回传数据
2295
  
77ebf04d   梁保满   个人版
2296
2297
2298
2299
2300
      :deep(.el-button--mini.is-circle) {
        padding: 3px;
      }
    }
  }
352c53cc   梁保满   上传word回传数据
2301
  
77ebf04d   梁保满   个人版
2302
2303
  .dialog-footer {
    text-align: center;
352c53cc   梁保满   上传word回传数据
2304
  
77ebf04d   梁保满   个人版
2305
2306
2307
2308
2309
2310
    :deep(.el-button) {
      border-radius: 20px;
      padding: 8px 20px 7px;
      margin: 0 12px;
    }
  }
352c53cc   梁保满   上传word回传数据
2311
  
77ebf04d   梁保满   个人版
2312
2313
  .question-box {
    margin-bottom: 20px;
8af7657f   梁保满   修改添加备题,组卷
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
  
    .screenshot-box {
      width: 100%;
      border: 1px solid #e2e2e2;
      margin-bottom: 20px;
  
      .screenshot-img {
        margin: 0;
      }
    }
77ebf04d   梁保满   个人版
2324
  }
352c53cc   梁保满   上传word回传数据
2325
  
77ebf04d   梁保满   个人版
2326
2327
2328
2329
2330
  .question-title {
    line-height: 40px;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
352c53cc   梁保满   上传word回传数据
2331
  
77ebf04d   梁保满   个人版
2332
2333
2334
    .m20 {
      margin: 0 20px;
    }
352c53cc   梁保满   上传word回传数据
2335
  
77ebf04d   梁保满   个人版
2336
2337
2338
    .ipt {
      width: 300px;
      margin: 0 16px 0 10px;
352c53cc   梁保满   上传word回传数据
2339
  
77ebf04d   梁保满   个人版
2340
2341
2342
2343
2344
2345
      :deep(.el-input__inner) {
        border-radius: 20px;
        border-color: #667ffd;
        background: rgba($color: #667ffd, $alpha: 0.05);
      }
    }
352c53cc   梁保满   上传word回传数据
2346
  
77ebf04d   梁保满   个人版
2347
    .delete {
384a2a54   梁保满   请求头添加班主任信息,bug修改
2348
      margin: 0 8px;
77ebf04d   梁保满   个人版
2349
    }
352c53cc   梁保满   上传word回传数据
2350
  
77ebf04d   梁保满   个人版
2351
2352
2353
2354
2355
    .title-txt {
      margin-right: 20px;
      font-size: 16px;
      font-weight: 700;
    }
352c53cc   梁保满   上传word回传数据
2356
  
77ebf04d   梁保满   个人版
2357
2358
2359
2360
2361
2362
    .el-icon-caret-right {
      font-size: 24px;
      color: #888;
      transition: all 0.4s;
      margin-right: 12px;
      cursor: pointer;
352c53cc   梁保满   上传word回传数据
2363
  
77ebf04d   梁保满   个人版
2364
2365
2366
2367
2368
      &.active {
        transform: rotate(90deg);
      }
    }
  }
352c53cc   梁保满   上传word回传数据
2369
  
77ebf04d   梁保满   个人版
2370
2371
2372
2373
  .questions-ul {
    border-left: 1px solid #e2e2e2;
    border-top: 1px solid #e2e2e2;
  }
352c53cc   梁保满   上传word回传数据
2374
  
77ebf04d   梁保满   个人版
2375
2376
2377
  .el-input-number {
    width: 140px;
  }
352c53cc   梁保满   上传word回传数据
2378
  
77ebf04d   梁保满   个人版
2379
2380
2381
2382
2383
2384
  .answer-title {
    text-align: center;
    font-size: 20px;
    color: #333;
    font-weight: 700;
    padding-bottom: 20px;
352c53cc   梁保满   上传word回传数据
2385
  
77ebf04d   梁保满   个人版
2386
2387
2388
2389
2390
2391
    .totals {
      font-size: 16px;
      color: #888;
      font-weight: normal;
    }
  }
352c53cc   梁保满   上传word回传数据
2392
  
77ebf04d   梁保满   个人版
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
  .answer-box {
    .answer-s {
      display: inline-block;
      width: 30px;
      height: 30px;
      border: 1px solid #e2e2e2;
      border-radius: 3px;
      margin: 0 6px;
      font-size: 16px;
      color: #333;
      text-align: center;
      line-height: 30px;
352c53cc   梁保满   上传word回传数据
2405
  
77ebf04d   梁保满   个人版
2406
2407
2408
2409
2410
2411
2412
      &.active {
        background: #5e78fa;
        border-color: #5e78fa;
        color: #fff;
      }
    }
  }
352c53cc   梁保满   上传word回传数据
2413
  
77ebf04d   梁保满   个人版
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
  .qs-options {
    .answer-s {
      display: inline-block;
      width: 30px;
      height: 30px;
      border: 1px solid #e2e2e2;
      border-radius: 3px;
      margin: 0 6px;
      font-size: 16px;
      color: #333;
      text-align: center;
      line-height: 30px;
      cursor: pointer;
352c53cc   梁保满   上传word回传数据
2427
  
77ebf04d   梁保满   个人版
2428
2429
2430
2431
2432
2433
2434
      &.active {
        background: #5e78fa;
        border-color: #5e78fa;
        color: #fff;
      }
    }
  }
352c53cc   梁保满   上传word回传数据
2435
  
77ebf04d   梁保满   个人版
2436
2437
2438
2439
  .sub-questions {
    width: 100%;
    display: flex;
    border-bottom: 1px solid #e2e2e2;
352c53cc   梁保满   上传word回传数据
2440
  
b0cd2598   梁保满   fix:测试问题
2441
    & > div {
77ebf04d   梁保满   个人版
2442
2443
2444
2445
2446
2447
2448
2449
      min-height: 40px;
      padding: 5px;
      flex-shrink: 0;
      border-right: 1px solid #e2e2e2;
      display: flex;
      justify-content: center;
      align-items: center;
    }
352c53cc   梁保满   上传word回传数据
2450
  
77ebf04d   梁保满   个人版
2451
2452
2453
    .qs-num {
      width: 70px;
    }
352c53cc   梁保满   上传word回传数据
2454
  
77ebf04d   梁保满   个人版
2455
2456
2457
    .qs-type {
      width: 160px;
    }
352c53cc   梁保满   上传word回传数据
2458
  
77ebf04d   梁保满   个人版
2459
2460
2461
2462
    .qs-score,
    .qs-partScore {
      width: 160px;
    }
352c53cc   梁保满   上传word回传数据
2463
  
77ebf04d   梁保满   个人版
2464
2465
2466
    .qs-options {
      flex: 1;
    }
352c53cc   梁保满   上传word回传数据
2467
  
8af7657f   梁保满   修改添加备题,组卷
2468
2469
2470
2471
    .qs-upload {
      width: 60px;
    }
  
77ebf04d   梁保满   个人版
2472
    .qs-set {
ec6394d1   梁保满   v1.3.1。细节调整
2473
      width: 60px;
77ebf04d   梁保满   个人版
2474
    }
352c53cc   梁保满   上传word回传数据
2475
  
77ebf04d   梁保满   个人版
2476
2477
2478
2479
    .qs-options2 {
      text-align: left;
      justify-content: flex-start;
      padding-left: 20px;
352c53cc   梁保满   上传word回传数据
2480
  
77ebf04d   梁保满   个人版
2481
2482
2483
2484
      .answer-s {
        cursor: pointer;
      }
    }
352c53cc   梁保满   上传word回传数据
2485
  
77ebf04d   梁保满   个人版
2486
2487
2488
2489
2490
2491
2492
2493
2494
    :deep(.el-select) {
      .el-input__inner {
        border-radius: 20px;
        border-color: #667ffd;
        width: 150px;
        height: 32px;
        line-height: 32px;
        background: rgba($color: #667ffd, $alpha: 0.05);
      }
352c53cc   梁保满   上传word回传数据
2495
  
77ebf04d   梁保满   个人版
2496
2497
2498
2499
2500
      .el-input__icon {
        line-height: 32px;
      }
    }
  }
8af7657f   梁保满   修改添加备题,组卷
2501
2502
2503
2504
2505
  
  .upload-box {
    .upload-demo {
      text-align: center;
    }
b0cd2598   梁保满   fix:测试问题
2506
2507
    .screenshot {
      width: 100%;
8af7657f   梁保满   修改添加备题,组卷
2508
2509
    }
  }
77ebf04d   梁保满   个人版
2510
  </style>