Blame view

src/views/examinationPaper/addQs.vue 56.4 KB
ce278878   梁保满   2-2 bugfix
1
  <!-- 备题 -->
4c4f7640   梁保满   路由表,路由前端文件
2
  <template>
ca39cc52   阿宝   飞书问题处理
3
    <div ref="content" class="content-box">
13b58a42   梁保满   备题组卷部分前端页面基本完成
4
5
      <back-box>
        <template slot="title">
8af7657f   梁保满   修改添加备题,组卷
6
          <span>导入课件</span>
13b58a42   梁保满   备题组卷部分前端页面基本完成
7
8
9
        </template>
      </back-box>
      <div class="content">
ddcd75d7   梁保满   教师二次管理数据问题
10
11
12
13
14
15
        <el-steps
          :active="step"
          finish-status="success"
          simple
          style="margin: 20px 0"
        >
13b58a42   梁保满   备题组卷部分前端页面基本完成
16
17
          <el-step title="基础信息" icon="el-icon-edit"></el-step>
          <el-step title="题目编辑" icon="el-icon-tickets"></el-step>
8af7657f   梁保满   修改添加备题,组卷
18
          <el-step title="课件预览" icon="el-icon-edit-outline"></el-step>
13b58a42   梁保满   备题组卷部分前端页面基本完成
19
20
        </el-steps>
        <div v-show="step == 0">
ddcd75d7   梁保满   教师二次管理数据问题
21
22
23
24
25
26
          <el-form
            ref="forms"
            :model="form"
            :rules="formRules"
            label-width="140px"
          >
8af7657f   梁保满   修改添加备题,组卷
27
            <el-form-item label="课件名称:" prop="title">
ddcd75d7   梁保满   教师二次管理数据问题
28
29
30
31
32
33
34
35
36
              <el-input
                class="sel2"
                type="text"
                placeholder="请输入答题卡名称"
                v-model.trim="form.title"
                maxlength="50"
                size="45"
                show-word-limit
              >
ca39cc52   阿宝   飞书问题处理
37
              </el-input>
13b58a42   梁保满   备题组卷部分前端页面基本完成
38
            </el-form-item>
ddcd75d7   梁保满   教师二次管理数据问题
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
            <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"
                >
13b58a42   梁保满   备题组卷部分前端页面基本完成
56
57
58
                </el-option>
              </el-select>
            </el-form-item>
ee6e7628   梁保满   备题组卷借口数据对接调整
59
60
            <el-form-item label="科目:" prop="subjectName">
              <el-select class="sel" v-model="form.subjectName" placeholder="">
ddcd75d7   梁保满   教师二次管理数据问题
61
62
63
64
65
66
                <el-option
                  v-for="item in subjectList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  >{{ item.label }}
13b58a42   梁保满   备题组卷部分前端页面基本完成
67
68
69
                </el-option>
              </el-select>
            </el-form-item>
ddcd75d7   梁保满   教师二次管理数据问题
70
71
72
73
74
            <el-form-item
              v-if="role != 'ROLE_PERSONAL'"
              label="分享范围:"
              prop="sharingType"
            >
ee6e7628   梁保满   备题组卷借口数据对接调整
75
              <el-radio-group v-model="form.sharingType">
f356590c   阿宝   即时测列表,分析页面
76
77
                <el-radio :label="0">任课班级分享</el-radio>
                <el-radio :label="1">全年级分享</el-radio>
13b58a42   梁保满   备题组卷部分前端页面基本完成
78
79
80
81
              </el-radio-group>
            </el-form-item>
          </el-form>
          <div class="btn-box">
ddcd75d7   梁保满   教师二次管理数据问题
82
83
84
            <el-button type="danger" plain round @click="linkBack"
              >取消</el-button
            >
13b58a42   梁保满   备题组卷部分前端页面基本完成
85
86
            <el-button type="primary" round @click="setStep1">下一步</el-button>
          </div>
13b58a42   梁保满   备题组卷部分前端页面基本完成
87
88
        </div>
        <div v-show="step == 1">
f26ecfa4   阿宝   测试bug
89
90
          <div class="answer-title">
            <p class="name">{{ form.title }}</p>
f26ecfa4   阿宝   测试bug
91
          </div>
8af7657f   梁保满   修改添加备题,组卷
92
          <div class="question-box">
f5729396   梁保满   批量设置答案
93
94
95
96
97
98
99
            <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   梁保满   课件模版区分,错别字修改,录分成功...
100
                <div class="qs-upload">题干</div>
cb6ceaa8   梁保满   添加备题,组卷参数调整
101
                <div class="qs-upload">题目解析</div>
23659274   梁保满   备题接口对接
102
103
                <div class="qs-upload" v-if="knowledgeData.length">知识点</div>
                <div class="qs-set">操作</div>
f5729396   梁保满   批量设置答案
104
              </li>
f5729396   梁保满   批量设置答案
105
            </ul>
c6f2a550   梁保满   创建备题组卷,修改备题
106
107
            <template v-for="(question, index) in form.questionList">
              <ul class="questions-ul">
e9713b69   梁保满   备题支持无大题
108
109
110
111
112
113
114
                <template v-if="!question.subQuestions">
                  <li>
                    <p
                      class="set-ans-btn"
                      v-if="
                        question.qusType && question.subNum && question.subNum > 4
                      "
ddcd75d7   梁保满   教师二次管理数据问题
115
                    >
e9713b69   梁保满   备题支持无大题
116
117
                      <el-button type="primary" @click="setFormAns(index)"
                        >批量设置答案</el-button
ddcd75d7   梁保满   教师二次管理数据问题
118
                      >
e9713b69   梁保满   备题支持无大题
119
120
121
122
123
124
125
126
                    </p>
                    <div v-else class="sub-questions">
                      <div class="qs-num">{{ question.questionIndex }}</div>
                      <div class="qs-type">
                        <el-select
                          v-model="question.questionType"
                          placeholder="选择题目类型"
                          @change="changeSubQuestions($event, question)"
ddcd75d7   梁保满   教师二次管理数据问题
127
                        >
e9713b69   梁保满   备题支持无大题
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
                          <el-option
                            v-for="options in questionOptions"
                            :key="options.value"
                            :label="options.label"
                            :value="options.value"
                          ></el-option>
                        </el-select>
                      </div>
                      <div class="qs-score">
                        <el-input-number
                          class="number-ipt"
                          size="medium"
                          :min="1"
                          :max="200"
                          :precision="2"
                          v-model="question.score"
                          label="单题分值"
                        ></el-input-number>
                      </div>
                      <div class="qs-partScore">
                        <p v-if="question.questionType != 3">--</p>
                        <el-input-number
                          class="number-ipt"
                          v-else
                          size="medium"
                          :min="0"
                          :precision="2"
                          :max="question.score"
                          :step="0.5"
                          v-model="question.partScore"
                          label="漏选得分"
                        ></el-input-number>
                      </div>
                      <div class="qs-options qs-options2">
                        <p v-if="question.questionType == 5">--</p>
                        <p v-if="question.questionType == 4" class="answer-box">
                          <span
                            class="answer-s"
                            :class="question.correctAnswer == 1 ? 'active' : ''"
                            @click="question.correctAnswer = 1"
                            >✓</span
                          >
                          <span
                            class="answer-s"
                            :class="question.correctAnswer == 2 ? 'active' : ''"
                            @click="question.correctAnswer = 2"
                            >✗</span
                          >
                        </p>
                        <p v-if="question.questionType == 3" class="answer-box">
                          <span
                            class="answer-s"
82235092   梁保满   导入或者修改答案没有答案报错,修改...
180
                            v-for="option in question.answerOptions?.split(',')"
e9713b69   梁保满   备题支持无大题
181
182
183
184
185
186
187
188
189
190
191
192
193
                            :class="
                              question.correctAnswer?.includes(option)
                                ? 'active'
                                : ''
                            "
                            :key="option"
                            @click="changAnswer(question, option)"
                            >{{ option }}</span
                          >
                        </p>
                        <p v-if="question.questionType == 2" class="answer-box">
                          <span
                            class="answer-s"
82235092   梁保满   导入或者修改答案没有答案报错,修改...
194
                            v-for="option in question.answerOptions?.split(',')"
e9713b69   梁保满   备题支持无大题
195
196
197
198
199
200
201
202
203
204
205
206
                            :class="
                              question.correctAnswer == option ? 'active' : ''
                            "
                            :key="option"
                            @click="question.correctAnswer = option"
                            >{{ option }}</span
                          >
                        </p>
                        <p
                          v-if="
                            question.questionType == 3 ||
                            question.questionType == 2
ddcd75d7   梁保满   教师二次管理数据问题
207
                          "
e9713b69   梁保满   备题支持无大题
208
                          class="answer-box answer-box2"
ddcd75d7   梁保满   教师二次管理数据问题
209
                        >
e9713b69   梁保满   备题支持无大题
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
                          <el-button
                            size="mini"
                            type="primary"
                            icon="el-icon-plus"
                            circle
                            @click="addOptions(question)"
                          ></el-button>
                          <el-button
                            size="mini"
                            type="primary"
                            icon="el-icon-minus"
                            round
                            circle
                            @click="removeOptions(question)"
                          ></el-button>
                        </p>
                      </div>
  
                      <div class="qs-upload">
ddcd75d7   梁保满   教师二次管理数据问题
229
                        <el-button
e9713b69   梁保满   备题支持无大题
230
                          class="icon-tickets"
ddcd75d7   梁保满   教师二次管理数据问题
231
                          type="primary"
ddcd75d7   梁保满   教师二次管理数据问题
232
                          circle
