Blame view

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