Quellcode durchsuchen

考试相关功能优化和bug修复

luoaoxuan vor 1 Jahr
Ursprung
Commit
e3e2c8c2dd

+ 1 - 1
src/views/platform/examination/exam/detail.vue

@@ -420,7 +420,7 @@ export default {
                                 result.push({
                                     ...item,
                                     totalCount: data.length,
-                                    totalScore: parseFloat(item.totalScore),
+                                    totalScore: item.isRand === '1' ? parseFloat(item.randScore) : parseFloat(item.totalScore),
                                     statusList: [item.paperState],
                                     scoreList: [parseFloat(item.score || -1)]
                                 })

+ 2 - 2
src/views/platform/examination/exam/edit.vue

@@ -78,7 +78,7 @@
                         <i class="el-icon-question question-icon">:</i>
                     </el-tooltip>
                 </template>
-                <el-radio-group v-model="form.sui_ji_chou_ti_">
+                <el-radio-group v-model="form.sui_ji_chou_ti_" :disabled="isDisabled">
                     <el-radio label="0">关闭</el-radio>
                     <el-radio label="1" :disabled="!(!!form.ti_ku_id_)">开启</el-radio>
                 </el-radio-group>
@@ -103,7 +103,7 @@
                             :min="0"
                             :max="item.list.length"
                             :precision="0"
-                            :disabled="form.sui_ji_chou_ti_ === '0'"
+                            :disabled="form.sui_ji_chou_ti_ === '0' || isDisabled"
                             placeholder="请输入抽题数量"
                             :step="item.step"
                             step-strictly

+ 13 - 2
src/views/platform/examination/questionBank/detail.vue

@@ -224,7 +224,7 @@
                     <el-card
                         class="timeline-card"
                         :class="paper.dataId === showPaperId ? 'active-card' : ''"
-                        @click.native="changePaper(paper.dataId)"
+                        @click.native="changePaper(paper.dataId,paper.status)"
                     >
                         <div class="card-item">{{ `开始时间:${paper.startTime}` }}</div>
                         <div class="card-item">{{ `结束时间:${paper.endTime}` }}</div>
@@ -360,6 +360,13 @@ export default {
             this.paperData =
         this.paperList.find((i) => i.dataId === this.id) || this.paperList[0]
             this.showPaperId = this.paperData.dataId
+
+            const isAllNotFinish = this.paperList.every(item => item.status !== '已完成')
+            if (isAllNotFinish) {
+                this.$message.error('考试未完成或未评分,请稍后再试!')
+                this.closeDialog()
+                return
+            }
         },
         handleActionEvent ({ key }) {
             switch (key) {
@@ -512,7 +519,11 @@ export default {
                     })
             })
         },
-        changePaper (id) {
+        changePaper (id, status) {
+            if (status !== '已完成') {
+                this.$message.error('考试未完成或未评分,暂时无法查看!')
+                return
+            }
             this.showPaperId = id
             this.paperData = this.paperList.find((i) => i.dataId === id)
             console.log(id)

+ 5 - 1
src/views/platform/examination/questionBank/test.vue

@@ -412,7 +412,9 @@ export default {
             if (this.showIndex === this.questionList.length) {
                 return
             }
-            this.showIndex++
+            setTimeout(() => {
+                this.showIndex++
+            }, 200)
         },
         getScore ({ questionType, answer, rightKey, score }) {
             if (questionType === '多选题') {
@@ -610,6 +612,8 @@ export default {
                 }
             }
             .question-link {
+                overflow: auto;
+                max-height: 150px;
                 display: flex;
                 flex-wrap: wrap;
                 justify-content: flex-start;