e9713b69   梁保满   备题支持无大题
233
234
235
                          size="mini"
                          icon="el-icon-tickets"
                          @click="openStem(question, 1, index)"
ddcd75d7   梁保满   教师二次管理数据问题
236
                        ></el-button>
e9713b69   梁保满   备题支持无大题
237
238
                      </div>
                      <div class="qs-upload">
ddcd75d7   梁保满   教师二次管理数据问题
239
                        <el-button
e9713b69   梁保满   备题支持无大题
240
241
242
                          class="icon-tickets"
                          type="primary"
                          circle
ddcd75d7   梁保满   教师二次管理数据问题
243
                          size="mini"
e9713b69   梁保满   备题支持无大题
244
245
246
247
248
249
                          icon="el-icon-tickets"
                          @click="openStem(question, 2, index)"
                        ></el-button>
                      </div>
                      <div class="qs-upload" v-if="knowledgeData.length">
                        <el-button
ddcd75d7   梁保满   教师二次管理数据问题
250
                          type="primary"
ddcd75d7   梁保满   教师二次管理数据问题
251
                          circle
e9713b69   梁保满   备题支持无大题
252
253
254
                          size="mini"
                          icon="el-icon-price-tag"
                          @click="openKnowledge(question, index)"
ddcd75d7   梁保满   教师二次管理数据问题
255
                        ></el-button>
e9713b69   梁保满   备题支持无大题
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
                      </div>
                      <div class="qs-set">
                        <el-popconfirm
                          title="确定删除这道题吗?"
                          @confirm="delTabData(index)"
                        >
                          <el-button
                            slot="reference"
                            class="delete"
                            type="danger"
                            size="mini"
                            circle
                            icon="el-icon-delete"
                          ></el-button>
                        </el-popconfirm>
                      </div>
c6f2a550   梁保满   创建备题组卷,修改备题
272
                    </div>
e9713b69   梁保满   备题支持无大题
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
                  </li>
                </template>
                <template v-else>
                  <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(index, indexs)"
                        >批量设置答案</el-button
ddcd75d7   梁保满   教师二次管理数据问题
290
                      >
e9713b69   梁保满   备题支持无大题
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
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
                    </p>
                    <div v-else class="sub-questions">
                      <div class="qs-num">
                        {{ setNum(index, indexs, subQuestions) }}
                      </div>
                      <div class="qs-type">
                        <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>
                        </el-select>
                      </div>
                      <div class="qs-score">
                        <el-input-number
                          class="number-ipt"
                          size="medium"
                          :min="1"
                          :max="200"
                          :precision="2"
                          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 qs-options2">
                        <p v-if="subQuestions.questionType == 5">--</p>
                        <p
                          v-if="subQuestions.questionType == 4"
                          class="answer-box"
                        >
                          <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"
                        >
                          <span
                            class="answer-s"
82235092   梁保满   导入或者修改答案没有答案报错,修改...
364
                            v-for="option in subQuestions.answerOptions?.split(
e9713b69   梁保满   备题支持无大题
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
                              ','
                            )"
                            :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"
82235092   梁保满   导入或者修改答案没有答案报错,修改...
383
                            v-for="option in subQuestions.answerOptions?.split(
e9713b69   梁保满   备题支持无大题
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
411
412
413
414
415
416
417
418
419
                              ','
                            )"
                            :class="
                              subQuestions.correctAnswer == option ? 'active' : ''
                            "
                            :key="option"
                            @click="subQuestions.correctAnswer = option"
                            >{{ option }}</span
                          >
                        </p>
                        <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>
                        </p>
                      </div>
  
                      <div class="qs-upload">
ddcd75d7   梁保满   教师二次管理数据问题
420
                        <el-button
e9713b69   梁保满   备题支持无大题
421
422
423
424
425
426
427
428
429
430
431
432
433
                          class="icon-tickets"
                          type="primary"
                          circle
                          size="mini"
                          icon="el-icon-tickets"
                          @click="openStem(subQuestions, 1, index, indexs)"
                        ></el-button>
                      </div>
                      <div class="qs-upload">
                        <el-button
                          class="icon-tickets"
                          type="primary"
                          circle
ddcd75d7   梁保满   教师二次管理数据问题
434
                          size="mini"
e9713b69   梁保满   备题支持无大题
435
436
437
438
439
440
441
                          icon="el-icon-tickets"
                          @click="openStem(subQuestions, 2, index, indexs)"
                        ></el-button>
                      </div>
                      <div class="qs-upload" v-if="knowledgeData.length">
                        <el-button
                          type="primary"
ddcd75d7   梁保满   教师二次管理数据问题
442
                          circle
e9713b69   梁保满   备题支持无大题
443
444
445
                          size="mini"
                          icon="el-icon-price-tag"
                          @click="openKnowledge(subQuestions, index, indexs)"
ddcd75d7   梁保满   教师二次管理数据问题
446
                        ></el-button>
e9713b69   梁保满   备题支持无大题
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
                      </div>
                      <div class="qs-set">
                        <el-popconfirm
                          title="确定删除这道题吗?"
                          @confirm="delTabData(index, indexs)"
                        >
                          <el-button
                            slot="reference"
                            class="delete"
                            type="danger"
                            size="mini"
                            circle
                            icon="el-icon-delete"
                          ></el-button>
                        </el-popconfirm>
                      </div>
c6f2a550   梁保满   创建备题组卷,修改备题
463
                    </div>
e9713b69   梁保满   备题支持无大题
464
465
                  </li>
                </template>
c6f2a550   梁保满   创建备题组卷,修改备题
466
467
              </ul>
            </template>
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
468
          </div>
ddcd75d7   梁保满   教师二次管理数据问题
469
470
471
472
473
474
475
          <el-dialog
            :close-on-click-modal="false"
            title="批量设置答案"
            :visible.sync="diaSetAns"
            width="400"
            :modal-append-to-body="false"
          >
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
476
477
478
479
480
481
            <div class="qs-options">
              <p class="dia-tips">
                请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
              </p>
              <p>{{ setSubPro(formAns.qusType) }}:</p>
              <p class="ipt">
ddcd75d7   梁保满   教师二次管理数据问题
482
483
484
485
                <el-input
                  v-if="formAns.qusType == 2 || formAns.qusType == 3"
                  ref="formAnsIpt"
                  v-model="formAns.answerList"
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
486
                  @keydown.native="keydownAnswer($event, formAns.qusType)"
ddcd75d7   梁保满   教师二次管理数据问题
487
488
489
490
491
492
493
                  @input="setAllAnswer($event, formAns.qusType)"
                ></el-input>
                <el-input
                  v-if="formAns.qusType == 4"
                  v-model="formAns.answerList"
                  readonly=""
                ></el-input>
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
494
495
496
              </p>
              <p class="answer-box">
                <template v-if="formAns.qusType == 4">
ddcd75d7   梁保满   教师二次管理数据问题
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
                  <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
                  >
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
515
516
                </template>
                <template v-if="formAns.qusType == 3">
ddcd75d7   梁保满   教师二次管理数据问题
517
518
519
520
521
522
523
524
525
526
527
528
                  <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
                  >
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
529
                </template>
21dfdeae   梁保满   平台管理员
530
                <template v-if="formAns.qusType == 2">
ddcd75d7   梁保满   教师二次管理数据问题
531
532
533
534
535
536
537
538
539
540
541
                  <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
                  >
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
542
                </template>
ddcd75d7   梁保满   教师二次管理数据问题
543
544
545
546
547
548
549
550
                <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
                >
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
551
552
553
554
555
556
557
              </p>
            </div>
            <div class="dialog-footer" slot="footer">
              <el-button @click="saveFormAns">确 定</el-button>
              <el-button @click="diaSetAns = false">取 消</el-button>
            </div>
          </el-dialog>
13b58a42   梁保满   备题组卷部分前端页面基本完成
558
          <div class="btn-box">
ddcd75d7   梁保满   教师二次管理数据问题
559
560
561
            <el-button type="danger" plain round @click="linkBack"
              >取消</el-button
            >
8af7657f   梁保满   修改添加备题,组卷
562
563
            <el-button round @click="step = 0">上一步</el-button>
            <el-button type="primary" round @click="toStep(2)">下一步</el-button>
13b58a42   梁保满   备题组卷部分前端页面基本完成
564
          </div>
ddcd75d7   梁保满   教师二次管理数据问题
565
566
567
568
569
          <el-dialog
            :close-on-click-modal="false"
            :title="stem.type == 1 ? '上传题干' : '上传题目解析'"
            :visible.sync="dialogStem"
            v-if="dialogStem"
df616627   梁保满   添加修改试卷 题目解析样式问题
570
            width="800px"
ddcd75d7   梁保满   教师二次管理数据问题
571
          >
8af7657f   梁保满   修改添加备题,组卷
572
            <div class="upload-box">
ddcd75d7   梁保满   教师二次管理数据问题
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
              <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>
              <el-upload
                class="upload-demo"
                :action="uploadUrl"
                :limit="1"
                :on-success="upSuccess"
                :on-error="upError"
                accept="image/*"
              >
ce278878   梁保满   2-2 bugfix
601
                <el-button size="small" type="primary">选择上传照片</el-button>
8af7657f   梁保满   修改添加备题,组卷
602
603
604
              </el-upload>
            </div>
            <div slot="footer">
ce278878   梁保满   2-2 bugfix
605
              <el-button @click="dialogStem = false">保存</el-button>
8af7657f   梁保满   修改添加备题,组卷
606
607
            </div>
          </el-dialog>
ddcd75d7   梁保满   教师二次管理数据问题
608
609
610
611
          <el-dialog
            :close-on-click-modal="false"
            title="知识点"
            :visible.sync="dialogKnowledge"
