From f0229b7c6801f6429dec75e208192b61053b8c7d Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期三, 03 四月 2024 09:46:02 +0800
Subject: [PATCH] 书目

---
 packageBookService/pages/bookServices/examination/examination.js |   52 ++++++++++++++++++++++++++--------------------------
 1 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js
index b10cd73..1baf9aa 100644
--- a/packageBookService/pages/bookServices/examination/examination.js
+++ b/packageBookService/pages/bookServices/examination/examination.js
@@ -295,7 +295,9 @@
   viewParsing() {
     if (this.data.answerType == 'collectQuestion' || this.data.answerType == 'errorQuestion') {
       const item = this.data.questionDataList[this.data.currentIndex]
-      if (!item.isComplete) this.handleQuestion(this.data.currentIndex)
+      if (!item.isComplete) {
+        this.handleQuestion(this.data.currentIndex)
+      }
     }
   },
   // 鐐瑰嚮绛旈鍗¤烦杞鐩�
@@ -768,13 +770,11 @@
             questionObj.questionType == 'multipleChoice'
           ) {
             try {
-              questionObj.answer = JSON.parse(questionObj.answer)
+              questionObj.answer = JSON.parse(questionObj.answer).toString()
             } catch (error) {
               questionObj.answer = item.Embedded_QuestionBank_Answer
             }
           }
-          // questionObj.userAnswer = this.arrayToString(questionObj.userAnswer)
-          // questionObj.isHaveAnswer = this.isHaveAnswer(questionObj.userAnswer)
           // 濉┖棰樻敼閫�
           if (questionObj.questionType == 'completion') {
             let index = 0
@@ -794,13 +794,16 @@
           if (questionObj.stemStyle == 'RichText') {
             // questionObj.option.txt = ''
             questionObj.stem.stemTxt = questionObj.stem.stemTxt.replace(/\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ').replace(/\<p/gi, '<p class="stem-rich-p"')
-
           }
           // 閫夐」瀵屾枃鏈鐞�
           if (questionObj.optionStyle == 'RichText' && (questionObj.questionType == 'singleChoice' || questionObj.questionType == 'judge' || questionObj.questionType == 'multipleChoice')) {
             questionObj.option.forEach(item => {
               if (item.txt) item.txt = item.txt.replace(/\<img/gi, '<img class="option-rich-img"').replace(/\<p/gi, '<p class="stem-rich-p"')
             })
+          }
+          // 瑙f瀽瀵屾枃鏈鐞� 
+          if (questionObj.analysisCon && typeof questionObj.analysisCon == 'string') {
+            questionObj.analysisCon = questionObj.analysisCon.replace(/\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ')
           }
           // 鑾峰彇鍥剧墖
           if (questionObj.stemStyle == 'Image' || questionObj.stemStyle == 'TxtAndImage') {
@@ -811,13 +814,17 @@
               if (optionItem.img) optionItem.img = getPublicImage(optionItem.img, 150)
             })
           }
+          // 瀹㈣棰樻�诲垎璧嬪��
+          if (questionObj.questionType !== 'shortAnswer') {
+            this.setData({
+              subjectiveGrade: this.data.subjectiveGrade + 2
+            })
+          }
           // if (questionObj.optionStyle == 'RichText') {
           //   questionObj.option.forEach(optionItem => {
           //     optionItem.txt.replace(/<img>/g, "<img class='imgClass'>")
           //   })
           // }
-          // 鏃ф暟鎹噷 棰樼洰宸茬粡浣滅瓟锛屼慨鏀瑰凡绛旈鐩暟閲�
-          // if (oldObj && oldObj.userAnswer.length > 0) countDownRef.value.changeAlready()
           // 鏃ф暟鎹噷 棰樼洰姝g‘ 璁板綍姝g‘鏁伴噺
           if (questionObj.isRight) {
             this.setData({
@@ -830,7 +837,6 @@
                 subjectiveTotal: this.data.subjectiveTotal + 1
               })
             }
-
           }
           // cardList璧嬪��
           let cardIndex = this.data.cardList.findIndex((item) => item.path == pathitem.productLinkPath)
