xuqiaoying 3 yıl önce
ebeveyn
işleme
9104b75e51
1 değiştirilmiş dosya ile 24 ekleme ve 10 silme
  1. 24 10
      src/pages/mock-exam/index.vue

+ 24 - 10
src/pages/mock-exam/index.vue

@@ -92,6 +92,7 @@
                             }"
                             v-for="(item, index) in question.jsonStr"
                             :key="index"
+                            @click="radioSelect(question, questionIndex, item.optionsId)"
                           >
                             <div>
                               {{ ast[index] }}. {{ item.content }}
@@ -122,6 +123,7 @@
                       </div>
                       <div class="question__btns"></div>
                     </div>
+                    
                     <div
                       class="question"
                       v-if="question.type == 2 && current == questionIndex"
@@ -207,7 +209,7 @@
                       </div>
                       <div class="question__btns">
                         <div
-                          v-if="!question.ques"
+                          v-if="bankType == 2 || (bankType == 1 && !question.ques)"
                           class="submit"
                           @click="checkboxSubmit(question, questionIndex)"
                         >
@@ -215,6 +217,7 @@
                         </div>
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 3 && current == questionIndex"
@@ -933,10 +936,11 @@
                           v-for="(item, index) in questionList"
                           :key="index"
                           :class="{
-                            green: isRight(item, index),
-                            red: isWrong(item, index),
-                            yellow: isPart(item, index),
-                            blue: isOver(item, index),
+                            green: bankType == 1 && isRight(item, index),
+                            red: bankType == 1 && isWrong(item, index),
+                            yellow: bankType == 1 && isPart(item, index),
+                            blue: bankType == 1 && isOver(item, index),
+                            check_ans: bankType == 2 && isCheck(item, index),
                           }"
                           @click="changeIndex(index)"
                         >
@@ -1565,7 +1569,10 @@ export default {
      * 单选点击确认
      */
     radioSelect(question, questionIndex, optionsId) {
-      if (this.questionList[questionIndex].ques) return;
+      // if (this.questionList[questionIndex].ques) return;
+      if (this.questionList[questionIndex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex], "ques", optionsId);
       this.isDoOver();
     },
@@ -1809,6 +1816,11 @@ export default {
         this.getCollectInfo(this.current);
       }
     },
+    isCheck(item, index) {
+      if (this.questionList[index].ques) {
+        return true
+      }
+    },
     isRight(item, index) {
       //单选
       if (this.questionList[index].ques) {
@@ -2580,12 +2592,15 @@ export default {
                       border-radius: 8px;
                       box-sizing: border-box;
 
-                      &.right, &.user_choose {
+                      &.right {
                         background: #37c65b;
                       }
                       &.wrong {
                         background: #ff3a30;
                       }
+                      &.user_choose {
+                        background: #007aff;
+                      }
                     }
                     &.textarea {
                       margin-right: 12px;
@@ -2859,7 +2874,7 @@ export default {
                       &.yellow {
                         background: #ffc53d;
                       }
-                      &.blue {
+                      &.blue, &.check_ans {
                         background: #3f8dfd;
                       }
                     }
@@ -2916,8 +2931,7 @@ export default {
                         background: #ff3a30;
                       }
 
-                      &.blue {
-                        border: 1rpx solid #eeeeee;
+                      &.blue, &.check_ans {
                         color: #fff;
                         background: #3f8dfd;
                       }