df616627   梁保满   添加修改试卷 题目解析样式问题
612
            width="500px"
ddcd75d7   梁保满   教师二次管理数据问题
613
          >
cb6ceaa8   梁保满   添加备题,组卷参数调整
614
615
616
            <div>
              <el-form ref="form" :model="stem" label-width="160px">
                <el-form-item label="知识点:">
ddcd75d7   梁保满   教师二次管理数据问题
617
618
619
620
621
622
623
624
625
626
627
                  <el-cascader
                    size="small"
                    filterable
                    :show-all-levels="false"
                    collapse
                    clearable
                    placeholder="选择知识点"
                    v-model="stem.knowledge"
                    :options="knowledgeData"
                    :props="{ expandTrigger: 'hover' }"
                  ></el-cascader>
cb6ceaa8   梁保满   添加备题,组卷参数调整
628
629
630
631
632
633
634
635
                </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>
13b58a42   梁保满   备题组卷部分前端页面基本完成
636
        </div>
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
637
        <div v-if="step == 2">
8af7657f   梁保满   修改添加备题,组卷
638
639
          <div class="answer-title">
            <p class="name">{{ form.title }}</p>
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
640
          </div>
8af7657f   梁保满   修改添加备题,组卷
641
          <div class="question-box">
c6f2a550   梁保满   创建备题组卷,修改备题
642
            <template v-for="question in form.questionList">
e9713b69   梁保满   备题支持无大题
643
644
645
              <template v-if="!question.subQuestions">
                <div class="screenshot-box" v-if="question.screenshot">
                  <iframe class="screenshot" :src="question.screenshot"></iframe>
98dec083   梁保满   复制试卷问题,题干列表样式,题目解...
646
                </div>
e9713b69   梁保满   备题支持无大题
647
648
649
650
651
652
653
654
655
656
657
              </template>
              <template v-else>
                <div v-for="subQuestions in question.subQuestions">
                  <div class="screenshot-box" v-if="subQuestions.screenshot">
                    <iframe
                      class="screenshot"
                      :src="subQuestions.screenshot"
                    ></iframe>
                  </div>
                </div>
              </template>
c6f2a550   梁保满   创建备题组卷,修改备题
658
            </template>
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
659
          </div>
8af7657f   梁保满   修改添加备题,组卷
660
          <div class="btn-box">
ddcd75d7   梁保满   教师二次管理数据问题
661
662
663
            <el-button type="danger" plain round @click="linkBack"
              >取消</el-button
            >
8af7657f   梁保满   修改添加备题,组卷
664
665
666
667
            <el-button round @click="toStep(1)">上一步</el-button>
            <el-button type="primary" round @click="save">保存</el-button>
          </div>
        </div>
13b58a42   梁保满   备题组卷部分前端页面基本完成
668
669
      </div>
    </div>
4c4f7640   梁保满   路由表,路由前端文件
670
671
672
  </template>
  
  <script>
533a17d8   梁保满   备题组卷添加批量设置答案
673
  import { deepClone, checkAnswer } from "utils";
cb6ceaa8   梁保满   添加备题,组卷参数调整
674
  import knowledgeList from "assets/js/knowledgeList.js";
4c4f7640   梁保满   路由表,路由前端文件
675
  export default {
13b58a42   梁保满   备题组卷部分前端页面基本完成
676
677
    data() {
      return {
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
678
        role: "",
13b58a42   梁保满   备题组卷部分前端页面基本完成
679
        step: 0, //步骤
cb6ceaa8   梁保满   添加备题,组卷参数调整
680
        gradeClassList: [], //年级-班级数据
13b58a42   梁保满   备题组卷部分前端页面基本完成
681
682
        gradeList: [], //年级
        subjectList: [], //科目
13b58a42   梁保满   备题组卷部分前端页面基本完成
683
684
685
        form: {
          //答题卡详情
          title: "",
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
686
          gradeName: "",
8af7657f   梁保满   修改添加备题,组卷
687
          subjectName: "",
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
688
          sharingType: 0,
8af7657f   梁保满   修改添加备题,组卷
689
          questionList: [],
13b58a42   梁保满   备题组卷部分前端页面基本完成
690
691
692
693
694
695
696
        },
        formRules: {
          //答题卡验证
          title: [
            { required: true, message: "请输入答题卡名称", trigger: "blur" },
            {
              min: 1,
23659274   梁保满   备题接口对接
697
698
              max: 50,
              message: "长度在 1 到 50 个字符",
13b58a42   梁保满   备题组卷部分前端页面基本完成
699
700
701
              trigger: "blur",
            },
          ],
ddcd75d7   梁保满   教师二次管理数据问题
702
          gradeName: [{ required: true, message: "请选择年级", trigger: "blur" }],
ee6e7628   梁保满   备题组卷借口数据对接调整
703
704
705
          subjectName: [
            { required: true, message: "请选择科目", trigger: "blur" },
          ],
13b58a42   梁保满   备题组卷部分前端页面基本完成
706
        },
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
707
        diaSetAns: false, //答案开关
cb6ceaa8   梁保满   添加备题,组卷参数调整
708
        dialogKnowledge: false, //知识点
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
709
        dialogStem: false, //截图开关
533a17d8   梁保满   备题组卷添加批量设置答案
710
        formAns: {
c6f2a550   梁保满   创建备题组卷,修改备题
711
712
          listIndex: 0, //大题位置
          endIndex: 0, //相同题目最后一位题目的questionIndex
98f6a547   梁保满   创建答题卡,统计答题信息
713
          index: 0, //相同题目最后一位题目的位置
533a17d8   梁保满   备题组卷添加批量设置答案
714
715
716
717
718
          qusType: "", //题目类型
          subNum: 0, //数量
          answerOptions: [], //答案选项
          answerList: "", //答案列表-字符串
        },
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
719
        stem: {
cb6ceaa8   梁保满   添加备题,组卷参数调整
720
          type: 1,
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
721
          index: 0, //大题位置
c6f2a550   梁保满   创建备题组卷,修改备题
722
          indexs: 0, //小题位置
8af7657f   梁保满   修改添加备题,组卷
723
          screenshot: "", //题干图片地址
cb6ceaa8   梁保满   添加备题,组卷参数调整
724
725
          answerScreenshot: "", //题目解析图片地址
          knowledge: [], //知识点
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
726
727
        },
        type: 1, //1-创建,2-复制答题卡
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
728
729
730
731
732
733
734
        questionOptions: [
          { label: "单选题", value: 2 },
          { label: "多选题", value: 3 },
          { label: "判断题", value: 4 },
          { label: "主观题", value: 5 },
        ],
        rightOptions: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"],
384a2a54   梁保满   请求头添加班主任信息,bug修改
735
736
737
738
        knowledgeList: { ...knowledgeList },
        //返回列表页参数记录
        listType: 1,
        listShare: 0,
ddcd75d7   梁保满   教师二次管理数据问题
739
740
        uploadUrl: "/file/uploadImgToHtml",
        iframeLoading: false,
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
741
        subjectName: "",
13b58a42   梁保满   备题组卷部分前端页面基本完成
742
743
      };
    },
23659274   梁保满   备题接口对接
744
745
746
    computed: {
      // 知识点列表 根据学段-科目筛选
      knowledgeData: function () {
ddcd75d7   梁保满   教师二次管理数据问题
747
        let jsons = [];
23659274   梁保满   备题接口对接
748
        if (this.form.gradeName && this.form.subjectName) {
ddcd75d7   梁保满   教师二次管理数据问题
749
750
          let sectionName = "";
          this.gradeClassList.map((item) => {
23659274   梁保满   备题接口对接
751
            if (this.form.gradeName == item.gradeName) {
ddcd75d7   梁保满   教师二次管理数据问题
752
              sectionName = item.sectionName;
23659274   梁保满   备题接口对接
753
            }
ddcd75d7   梁保满   教师二次管理数据问题
754
755
756
757
758
759
760
761
762
763
764
          });
          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];
23659274   梁保满   备题接口对接
765
766
767
            }
          }
        }
ddcd75d7   梁保满   教师二次管理数据问题
768
        return jsons;
23659274   梁保满   备题接口对接
769
770
771
772
773
774
775
776
777
      },
    },
    watch: {
      step: function () {
        this.$nextTick(function () {
          this.$refs.content.scrollTop = 0;
        });
      },
    },