@@ -839,11 +845,9 @@
           this.setData({
             [`cardList[${cardIndex}].infoList`]: infoList
           })
-          //   this.data.cardList[this.data.cardList.findIndex((item) => item.path == pathitem.productLinkPath)]
-          //     .infoList
-          // infoList.push(questionObj)
           flag++;
           let questionList = []
+          let grade = 0
           const cardUpdatedList = this.data.cardList
           // if (flag == this.data.idPathList.length) {
           cardUpdatedList.forEach(aitem => {
@@ -878,7 +882,6 @@
     // 鎵规敼棰樼洰
     if (item.questionType == 'multipleChoice') {
       // 澶氶�夐
-      // subjectiveGrade.value += item.score
       if (item.answer.length == item.userAnswer.length) {
         const sortedArr1 = item.answer.slice().sort()
         const sortedArr2 = item.userAnswer.slice().sort()
@@ -890,7 +893,6 @@
       }
     } else if (item.questionType == 'singleChoice' || item.questionType == 'judge') {
       // 鍗曢�� 鍒ゆ柇
-      // subjectiveGrade.value += item.score
       questionList[index].isRight = item.answer == item.userAnswer
     } else if (item.questionType == 'shortAnswer') {
       // 绠�绛� 缈昏瘧
@@ -907,7 +909,6 @@
           )
         }
       }
-      // subjectiveGrade.value += item.score
       if (typeof item.answer == 'string') {
         questionList[index].isRight = item.answer == item.userAnswer[0]
       } else {
@@ -923,7 +924,6 @@
     if (item.questionType != 'shortAnswer') {
       this.setData({
         subjectiveTotal: this.data.subjectiveTotal + 1,
-        subjectiveGrade: this.data.subjectiveGrade + item.score
       })
     }
     if (questionList[index].isRight && item.questionType != 'shortAnswer') {
@@ -1200,9 +1200,9 @@
             questionObj.questionType == 'multipleChoice'
           ) {
             try {
-              questionObj.answer = JSON.parse(questionObj.answer)
+              questionObj.answer = JSON.parse(questionObj.answer).toString()
             } catch (error) {
-              //
+              questionObj.answer = item.Embedded_QuestionBank_Answer
             }
           }
           // 濉┖棰樻敼閫�
@@ -1320,12 +1320,6 @@
   },
   // 鑾峰彇閿欓闆�
   async getErrorDataList() {
-    // this.setData({
-    //   cardList: [{
-    //     catalogName: '閿欓闆�',
-    //     infoList: []
-    //   }]
-    // })
     this.setData({
       cardList: [{
         catalogName: '鍗曢�夐',
@@ -1400,9 +1394,9 @@
           questionObj.questionType == 'multipleChoice'
         ) {
           try {
-            questionObj.answer = JSON.parse(questionObj.answer)
+            questionObj.answer = JSON.parse(questionObj.answer).toString()
           } catch (error) {
-            //
+            questionObj.answer = item.Embedded_QuestionBank_Answer
           }
         }
         // 濉┖棰樻敼閫�
@@ -1644,7 +1638,7 @@
             questionObj.questionType == 'multipleChoice'
           ) {
             try {
-              questionObj.answer = JSON.parse(questionObj.answer)
+              questionObj.answer = JSON.parse(questionObj.answer).toString()
             } catch (error) {
               questionObj.answer = item.Embedded_QuestionBank_Answer
             }
@@ -1684,6 +1678,12 @@
               if (optionItem.img) optionItem.img = getPublicImage(optionItem.img, 150)
             })
           }
+          // 瀹㈣棰樻�诲垎璧嬪��
+          if (questionObj.questionType !== 'shortAnswer') {
+            this.setData({
+              subjectiveGrade: this.data.subjectiveGrade + questionObj.score
+            })
+          }
           if (oldObj && oldObj.isRight) {
             this.setData({
               correctNum: this.data.correctNum + 1

--
Gitblit v1.9.1