瀏覽代碼

切换题目

谢杰标 2 年之前
父節點
當前提交
cf1e27bfad

+ 8 - 0
pages/learn/index.vue

@@ -1357,6 +1357,14 @@ export default {
               infoJson: JSON.stringify(infoJson),
             })
             .then((res) => {
+              if (res.data.code != 200) {
+                this.showUserConfirmInfo = false;
+                uni.showToast({
+                  icon: "none",
+                  title: res.data.msg,
+                });
+                return;
+              }
               if (res.data.data.pushInfo) {
                 uni.showToast({
                   icon: "none",

+ 25 - 33
pages2/bank/questionBank.vue

@@ -1070,7 +1070,8 @@ export default {
           }
           this.examData = res.data.data;
           this.allTimes = this.examData.answerTime * 60;
-          this.lastTime = this.examData.answerTime && this.examData.answerTime * 60;
+          this.lastTime =
+            this.examData.answerTime && this.examData.answerTime * 60;
           if (this.bankType == 2) {
             this.needBack = true;
           }
@@ -1622,8 +1623,6 @@ export default {
      * @param {Object} 多选确认
      */
     checkboxSubmit(bindex) {
-      // console.log('')
-      // if (this.questionList[bindex].ques) return;
       if (this.questionList[bindex].ques && this.bankType == 1) {
         return;
       }
@@ -1646,36 +1645,16 @@ export default {
       this.$set(this.questionList[bindex], "ques", arr);
       this.$u.toast("已确认答案");
       this.isDoOver();
-
-      // let isWrong = this.questionList[bindex].ques.some((item, i) => {
-      //   return this.questionList[bindex].ans.indexOf(item) == -1;
-      // })
-      // // 回答错误
-      // if (isWrong) {
-      //   this.$api
-      //     .examWrongRecord({
-      //       orderGoodsId: this.orderGoodsId,
-      //       examId: this.id,
-      //       goodsId: this.goodsId,
-      //       moduleExamId: this.moduleId || 0,
-      //       chapterExamId: this.chapterId || 0,
-      //       questionIds: [this.questionList[bindex].questionId],
-      //       recordId: this.recordId,
-      //     })
-      //     .then((res) => {});
-      // } else {
-      //   // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
-      //   // if(question) {
-      //   // 	this.$api.wrongRecordDelete({
-      //   // 		"examId": +this.id,
-      //   // 		"goodsId": +this.goodsId,
-      //   // 		"questionId": this.questionList[bindex].questionId,
-      //   // 	}).then(res => {
-      //   // 	})
-      //   // }
-      // }
+      // 切换下一题
+      if (
+        this.bankType != 1 &&
+        this.cgType != 9 &&
+        bindex != this.questionList.length - 1
+      ) {
+        this.current = bindex + 1;
+        this.getCollectInfo(this.current);
+      }
     },
-
     /**
      * @param {Object} 案例多选确认
      */
@@ -1705,6 +1684,14 @@ export default {
       this.$set(this.questionList[bindex].ques, ansIndex, arr);
       this.$u.toast("已确认答案");
       this.isDoOver();
+      // 切换下一题
+      if (
+        this.bankType != 1 &&
+        this.cgType != 9 &&
+        ansIndex != this.questionList[bindex].ques.length - 1
+      ) {
+        this.questionList[bindex].current += 1;
+      }
     },
 
     /**
@@ -2205,7 +2192,12 @@ export default {
       this.isDoOver();
     },
     isCheck(item, index) {
-      if (this.questionList[index].ques) {
+      // 案例题处理
+      let { ques, type, ans } = item;
+      if (type == 4) {
+        return ans.length == ques.length;
+      }
+      if (ques) {
         return true;
       }
     },

+ 18 - 1
pages2/bank/questionBankContinue.vue

@@ -1217,6 +1217,15 @@ export default {
 
       this.$set(this.questionList[bindex], "ques", arr);
       this.isDoOver();
+      // 切换下一题
+      if (
+        this.bankType != 1 &&
+        this.cgType != 9 &&
+        bindex != this.questionList.length - 1
+      ) {
+        this.current = bindex + 1;
+        this.getCollectInfo(this.current);
+      }
     },
 
     /**
@@ -1243,6 +1252,14 @@ export default {
 
       this.$set(this.questionList[bindex].ques, ansIndex, arr);
       this.isDoOver();
+      // 切换下一题
+      if (
+        this.bankType != 1 &&
+        this.cgType != 9 &&
+        ansIndex != this.questionList[bindex].ques.length - 1
+      ) {
+        this.questionList[bindex].current += 1;
+      }
     },
 
     judgeSelect(index, bindex) {
@@ -1272,7 +1289,7 @@ export default {
     leaveNow() {
       this.needBack = false;
       this.isSubmit = true;
-      this.submit(false)
+      this.submit(false);
       uni.navigateBack({
         delta: 1,
       });

+ 23 - 12
pages2/class/questionBank.vue

@@ -2056,17 +2056,15 @@ export default {
       this.$u.toast("已确认答案");
       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((item, i) => {
-      //   return this.questionList[bindex].ans.indexOf(item) == -1;
-      // })
+      // 切换下一题
+      if (
+        this.bankType != 1 &&
+        this.cgType != 9 &&
+        bindex != this.questionList.length - 1
+      ) {
+        this.current = bindex + 1;
+        this.getCollectInfo(this.current);
+      }
     },
 
     /**
@@ -2098,6 +2096,14 @@ export default {
       this.$set(this.questionList[bindex].ques, ansIndex, arr);
       this.$u.toast("已确认答案");
       this.isDoOver();
+      // 切换下一题
+      if (
+        this.bankType != 1 &&
+        this.cgType != 9 &&
+        ansIndex != this.questionList[bindex].ques.length - 1
+      ) {
+        this.questionList[bindex].current += 1;
+      }
     },
 
     /**
@@ -2495,7 +2501,12 @@ export default {
       this.isDoOver();
     },
     isCheck(item, index) {
-      if (this.questionList[index].ques) {
+      // 案例题处理
+      let { ques, type, ans } = item;
+      if (type == 4) {
+        return ans.length == ques.length;
+      }
+      if (ques) {
         return true;
       }
     },

+ 1 - 0
pages2/subject/wrongTypeBank.vue

@@ -985,6 +985,7 @@ export default {
             .then((res) => {});
         }
       }
+      
     },
 
     /**

+ 23 - 10
pages5/examBank/index.vue

@@ -1582,15 +1582,15 @@ export default {
       this.$set(this.questionList[bindex], "ques", arr);
       this.$u.toast("已确认答案");
       this.isDoOver();
-      console.log("this.questionList[bindex]", this.questionList[bindex].ques);
-      // let isWrong = this.questionList[bindex].ques.some(
-      //   (quesItem, quesIndex) => {
-      //     return (
-      //       this.questionList[bindex].ques[quesIndex] !=
-      //       this.questionList[bindex].ans[quesIndex]
-      //     );
-      //   }
-      // );
+      // 切换下一题
+      if (
+        this.bankType != 1 &&
+        this.cgType != 9 &&
+        bindex != this.questionList.length - 1
+      ) {
+        this.current = bindex + 1;
+        this.getCollectInfo(this.current);
+      }
     },
 
     /**
@@ -1622,6 +1622,14 @@ export default {
       this.$set(this.questionList[bindex].ques, ansIndex, arr);
       this.$u.toast("已确认答案");
       this.isDoOver();
+      // 切换下一题
+      if (
+        this.bankType != 1 &&
+        this.cgType != 9 &&
+        ansIndex != this.questionList[bindex].ques.length - 1
+      ) {
+        this.questionList[bindex].current += 1;
+      }
     },
 
     /**
@@ -2009,7 +2017,12 @@ export default {
     },
 
     isCheck(item, index) {
-      if (this.questionList[index].ques) {
+      // 案例题处理
+      let { ques, type, ans } = item;
+      if (type == 4) {
+        return ans.length == ques.length;
+      }
+      if (ques) {
         return true;
       }
     },