5424ef82   梁保满   接口调整
778
    async created() {
384a2a54   梁保满   请求头添加班主任信息,bug修改
779
      this.listType = this.$route.query.listType ? this.$route.query.listType : 1;
ddcd75d7   梁保满   教师二次管理数据问题
780
781
782
      this.listShare = this.$route.query.listShare
        ? this.$route.query.listShare
        : 0;
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
783
      this.subjectName = this.$route.query.subjectName || "";
f26ecfa4   阿宝   测试bug
784
      this.type = this.$route.query.type ? this.$route.query.type : 1;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
785
786
787
      this.role =
        this.$store.getters.info.showRole ||
        this.$store.getters.info.permissions[0].role;
ce278878   梁保满   2-2 bugfix
788
      if (this.type != 2) {
ddcd75d7   梁保满   教师二次管理数据问题
789
790
791
792
793
794
795
        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.sharingType = params?.sharingType || 0;
        this.formatData(params);
ce278878   梁保满   2-2 bugfix
796
      }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
797
798
799
800
801
802
      if (this.role != "ROLE_PERSONAL") {
        this.formRules.gradeName = [
          { required: true, message: "请选择年级", trigger: "blur" },
        ];
        await this._GradeList();
      }
8f573b82   阿宝   组卷接口联调
803
      await this._QuerySubjectList(this.gradeList[0]);
13b58a42   梁保满   备题组卷部分前端页面基本完成
804
      if (this.type == 2) {
ee6e7628   梁保满   备题组卷借口数据对接调整
805
        this._QueryDetail();
13b58a42   梁保满   备题组卷部分前端页面基本完成
806
807
808
      }
    },
    methods: {
8af7657f   梁保满   修改添加备题,组卷
809
      // v1.5
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
810
      //上传截图
e9713b69   梁保满   备题支持无大题
811
      openStem(obj, type, index, indexs) {
ddcd75d7   梁保满   教师二次管理数据问题
812
        this.iframeLoading = true;
e9713b69   梁保满   备题支持无大题
813
        this.stem.type = type;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
814
        this.stem.index = index;
c6f2a550   梁保满   创建备题组卷,修改备题
815
        this.stem.indexs = indexs;
cb6ceaa8   梁保满   添加备题,组卷参数调整
816
        if (type == 1) {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
817
          if (!obj.screenshot || obj.screenshot == "") {
ddcd75d7   梁保满   教师二次管理数据问题
818
819
            this.iframeLoading = false;
          }
cb6ceaa8   梁保满   添加备题,组卷参数调整
820
821
822
          this.stem.screenshot = obj.screenshot || "";
          this.stem.answerScreenshot = "";
        } else {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
823
          if (!obj.answerScreenshot || obj.answerScreenshot == "") {
ddcd75d7   梁保满   教师二次管理数据问题
824
825
            this.iframeLoading = false;
          }
cb6ceaa8   梁保满   添加备题,组卷参数调整
826
827
828
          this.stem.answerScreenshot = obj.answerScreenshot || "";
          this.stem.screenshot = "";
        }
c6f2a550   梁保满   创建备题组卷,修改备题
829
  
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
830
831
        this.dialogStem = true;
      },
c6f2a550   梁保满   创建备题组卷,修改备题
832
833
834
  
      // 图片上传成功
      upSuccess(res) {
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
835
        if (res && res.status == 0) {
cb6ceaa8   梁保满   添加备题,组卷参数调整
836
837
          if (this.stem.type == 1) {
            this.stem.screenshot = res.data.url;
e9713b69   梁保满   备题支持无大题
838
839
840
841
842
843
844
845
            if (this.form.questionList[0]?.subQuestions) {
              this.form.questionList[this.stem.index].subQuestions[
                this.stem.indexs
              ].screenshot = this.stem.screenshot;
            } else {
              this.form.questionList[this.stem.index].screenshot =
                this.stem.screenshot;
            }
cb6ceaa8   梁保满   添加备题,组卷参数调整
846
847
          } else {
            this.stem.answerScreenshot = res.data.url;
e9713b69   梁保满   备题支持无大题
848
849
850
851
852
853
854
855
            if (this.form.questionList[0]?.subQuestions) {
              this.form.questionList[this.stem.index].subQuestions[
                this.stem.indexs
              ].answerScreenshot = this.stem.answerScreenshot;
            } else {
              this.form.questionList[this.stem.index].answerScreenshot =
                this.stem.answerScreenshot;
            }
cb6ceaa8   梁保满   添加备题,组卷参数调整
856
          }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
857
858
859
860
861
862
863
864
865
          this.$message.success("上传成功");
        } else {
          this.$message.error(res.info);
        }
      },
  
      upError(res) {
        this.$message.error("上传失败");
      },
cb6ceaa8   梁保满   添加备题,组卷参数调整
866
      // 知识点
e9713b69   梁保满   备题支持无大题
867
      openKnowledge(obj, index, indexs) {
cb6ceaa8   梁保满   添加备题,组卷参数调整
868
        this.stem.index = index;
c6f2a550   梁保满   创建备题组卷,修改备题
869
        this.stem.indexs = indexs;
384a2a54   梁保满   请求头添加班主任信息,bug修改
870
        this.stem.knowledge = (obj.knowledge && obj.knowledge.split("#")) || [];
cb6ceaa8   梁保满   添加备题,组卷参数调整
871
872
873
874
        this.dialogKnowledge = true;
      },
      // 知识点
      setKnowledge() {
ddcd75d7   梁保满   教师二次管理数据问题
875
876
877
        this.form.questionList[this.stem.index].subQuestions[
          this.stem.indexs
        ].knowledge = this.stem.knowledge.join("#");
cb6ceaa8   梁保满   添加备题,组卷参数调整
878
879
880
        this.dialogKnowledge = false;
      },
  
8af7657f   梁保满   修改添加备题,组卷
881
      //end
13b58a42   梁保满   备题组卷部分前端页面基本完成
882
883
      linkBack() {
        this.$confirm(
ddcd75d7   梁保满   教师二次管理数据问题
884
          (this.type == 2 ? "修改复制的" : "导入的") + "课件未保存,确认退出吗?",
13b58a42   梁保满   备题组卷部分前端页面基本完成
885
886
887
888
889
890
891
892
893
894
895
896
          "提示",
          {
            confirmButtonText: "取消",
            cancelButtonText: "确定",
            confirmButtonClass: "el-button--danger1",
            cancelButtonClass: "el-button--primary",
            showClose: false,
            roundButton: true,
            center: true,
            type: "warning",
          }
        )
ddcd75d7   梁保满   教师二次管理数据问题
897
          .then(() => {})
13b58a42   梁保满   备题组卷部分前端页面基本完成
898
899
900
          .catch(() => {
            this.$router.push({
              path: "/examinationPaper",
384a2a54   梁保满   请求头添加班主任信息,bug修改
901
902
903
              query: {
                type: this.listType,
                share: this.listShare,
ddcd75d7   梁保满   教师二次管理数据问题
904
              },
13b58a42   梁保满   备题组卷部分前端页面基本完成
905
906
907
            });
          });
      },
c6f2a550   梁保满   创建备题组卷,修改备题
908
      //转换题型显示方式
13b58a42   梁保满   备题组卷部分前端页面基本完成
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
      setSubPro(type) {
        let tit;
        switch (type) {
          case 2:
            tit = "单选题";
            break;
          case 3:
            tit = "多选题";
            break;
          case 4:
            tit = "判断题";
            break;
          case 5:
            tit = "主观题";
            break;
        }
        return tit;
      },
c6f2a550   梁保满   创建备题组卷,修改备题
927
928
      //计算题号
      setNum(index, indexs, sub) {
ddcd75d7   梁保满   教师二次管理数据问题
929
930
        let lengths = 0; //所在大题之前的所有小题数量
        let subIndex = 0; //所在大题的位置
c6f2a550   梁保满   创建备题组卷,修改备题
931
932
933
934
935
936
937
938
939
940
941
942
943
        for (let i = 0; i < index; i++) {
          let subArr = this.form.questionList[i].subQuestions.filter((item) => {
            return !!item.questionType;
          });
          lengths += subArr.length;
        }
        for (let i = 0; i < indexs; i++) {
          if (!!this.form.questionList[index].subQuestions[i].questionType) {
            subIndex += 1;
          }
        }
        return lengths + subIndex + 1;
      },
8af7657f   梁保满   修改添加备题,组卷
944
945
      //整理问题
      formateQuestion() {
ddcd75d7   梁保满   教师二次管理数据问题
946
        this.formatQuestionList();
572de367   梁保满   多班对比问题
947
        if (this.form.questionList[0]?.subQuestions) {
e9713b69   梁保满   备题支持无大题
948
949
          this.form.questionList?.map((item) => {
            let types = [{}];
2428c457   梁保满   参数命名修改
950
            let addIndex = 0;
e9713b69   梁保满   备题支持无大题
951
952
953
            item.subQuestions?.map((sub, index) => {
              if (!!sub.questionType) {
                if (
2428c457   梁保满   参数命名修改
954
                  sub.questionType == types[addIndex].qusType &&
e9713b69   梁保满   备题支持无大题
955
956
957
                  sub.questionType != 5
                ) {
                  //同类型批量答案+1
2428c457   梁保满   参数命名修改
958
                  types[addIndex].subNum += 1;
e9713b69   梁保满   备题支持无大题
959
                  if (
2428c457   梁保满   参数命名修改
960
                    types[addIndex].answerOptions.length < sub.answerOptions.length
e9713b69   梁保满   备题支持无大题
961
                  ) {
2428c457   梁保满   参数命名修改
962
                    types[addIndex].answerOptions = sub.answerOptions;
e9713b69   梁保满   备题支持无大题
963
964
                  }
  
2428c457   梁保满   参数命名修改
965
                  // types[addIndex].answerList += this.setAnswer(
e9713b69   梁保满   备题支持无大题
966
967
968
                  //   sub.questionType,
                  //   sub.correctAnswer
                  // );
2428c457   梁保满   参数命名修改
969
                  types[addIndex].answerList = "";
e9713b69   梁保满   备题支持无大题
970
971
                  if (index == item.subQuestions.length - 1) {
                    //循环最后类型数量大于等于5,保存批量答案
2428c457   梁保满   参数命名修改
972
973
974
                    if (types[addIndex].subNum && types[addIndex].subNum >= 5) {
                      types[addIndex].endIndex = sub.questionIndex;
                      types[addIndex].index = index;
e9713b69   梁保满   备题支持无大题
975
976
977
                    }
                  }
                } else {
2428c457   梁保满   参数命名修改
978
                  if (types[addIndex].subNum && types[addIndex].subNum >= 5) {
e9713b69   梁保满   备题支持无大题
979
                    //不同类型时如果原有类型数量大于等于5,保存批量答案
2428c457   梁保满   参数命名修改
980
                    types[addIndex].endIndex =
e9713b69   梁保满   备题支持无大题
981
                      item.subQuestions[index - 1].questionIndex;
2428c457   梁保满   参数命名修改
982
983
984
                    types[addIndex].index = index - 1;
                    addIndex += 1;
                    types[addIndex] = {};
e9713b69   梁保满   备题支持无大题
985
986
                  }
                  //不同类型初始化批量答案
2428c457   梁保满   参数命名修改
987
988
989
990
                  types[addIndex].qusType = sub.questionType;
                  types[addIndex].subNum = 1;
                  types[addIndex].answerOptions = sub.answerOptions;
                  types[addIndex].answerList = "";
e9713b69   梁保满   备题支持无大题
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
                }
              }
            });
            for (let i = 0; i < types.length; i++) {
              if (types[i].subNum >= 5) {
                item.subQuestions?.splice(
                  types[i].index + i + 1,
                  0,
                  deepClone(types[i])
                );
              }
            }
          });
        } else {
c6f2a550   梁保满   创建备题组卷,修改备题
1005
          let types = [{}];
2428c457   梁保满   参数命名修改
1006
          let addIndex = 0;
e93f8636   梁保满   即使测列表角色权限操作问题
1007
1008
          let questionList = [...this.form.questionList];
          this.form.questionList = questionList.map((sub, index) => {
c6f2a550   梁保满   创建备题组卷,修改备题
1009
            if (!!sub.questionType) {
8af7657f   梁保满   修改添加备题,组卷
1010
              if (
2428c457   梁保满   参数命名修改
1011
                sub.questionType == types[addIndex].qusType &&
c6f2a550   梁保满   创建备题组卷,修改备题
1012
                sub.questionType != 5
8af7657f   梁保满   修改添加备题,组卷
1013
              ) {
c6f2a550   梁保满   创建备题组卷,修改备题
1014
                //同类型批量答案+1
2428c457   梁保满   参数命名修改
1015
                types[addIndex].subNum += 1;
c6f2a550   梁保满   创建备题组卷,修改备题
1016
                if (
2428c457   梁保满   参数命名修改
1017
                  types[addIndex].answerOptions.length < sub.answerOptions.length
c6f2a550   梁保满   创建备题组卷,修改备题
1018
                ) {
2428c457   梁保满   参数命名修改
1019
                  types[addIndex].answerOptions = sub.answerOptions;
c6f2a550   梁保满   创建备题组卷,修改备题
1020
                }
2428c457   梁保满   参数命名修改
1021
                // types[addIndex].answerList += this.setAnswer(
c6f2a550   梁保满   创建备题组卷,修改备题
1022
1023
1024
                //   sub.questionType,
                //   sub.correctAnswer
                // );
2428c457   梁保满   参数命名修改
1025
                types[addIndex].answerList = "";
e93f8636   梁保满   即使测列表角色权限操作问题
1026
                if (index == questionList.length - 1) {
c6f2a550   梁保满   创建备题组卷,修改备题
1027
                  //循环最后类型数量大于等于5,保存批量答案
2428c457   梁保满   参数命名修改
1028
1029
1030
                  if (types[addIndex].subNum && types[addIndex].subNum >= 5) {
                    types[addIndex].endIndex = sub.questionIndex;
                    types[addIndex].index = index;
c6f2a550   梁保满   创建备题组卷,修改备题
1031
1032
1033
                  }
                }
              } else {
2428c457   梁保满   参数命名修改
1034
                if (types[addIndex].subNum && types[addIndex].subNum >= 5) {
c6f2a550   梁保满   创建备题组卷,修改备题
1035
                  //不同类型时如果原有类型数量大于等于5,保存批量答案
2428c457   梁保满   参数命名修改
1036
1037
1038
1039
                  types[addIndex].endIndex = questionList[index - 1].questionIndex;
                  types[addIndex].index = index - 1;
                  addIndex += 1;
                  types[addIndex] = {};
c6f2a550   梁保满   创建备题组卷,修改备题
1040
1041
                }
                //不同类型初始化批量答案
2428c457   梁保满   参数命名修改
1042
1043
1044
1045
                types[addIndex].qusType = sub.questionType;
                types[addIndex].subNum = 1;
                types[addIndex].answerOptions = sub.answerOptions;
                types[addIndex].answerList = "";
8af7657f   梁保满   修改添加备题,组卷
1046
              }
c6f2a550   梁保满   创建备题组卷,修改备题
1047
            }
e9713b69   梁保满   备题支持无大题
1048
            return sub;
c6f2a550   梁保满   创建备题组卷,修改备题
1049
1050
          });
          for (let i = 0; i < types.length; i++) {
e9713b69   梁保满   备题支持无大题
1051
1052
1053
            if (types[i].qusType == 3) {
              types[i].answerList = types[i].answerList.slice(0, -1);
            }
c6f2a550   梁保满   创建备题组卷,修改备题
1054
            if (types[i].subNum >= 5) {
e9713b69   梁保满   备题支持无大题
1055
              this.form.questionList.splice(
c6f2a550   梁保满   创建备题组卷,修改备题
1056
1057
1058
1059
                types[i].index + i + 1,
                0,
                deepClone(types[i])
              );
8af7657f   梁保满   修改添加备题,组卷
1060
            }
533a17d8   梁保满   备题组卷添加批量设置答案
1061
          }
e9713b69   梁保满   备题支持无大题
1062
        }
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1063
      },
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1064
      //初始化要修改的答案
e9713b69   梁保满   备题支持无大题
1065
      setFormAns(index, indexs) {
11a4e518   梁保满   背题组卷修改答案设置,即使测随堂问...
1066
        let answerList = "";
e9713b69   梁保满   备题支持无大题
1067
1068
1069
1070
1071
1072
1073
1074
1075
        if (this.form.questionList[0]?.subQuestions) {
          this.formAns = {
            ...this.form.questionList[index].subQuestions[indexs],
          };
          this.formAns.listIndex = index;
          let startIndex = indexs - this.formAns.subNum; //批量设置大难开始位置
          this.form.questionList[index].subQuestions.map((item, subIdx) => {
            if (subIdx >= startIndex && subIdx < indexs) {
              answerList += this.setAnswer(item.questionType, item.correctAnswer);
c6f2a550   梁保满   创建备题组卷,修改备题
1076
  
e9713b69   梁保满   备题支持无大题
1077
1078
1079
              if (item.qusType == 3) {
                answerList = answerList.slice(0, -1);
              }
11a4e518   梁保满   背题组卷修改答案设置,即使测随堂问...
1080
            }
e9713b69   梁保满   备题支持无大题
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
          });
        } else {
          this.formAns = { ...this.form.questionList[index] };
          let startIndex = index - this.formAns.subNum; //批量设置开始位置
          this.formAns.answerList = [];
          this.formAns.listIndex = index;
          this.form.questionList.map((item, subIdx) => {
            if (subIdx >= startIndex && subIdx < index) {
              answerList += this.setAnswer(item.questionType, item.correctAnswer);
              if (item.qusType == 3) {
                answerList = answerList.slice(0, -1);
              }
            }
          });
        }
c6f2a550   梁保满   创建备题组卷,修改备题
1096
  
e9713b69   梁保满   备题支持无大题
1097
        this.formAns.answerList = answerList;
533a17d8   梁保满   备题组卷添加批量设置答案
1098
1099
        this.diaSetAns = true;
      },
def690b2   梁保满   批量设置答案
1100
      insertTxtAndSetcursor(element, answerList, str) {
f5729396   梁保满   批量设置答案
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
        let startPos = element.selectionStart; // 获取光标开始的位置
        if (startPos === undefined) {
          // 如果没有光标位置 不操作
          return answerList;
        } else {
          return {
            text:
              answerList.substring(0, startPos) +
              str +
              answerList.substring(startPos), // 将文本插入
            startPos: startPos + str.length,
          };
        }
      },
77da338a   梁保满   自测问题修改
1115
1116
      //添加选项
      addOptions(subQuestions) {
82235092   梁保满   导入或者修改答案没有答案报错,修改...
1117
        let length = subQuestions.answerOptions?.split(",").length || 0;
77da338a   梁保满   自测问题修改
1118
1119
1120
1121
1122
1123
1124
1125
        if (length > 9) return;
        subQuestions.selectNum = length + 1;
        subQuestions.answerOptions = this.rightOptions
          .slice(0, subQuestions.selectNum)
          .join(",");
      },
      //删除选项
      removeOptions(subQuestions) {
82235092   梁保满   导入或者修改答案没有答案报错,修改...
1126
        let length = subQuestions.answerOptions?.split(",").length || 0;
77da338a   梁保满   自测问题修改
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
        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
        );
      },
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1137
      //多选答案设置
