Blame view

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