From 0546ca05a2d5308e661f78357c74ee534ad9d4e6 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Sat, 09 Oct 2021 17:18:43 +0800
Subject: [PATCH] bug

---
 src/views/startexam/index.vue |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/src/views/startexam/index.vue b/src/views/startexam/index.vue
index 05ba42a..7b0f31d 100644
--- a/src/views/startexam/index.vue
+++ b/src/views/startexam/index.vue
@@ -86,8 +86,8 @@
                       type="primary"
                       >下一题</el-button
                     >
-                    <!-- :disabled="timesIT" -->
                     <el-button
+                      :disabled="timesIT"
                       type="success"
                       @click="submitExam"
                       :title="
@@ -380,29 +380,14 @@
                 score: subjectData[i].score,
                 color: "#fff",
                 fontColor: "#000",
+                title: subjectData[i].subjectName,
               });
             }
-            //题目类型
-            // this.query.type = parseInt(this.subjectIds[0].type);
-            // 题目id
-            // this.query.subjectId = this.subjectIds[0].everyID;
-            this.updateSubjectIndex();
-            // 获取当前题目信息
-            getSubjectResultInfo({
-              id: this.subjectIds[0].everyID,
-            })
-              .then((response) => {
-                if (isNotEmpty(response.data.data)) {
-                  response.data.data.answer = "";
-                  this.setSubjectInfo(response.data.data);
-                }
-              })
-              .catch(() => {
-                messageFail(this, "获取题目失败!");
-              });
 
             //重载到当前题目
-            const nowObj = objs.examSubjectChoicesVO;
+            let nowObj = objs.examSubjectChoicesVO;
+            nowObj.answer = ""; //清除答案
+            // console.log(nowObj, "nowObj");
             for (var i = 0; i < this.subjectIds.length; i++) {
               if (nowObj.id == this.subjectIds[i].everyID) {
                 //定位显示题目
@@ -411,6 +396,7 @@
                 this.query.type = parseInt(this.subjectIds[i].type);
                 // 题目id
                 this.query.subjectId = this.subjectIds[i].everyID;
+                this.setSubjectInfo(nowObj);
               }
             }
             // 添加到答题卡
@@ -503,6 +489,7 @@
       }
       // console.log(this.subjectIds);
       // 获取题目ID列表
+      // console.log("subjectResponsesubjectResponsesubjectResponse");
       getSubjectIds(scoreId)
         .then((subjectResponse) => {
           const subjectData = subjectResponse.data.data;
@@ -675,7 +662,7 @@
             }
 
             this.setSubjectInfo(subject);
-
+            // console.log(subject);
             // store.dispatch('SetSubjectInfo', subject).then(() => { })
           }
           // 更新时间
@@ -998,7 +985,7 @@
     },
     setSubjectInfo(subject) {
       const ref = this.getSubjectRef();
-
+      // console.log(subject, "subject");
       if (isNotEmpty(ref)) {
         try {
           ref.setSubjectInfo(

--
Gitblit v1.9.3