def690b2   梁保满   批量设置答案
1138
      setMultiple(obj, answer, type) {
def690b2   梁保满   批量设置答案
1139
1140
1141
1142
1143
1144
1145
1146
1147
        let elements =
          type == 1
            ? this.$refs["formAnsIpt2"].$el.children[0]
            : this.$refs["formAnsIpt"].$el.children[0];
        let resault = this.insertTxtAndSetcursor(
          elements,
          obj.answerList || "",
          answer
        );
f5729396   梁保满   批量设置答案
1148
        obj.answerList = resault.text;
533a17d8   梁保满   备题组卷添加批量设置答案
1149
        let str = obj.answerList;
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1150
1151
1152
1153
1154
1155
        let str2;
        if (!!obj.answerOptions) {
          str2 = checkAnswer(
            str,
            3,
            obj.answerOptions.split(",").length,
b2d3d803   梁保满   批量设置答案优化
1156
            obj.subNum
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1157
1158
          );
        } else {
b2d3d803   梁保满   批量设置答案优化
1159
          str2 = checkAnswer(str, 3, obj.selectNum, obj.number);
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1160
        }
533a17d8   梁保满   备题组卷添加批量设置答案
1161
        obj.answerList = str2;
def690b2   梁保满   批量设置答案
1162
1163
        elements.focus();
        elements.selectionStart = resault.startPos;
533a17d8   梁保满   备题组卷添加批量设置答案
1164
      },
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1165
      //批量修改答案
