Blame view

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