Browse Source

fix:多选题选错的情况

xuqiaoying 3 years ago
parent
commit
48b35bb5f8
3 changed files with 33 additions and 24 deletions
  1. 11 8
      components/bank-exam/bankExam.vue
  2. 11 8
      pages2/bank/questionBank.vue
  3. 11 8
      pages2/class/questionBank.vue

+ 11 - 8
components/bank-exam/bankExam.vue

@@ -1231,14 +1231,17 @@ export default {
 		  this.$set(this.questionList[bindex], "ques", arr);
 		  this.isDoOver();
 		
-		  let isWrong = this.questionList[bindex].ques.some(
-		    (quesItem, quesIndex) => {
-		      return (
-		        this.questionList[bindex].ques[quesIndex] !=
-		        this.questionList[bindex].ans[quesIndex]
-		      );
-		    }
-		  );
+		//   let isWrong = this.questionList[bindex].ques.some(
+		//     (quesItem, quesIndex) => {
+		//       return (
+		//         this.questionList[bindex].ques[quesIndex] !=
+		//         this.questionList[bindex].ans[quesIndex]
+		//       );
+		//     }
+		//   );
+		  	let isWrong = this.questionList[bindex].ques.some((item, i) => {
+			return this.questionList[bindex].ans.indexOf(item) == -1;
+			})
 		  // 回答错误
 		  if (isWrong) {
 		    this.$api

+ 11 - 8
pages2/bank/questionBank.vue

@@ -1766,14 +1766,17 @@ export default {
       this.$set(this.questionList[bindex], "ques", arr);
       this.isDoOver();
 
-      let isWrong = this.questionList[bindex].ques.some(
-        (quesItem, quesIndex) => {
-          return (
-            this.questionList[bindex].ques[quesIndex] !=
-            this.questionList[bindex].ans[quesIndex]
-          );
-        }
-      );
+      // let isWrong = this.questionList[bindex].ques.some(
+      //   (quesItem, quesIndex) => {
+      //     return (
+      //       this.questionList[bindex].ques[quesIndex] !=
+      //       this.questionList[bindex].ans[quesIndex]
+      //     );
+      //   }
+      // );
+      let isWrong = this.questionList[bindex].ques.some((item, i) => {
+        return this.questionList[bindex].ans.indexOf(item) == -1;
+      })
       // 回答错误
       if (isWrong) {
         this.$api

+ 11 - 8
pages2/class/questionBank.vue

@@ -1884,14 +1884,17 @@ export default {
       this.$set(this.questionList[bindex], "ques", arr);
       this.isDoOver();
 
-      let isWrong = this.questionList[bindex].ques.some(
-        (quesItem, quesIndex) => {
-          return (
-            this.questionList[bindex].ques[quesIndex] !=
-            this.questionList[bindex].ans[quesIndex]
-          );
-        }
-      );
+      // let isWrong = this.questionList[bindex].ques.some(
+      //   (quesItem, quesIndex) => {
+      //     return (
+      //       this.questionList[bindex].ques[quesIndex] !=
+      //       this.questionList[bindex].ans[quesIndex]
+      //     );
+      //   }
+      // );
+      let isWrong = this.questionList[bindex].ques.some((item, i) => {
+        return this.questionList[bindex].ans.indexOf(item) == -1;
+      })
     },
 
     /**