533a17d8   梁保满   备题组卷添加批量设置答案
1166
      saveFormAns() {
533a17d8   梁保满   备题组卷添加批量设置答案
1167
1168
        let EndIndex;
        let subNum = this.formAns.subNum - 1;
c6f2a550   梁保满   创建备题组卷,修改备题
1169
        this.form.questionList[this.formAns.listIndex].subQuestions.some(
533a17d8   梁保满   备题组卷添加批量设置答案
1170
          (item, index) => {
c6f2a550   梁保满   创建备题组卷,修改备题
1171
            if (this.formAns.endIndex == item.questionIndex) {
533a17d8   梁保满   备题组卷添加批量设置答案
1172
              EndIndex = index;
533a17d8   梁保满   备题组卷添加批量设置答案
1173
            }
ddcd75d7   梁保满   教师二次管理数据问题
1174
            return this.formAns.endIndex == item.questionIndex;
533a17d8   梁保满   备题组卷添加批量设置答案
1175
1176
          }
        );
533a17d8   梁保满   备题组卷添加批量设置答案
1177
1178
1179
        for (let i = 0; i <= subNum; i++) {
          let correctAnswer = "";
          if (this.formAns.qusType == 2) {
f5729396   梁保满   批量设置答案
1180
            correctAnswer = this.formAns.answerList[subNum - i] || "";
533a17d8   梁保满   备题组卷添加批量设置答案
1181
          } else if (this.formAns.qusType == 3) {
f5729396   梁保满   批量设置答案
1182
            correctAnswer = this.formAns.answerList.split(",")[subNum - i] || "";
533a17d8   梁保满   备题组卷添加批量设置答案
1183
          } else if (this.formAns.qusType == 4) {
503b6063   梁保满   判断题答案选项
1184
1185
1186
1187
            correctAnswer =
              this.formAns.answerList[subNum - i] == "✓"
                ? 1
                : this.formAns.answerList[subNum - i] == "✗"
ddcd75d7   梁保满   教师二次管理数据问题
1188
1189
                ? 2
                : "";
533a17d8   梁保满   备题组卷添加批量设置答案
1190
          }
c6f2a550   梁保满   创建备题组卷,修改备题
1191
          this.form.questionList[this.formAns.listIndex].subQuestions[
533a17d8   梁保满   备题组卷添加批量设置答案
1192
1193
1194
1195
1196
            EndIndex - i
          ].correctAnswer = correctAnswer;
        }
        this.diaSetAns = false;
      },
8af7657f   梁保满   修改添加备题,组卷
1197
      keydownAnswer(event, type) {
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1198
1199
        let answerA = "ABCDEFGHIJ";
        let answer_a = "abcdefghij";
8af7657f   梁保满   修改添加备题,组卷
1200
1201
1202
1203
  
        answerA = answerA.substring(0, this.formAns.subNum);
        answer_a = answer_a.substring(0, this.formAns.subNum);
  
813d4d64   梁保满   批量设置答案添加输入
1204
1205
        answerA += answer_a;
        answerA = type == 2 ? answerA : answerA + ",";
533a17d8   梁保满   备题组卷添加批量设置答案
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
        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"
813d4d64   梁保满   批量设置答案添加输入
1220
        )
533a17d8   梁保满   备题组卷添加批量设置答案
1221
          return;
813d4d64   梁保满   批量设置答案添加输入
1222
        if (!answerA.includes(event.key)) {
533a17d8   梁保满   备题组卷添加批量设置答案
1223
1224
1225
          event.returnValue = "";
        }
      },
8af7657f   梁保满   修改添加备题,组卷
1226
      setAllAnswer(event, type) {
8af7657f   梁保满   修改添加备题,组卷
1227
1228
1229
1230
1231
1232
1233
1234
        let str = this.formAns.answerList;
        let str2 = checkAnswer(
          str,
          type,
          this.formAns.answerOptions.split(",").length,
          this.formAns.subNum
        );
        this.formAns.answerList = str2;
813d4d64   梁保满   批量设置答案添加输入
1235
      },
533a17d8   梁保满   备题组卷添加批量设置答案
1236
1237
1238
      setAnswer(type, ans) {
        let txt = "";
        if (type == 2) {
c6f2a550   梁保满   创建备题组卷,修改备题
1239
          txt = ans || "";
533a17d8   梁保满   备题组卷添加批量设置答案
1240
        } else if (type == 3) {
c6f2a550   梁保满   创建备题组卷,修改备题
1241
          txt = (ans || "") + ",";
533a17d8   梁保满   备题组卷添加批量设置答案
1242
        } else if (type == 4) {
d32e461c   梁保满   备题组卷
1243
          txt = ans == 1 ? "✓" : ans == 2 ? "✗" : "";
533a17d8   梁保满   备题组卷添加批量设置答案
1244
1245
1246
        }
        return txt;
      },
8af7657f   梁保满   修改添加备题,组卷
1247
      toStep(step) {
533a17d8   梁保满   备题组卷添加批量设置答案
1248
        this.formatQuestionList();
8af7657f   梁保满   修改添加备题,组卷
1249
        this.step = step;
cb6ceaa8   梁保满   添加备题,组卷参数调整
1250
        if (step == 1) {
ddcd75d7   梁保满   教师二次管理数据问题
1251
          this.formateQuestion();
8af7657f   梁保满   修改添加备题,组卷
1252
        }
533a17d8   梁保满   备题组卷添加批量设置答案
1253
      },
13b58a42   梁保满   备题组卷部分前端页面基本完成
1254
      setStep1() {
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1255
1256
1257
1258
        if (this.subjectList.length == 0) {
          this.$message.warning("暂无绑定年级信息,请先联系管理员设置。");
          return;
        }
13b58a42   梁保满   备题组卷部分前端页面基本完成
1259
1260
1261
        this.$refs["forms"].validate((valid) => {
          // 验证通过:保存
          if (valid) {
ddcd75d7   梁保满   教师二次管理数据问题
1262
            this.formateQuestion();
13b58a42   梁保满   备题组卷部分前端页面基本完成
1263
1264
1265
1266
1267
1268
1269
            this.step = 1;
          } else {
            this.$message.error("数据有误,请检查!");
            return false;
          }
        });
      },
8af7657f   梁保满   修改添加备题,组卷
1270
  
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1271
      //删除批量操作数据
533a17d8   梁保满   备题组卷添加批量设置答案
1272
1273
      formatQuestionList() {
        for (let i = 0; i < this.form.questionList.length; i++) {
e9713b69   梁保满   备题支持无大题
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
          if (this.form.questionList[0]?.subQuestions) {
            for (
              let j = 0;
              j < this.form.questionList[i].subQuestions?.length;
              j++
            ) {
              if (this.form.questionList[i].subQuestions[j]?.qusType) {
                this.form.questionList[i].subQuestions?.splice(j, 1);
              }
            }
          } else {
            if (this.form.questionList[i].qusType) {
              this.form.questionList.splice(i, 1);
              i--;
c6f2a550   梁保满   创建备题组卷,修改备题
1288
            }
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1289
          }
13b58a42   梁保满   备题组卷部分前端页面基本完成
1290
        }
13b58a42   梁保满   备题组卷部分前端页面基本完成
1291
      },
8af7657f   梁保满   修改添加备题,组卷
1292
      //删除题
e9713b69   梁保满   备题支持无大题
1293
1294
1295
1296
1297
1298
      delTabData(index, subIndex) {
        if (this.form.questionList[0].subQuestions) {
          this.form.questionList[index].subQuestions.splice(subIndex, 1);
        } else {
          this.form.questionList[index].splice(subIndex, 1);
        }
ddcd75d7   梁保满   教师二次管理数据问题
1299
        this.formateQuestion();
13b58a42   梁保满   备题组卷部分前端页面基本完成
1300
      },
23659274   梁保满   备题接口对接
1301
      //切换题型
13b58a42   梁保满   备题组卷部分前端页面基本完成
1302
      changeSubQuestions(val, subQuestions) {
13b58a42   梁保满   备题组卷部分前端页面基本完成
1303
1304
1305
1306
1307
1308
1309
        const that = this;
        subQuestions.score = 1;
        subQuestions.partScore = 0;
        subQuestions.correctAnswer = "";
        subQuestions.selectNum = 4;
        switch (val) {
          case 2:
8f573b82   阿宝   组卷接口联调
1310
1311
1312
            subQuestions.answerOptions = that.rightOptions
              .slice(0, subQuestions.selectNum)
              .join(",");
13b58a42   梁保满   备题组卷部分前端页面基本完成
1313
1314
            break;
          case 3:
8f573b82   阿宝   组卷接口联调
1315
1316
1317
            subQuestions.answerOptions = that.rightOptions
              .slice(0, subQuestions.selectNum)
              .join(",");
13b58a42   梁保满   备题组卷部分前端页面基本完成
1318
1319
            break;
          case 4:
503b6063   梁保满   判断题答案选项
1320
1321
1322
            subQuestions.selectNum = 0;
            subQuestions.answerOptions = "1,2";
            break;
13b58a42   梁保满   备题组卷部分前端页面基本完成
1323
1324
1325
1326
          case 5:
            subQuestions.selectNum = 0;
            break;
        }
ddcd75d7   梁保满   教师二次管理数据问题
1327
        this.formateQuestion();
13b58a42   梁保满   备题组卷部分前端页面基本完成
1328
      },
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1329
      //设置多选答案
