Blame view

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