13b58a42   梁保满   备题组卷部分前端页面基本完成
1330
      changAnswer(sub, option) {
13b58a42   梁保满   备题组卷部分前端页面基本完成
1331
1332
1333
1334
1335
1336
1337
1338
1339
        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("");
        }
      },
8af7657f   梁保满   修改添加备题,组卷
1340
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1341
      async save() {
8f573b82   阿宝   组卷接口联调
1342
1343
        if (this.saveLoading) return;
        this.saveLoading = true;
533a17d8   梁保满   备题组卷添加批量设置答案
1344
        this.formatQuestionList();
f5729396   梁保满   批量设置答案
1345
        let formDatas = deepClone(this.form);
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1346
1347
1348
1349
1350
        let addPaper =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pAddPaper
            : this.$request.addPaper;
        const { data, status, info } = await addPaper({
8af7657f   梁保满   修改添加备题,组卷
1351
          type: 1,
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1352
          ...formDatas,
13b58a42   梁保满   备题组卷部分前端页面基本完成
1353
        });
8f573b82   阿宝   组卷接口联调
1354
        this.saveLoading = false;
ee6e7628   梁保满   备题组卷借口数据对接调整
1355
        if (status == 0) {
13b58a42   梁保满   备题组卷部分前端页面基本完成
1356
          this.$router.push({
ee6e7628   梁保满   备题组卷借口数据对接调整
1357
            path: "/examinationPaper",
384a2a54   梁保满   请求头添加班主任信息,bug修改
1358
1359
1360
            query: {
              type: this.listType,
              share: this.listShare,
ddcd75d7   梁保满   教师二次管理数据问题
1361
            },
ee6e7628   梁保满   备题组卷借口数据对接调整
1362
          });
13b58a42   梁保满   备题组卷部分前端页面基本完成
1363
        } else {
6fffbd55   阿宝   组卷接口调整
1364
          this.$message.error(info);
13b58a42   梁保满   备题组卷部分前端页面基本完成
1365
1366
1367
1368
1369
1370
        }
      },
      async changeGrade() {
        //切换年级查询科目
        this._QuerySubjectList(this.form.gradeName);
      },
8af7657f   梁保满   修改添加备题,组卷
1371
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1372
1373
      async _GradeList() {
        //查询年级列表
cb6ceaa8   梁保满   添加备题,组卷参数调整
1374
1375
1376
1377
1378
1379
1380
1381
1382
        // 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();
ee6e7628   梁保满   备题组卷借口数据对接调整
1383
        if (status == 0) {
cb6ceaa8   梁保满   添加备题,组卷参数调整
1384
          this.gradeClassList = data.list?.map((item) => {
cb6ceaa8   梁保满   添加备题,组卷参数调整
1385
            if (!this.gradeList.includes(item.gradeName)) {
ddcd75d7   梁保满   教师二次管理数据问题
1386
              this.gradeList.push(item.gradeName);
cb6ceaa8   梁保满   添加备题,组卷参数调整
1387
            }
ddcd75d7   梁保满   教师二次管理数据问题
1388
1389
            return item;
          });
cb6ceaa8   梁保满   添加备题,组卷参数调整
1390
          // this.gradeList = (data.gradeNames && [...data.gradeNames]) || [];
13b58a42   梁保满   备题组卷部分前端页面基本完成
1391
1392
1393
          if (this.type != 2) {
            this.form.gradeName = this.gradeList[0];
          }
13b58a42   梁保满   备题组卷部分前端页面基本完成
1394
        } else {
6fffbd55   阿宝   组卷接口调整
1395
          this.$message.error(info);
13b58a42   梁保满   备题组卷部分前端页面基本完成
1396
1397
        }
      },
5424ef82   梁保满   接口调整
1398
      async _QuerySubjectList(grade) {
13b58a42   梁保满   备题组卷部分前端页面基本完成
1399
        //查询科目列表
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
        if (!grade) {
          return;
        }
        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 });
ee6e7628   梁保满   备题组卷借口数据对接调整
1412
        if (status === 0) {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
1413
          let subjectArr = [];
f26ecfa4   阿宝   测试bug
1414
1415
          this.subjectList =
            data.subjectNames?.map((item) => {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
1416
1417
1418
              let subName =
                this.role == "ROLE_PERSONAL" ? item.subjectName : item;
              subjectArr.push(subName);
f26ecfa4   阿宝   测试bug
1419
              return {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
1420
1421
                value: subName,
                label: subName,
f26ecfa4   阿宝   测试bug
1422
1423
              };
            }) || [];
ee6e7628   梁保满   备题组卷借口数据对接调整
1424
          if (this.subjectList.length) {
03cd547e   梁保满   单体型以及其他类型试卷修改答案逻辑
1425
1426
1427
1428
1429
            if (subjectArr.includes(this.$route.query.subjectName)) {
              this.form.subjectName = this.$route.query.subjectName;
            } else {
              this.form.subjectName = this.subjectList[0].value;
            }
13b58a42   梁保满   备题组卷部分前端页面基本完成
1430
          }
13b58a42   梁保满   备题组卷部分前端页面基本完成
1431
        } else {
6fffbd55   阿宝   组卷接口调整
1432
          this.$message.error(info);
13b58a42   梁保满   备题组卷部分前端页面基本完成
1433
1434
        }
      },
ee6e7628   梁保满   备题组卷借口数据对接调整
1435
      async _QueryDetail() {
03bce046   梁保满   个人版调整
1436
        //查询答题卡详情
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1437
1438
1439
1440
1441
        let fetchPaperDetail =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pPaperDetail
            : this.$request.fetchPaperDetail;
        const { data, status, info } = await fetchPaperDetail({
ee6e7628   梁保满   备题组卷借口数据对接调整
1442
1443
1444
          paperId: this.$route.query.paperId,
        });
        if (status == 0) {
f26ecfa4   阿宝   测试bug
1445
          this.form.title = data.title + "_副本";
ce278878   梁保满   2-2 bugfix
1446
1447
  
          this.form.examsDuration = data.examsDuration;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1448
1449
          if (this.role != "ROLE_PERSONAL") {
            this.form.sharingType = data.sharingType;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1450
          }
ce278878   梁保满   2-2 bugfix
1451
          this.form.tagId = "";
ddcd75d7   梁保满   教师二次管理数据问题
1452
          this.formatData(data);
ee6e7628   梁保满   备题组卷借口数据对接调整
1453
        } else {
6fffbd55   阿宝   组卷接口调整
1454
          this.$message.error(info);
ee6e7628   梁保满   备题组卷借口数据对接调整
1455
1456
        }
      },
8af7657f   梁保满   修改添加备题,组卷
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
      formatData(data) {
        if (this.subjectList.length) {
          this.subjectList.map((item) => {
            if (item.label == data.subjectName) {
              this.form.subjectName = item.value;
            }
          });
        } else {
          this.form.subjectName = "";
        }
  
        if (this.role != "ROLE_PERSONAL") {
          if (this.gradeList.length) {
            this.gradeList.map((item) => {
              if (item == data.gradeName) {
                this.form.gradeName = data.gradeName;
              }
            });
          } else {
            this.form.gradeName = "";
          }
        }
        this.form.questionList = data.questionList?.map((item) => {
e9713b69   梁保满   备题支持无大题
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
          if (item.subQuestions) {
            let subQuestions =
              item.subQuestions?.map((items) => {
                return {
                  ...items,
                  selectNum: items.answerOptions?.split(",").length,
                  answerOptions: items.answerOptions || "A,B,C,D",
                  screenshot: items.screenshot || "",
                  correctAnswer: items.correctAnswer || "",
                  knowledge: items.knowledge || "",
                };
              }) || [];
            return {
              questionTitle: item.questionTitle,
              subQuestions: subQuestions,
              show: false,
            };
          } else {
82235092   梁保满   导入或者修改答案没有答案报错,修改...
1498
            item.correctAnswer = item.correctAnswer || "";
e9713b69   梁保满   备题支持无大题
1499
1500
1501
1502
            return {
              ...item,
            };
          }
8af7657f   梁保满   修改添加备题,组卷
1503
        });
ddcd75d7   梁保满   教师二次管理数据问题
1504
      },
13b58a42   梁保满   备题组卷部分前端页面基本完成
1505
1506
1507
    },
  };
  </script>
8af7657f   梁保满   修改添加备题,组卷
1508
1509
  <style>
  .screenshot-box {
c6f2a550   梁保满   创建备题组卷,修改备题
1510
    width: 600px;
8af7657f   梁保满   修改添加备题,组卷
1511
  }
4c4f7640   梁保满   路由表,路由前端文件
1512
  
8af7657f   梁保满   修改添加备题,组卷
1513
1514
1515
1516
  .screenshot {
    width: 100%;
    box-shadow: none;
    border: none;
c6f2a550   梁保满   创建备题组卷,修改备题
1517
    height: 400px;
8af7657f   梁保满   修改添加备题,组卷
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
  }
  
  .screenshot-img {
    display: block;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    margin-bottom: 10px;
  }
  </style>
13b58a42   梁保满   备题组卷部分前端页面基本完成
1528
1529
1530
1531
  <style lang="scss" scoped>
  .red {
    color: #f30;
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1532
  
533a17d8   梁保满   备题组卷添加批量设置答案
1533
1534
  .qs-options {
    flex: 1;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1535
  
533a17d8   梁保满   备题组卷添加批量设置答案
1536
1537
1538
    .ipt {
      margin-bottom: 5px;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1539
  
533a17d8   梁保满   备题组卷添加批量设置答案
1540
1541
1542
1543
    .answer-box {
      .answer-s {
        cursor: pointer;
        user-select: none;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1544
1545
        margin-bottom: 10px;
  
533a17d8   梁保满   备题组卷添加批量设置答案
1546
1547
1548
1549
1550
        &:first-of-type {
          margin-left: 0;
        }
      }
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1551
1552
1553
1554
1555
  
    .answer-box2 {
      margin-bottom: 10px;
    }
  
533a17d8   梁保满   备题组卷添加批量设置答案
1556
1557
1558
    .delButton {
      text-indent: -9999999px;
      border-color: #ff6868;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1559
      background: #ff6868 url("../../assets/images/arrow.png") no-repeat center;
533a17d8   梁保满   备题组卷添加批量设置答案
1560
1561
1562
      background-size: 19px;
      color: transparent;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1563
  
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1564
1565
    .answer-s.ac {
      border: none;
11a4e518   梁保满   背题组卷修改答案设置,即使测随堂问...
1566
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1567
  
533a17d8   梁保满   备题组卷添加批量设置答案
1568
1569
1570
    .ac {
      border-color: #ff6868;
      background: #ff6868;
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1571
      color: #fff !important;
533a17d8   梁保满   备题组卷添加批量设置答案
1572
1573
1574
    }
  }
  
255e2506   梁保满   飞书bug及优化
1575
1576
  .sel2 {
    width: 480px;
e5ff81a1   阿宝   集团管理员接口
1577
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1578
  
533a17d8   梁保满   备题组卷添加批量设置答案
1579
1580
1581
1582
1583
1584
1585
  .set-ans-btn {
    width: 100%;
    padding: 10px 0 10px 630px;
    box-sizing: border-box;
    border-right: 1px solid #e2e2e2;
    border-bottom: 1px solid #e2e2e2;
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1586
  
255e2506   梁保满   飞书bug及优化
1587
1588
1589
  .content-box {
    width: 100%;
    height: 100%;
ca39cc52   阿宝   飞书问题处理
1590
1591
    overflow-y: auto;
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1592
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1593
1594
1595
  .content {
    width: 100%;
    box-sizing: border-box;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1596
1597
    padding: 0 24px;
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1598
1599
1600
    .ml-20 {
      margin-left: 20px;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1601
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1602
1603
1604
1605
1606
    .btn-box {
      text-align: right;
      margin-left: 140px;
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1607
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1608
1609
1610
1611
1612
1613
1614
  .dia-content {
    .dia-tit {
      font-size: 20px;
      color: #333;
      font-weight: 700;
      text-align: center;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1615
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1616
    .add-type {
818e50d7   梁保满   标签删除,修改
1617
1618
      width: 100%;
      margin-bottom: 10px;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1619
  
818e50d7   梁保满   标签删除,修改
1620
1621
1622
1623
      .js-set {
        margin: 2.5px 10px 0 0;
        font-size: 14px;
      }
13b58a42   梁保满   备题组卷部分前端页面基本完成
1624
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1625
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1626
1627
1628
1629
    .add-btn {
      margin-left: 20px;
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1630
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1631
1632
1633
1634
1635
  .el-message-box {
    :deep(.el-button--default) {
      color: #fff;
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1636
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1637
1638
1639
1640
  .add-box {
    display: flex;
    justify-content: center;
    align-items: center;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1641
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1642
1643
1644
1645
1646
1647
1648
1649
    .add-question {
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 16px;
      font-weight: bolder;
      padding: 2px;
      cursor: pointer;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1650
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1651
1652
1653
      .s1 {
        margin-left: 6px;
      }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1654
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1655
1656
1657
1658
      :deep(.el-icon-plus) {
        font-size: 24px;
        font-weight: 900;
      }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1659
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1660
1661
1662
1663
1664
      :deep(.el-button--mini.is-circle) {
        padding: 3px;
      }
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1665
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1666
1667
  .dialog-footer {
    text-align: center;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1668
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1669
1670
1671
1672
1673
1674
    :deep(.el-button) {
      border-radius: 20px;
      padding: 8px 20px 7px;
      margin: 0 12px;
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1675
  
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1676
1677
  .question-box {
    margin-bottom: 20px;
8af7657f   梁保满   修改添加备题,组卷
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
  
    .screenshot-box {
      width: 100%;
      border: 1px solid #e2e2e2;
      margin-bottom: 20px;
  
      .screenshot-img {
        margin: 0;
      }
    }
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1688
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1689
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1690
1691
  .question-title {
    line-height: 40px;
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1692
1693
1694
    display: flex;
    align-items: center;
    margin-bottom: 12px;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1695
  
503b6063   梁保满   判断题答案选项
1696
    .m20 {
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1697
      margin: 0 20px;
d32e461c   梁保满   备题组卷
1698
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1699
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1700
1701
1702
    .ipt {
      width: 300px;
      margin: 0 16px 0 10px;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1703
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1704
1705
1706
1707
1708
1709
      :deep(.el-input__inner) {
        border-radius: 20px;
        border-color: #667ffd;
        background: rgba($color: #667ffd, $alpha: 0.05);
      }
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1710
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1711
1712
1713
    .delete {
      margin-right: 8px;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1714
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1715
1716
1717
1718
1719
    .title-txt {
      margin-right: 20px;
      font-size: 16px;
      font-weight: 700;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1720
  
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1721
1722
1723
1724
1725
1726
    .el-icon-caret-right {
      font-size: 24px;
      color: #888;
      transition: all 0.4s;
      margin-right: 12px;
      cursor: pointer;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1727
  
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1728
1729
1730
1731
1732
      &.active {
        transform: rotate(90deg);
      }
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1733
  
3ba60a63   梁保满   发卡补卡,设备状态上传下载接口联调
1734
1735
  .questions-ul {
    border-left: 1px solid #e2e2e2;
c6f2a550   梁保满   创建备题组卷,修改备题
1736
1737
1738
1739
  
    &:first-child {
      border-top: 1px solid #e2e2e2;
    }
13b58a42   梁保满   备题组卷部分前端页面基本完成
1740
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1741
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1742
1743
1744
  .el-input-number {
    width: 140px;
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1745
  
f26ecfa4   阿宝   测试bug
1746
1747
1748
1749
1750
1751
  .answer-title {
    text-align: center;
    font-size: 20px;
    color: #333;
    font-weight: 700;
    padding-bottom: 20px;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1752
  
f26ecfa4   阿宝   测试bug
1753
1754
1755
1756
1757
1758
    .totals {
      font-size: 16px;
      color: #888;
      font-weight: normal;
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1759
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
  .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;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1772
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1773
1774
1775
1776
1777
1778
1779
      &.active {
        background: #5e78fa;
        border-color: #5e78fa;
        color: #fff;
      }
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1780
  
255e2506   梁保满   飞书bug及优化
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
  .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;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1794
  
255e2506   梁保满   飞书bug及优化
1795
1796
1797
1798
1799
1800
1801
      &.active {
        background: #5e78fa;
        border-color: #5e78fa;
        color: #fff;
      }
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1802
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1803
1804
1805
1806
  .sub-questions {
    width: 100%;
    display: flex;
    border-bottom: 1px solid #e2e2e2;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1807
  
ddcd75d7   梁保满   教师二次管理数据问题
1808
    & > div {
13b58a42   梁保满   备题组卷部分前端页面基本完成
1809
1810
1811
1812
1813
1814
1815
1816
      min-height: 40px;
      padding: 5px;
      flex-shrink: 0;
      border-right: 1px solid #e2e2e2;
      display: flex;
      justify-content: center;
      align-items: center;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1817
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1818
    .qs-num {
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1819
      width: 70px;
13b58a42   梁保满   备题组卷部分前端页面基本完成
1820
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1821
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1822
1823
1824
    .qs-type {
      width: 160px;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1825
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1826
1827
1828
1829
    .qs-score,
    .qs-partScore {
      width: 160px;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1830
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1831
1832
1833
    .qs-options {
      flex: 1;
    }
cb6ceaa8   梁保满   添加备题,组卷参数调整
1834
1835
  
    .qs-upload {
8af7657f   梁保满   修改添加备题,组卷
1836
1837
      width: 60px;
    }
cb6ceaa8   梁保满   添加备题,组卷参数调整
1838
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1839
    .qs-set {
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1840
      width: 60px;
13b58a42   梁保满   备题组卷部分前端页面基本完成
1841
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1842
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1843
1844
1845
1846
    .qs-options2 {
      text-align: left;
      justify-content: flex-start;
      padding-left: 20px;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1847
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1848
1849
1850
1851
      .answer-s {
        cursor: pointer;
      }
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1852
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1853
1854
1855
1856
1857
1858
1859
1860
1861
    :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);
      }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1862
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
1863
1864
1865
1866
1867
      .el-input__icon {
        line-height: 32px;
      }
    }
  }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1868
1869
1870
1871
1872
1873
1874
1875
1876
  
  .upload-box {
    .upload-demo {
      text-align: center;
    }
  
    .stem-pic {
      display: block;
      margin: 0 auto 20px;
77da338a   梁保满   自测问题修改
1877
1878
      max-width: 100%;
      max-height: 200px;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
1879
1880
1881
      object-fit: cover;
    }
  }
4c4f7640   梁保满   路由表,路由前端文件
1882
  </style>