From 5c236aa8ee143c1f0f23e738f92c0ebc21270549 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 02 四月 2024 16:26:28 +0800 Subject: [PATCH] 答题器bug修改 --- packageBookService/pages/bookServices/examination/questionList/index.wxss | 5 ++ packageBookService/pages/bookServices/examination/questionList/index.wxml | 1 packageBookService/pages/bookServices/examination/examination.js | 36 ++++++++--------- packageBookService/pages/bookServices/detail/index.js | 22 ++++++++-- packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss | 4 ++ 5 files changed, 43 insertions(+), 25 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss b/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss index 0fe64c9..8dd151b 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss @@ -257,4 +257,8 @@ .mock-price { color: #ff6c00; font-size: 36rpx; +} + +.t-radio__description { + width: 102%; } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 56c8ecc..1aa1212 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -999,13 +999,12 @@ this.setData({ applyResourceState: true }) - wx.showLoading({ - title: '鍔犺浇涓�', - }) - let role = wx.getStorageSync(app.config.userInfoKey).role + let role = JSON.parse(wx.getStorageSync(app.config.userInfoKey)).role if (role) { - debugger if (role == 'Teacher') { + wx.showLoading({ + title: '鍔犺浇涓�', + }) // 鐢宠鏁欏璧勬簮 let query = { topicIdOrRefCode: 'productDownLoad', @@ -1044,6 +1043,19 @@ } }) } + } else { + wx.showModal({ + title: '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', + content: '璇峰厛杩涜鏁欏笀璁よ瘉锛�', + complete: (res) => { + if (res.cancel) {} + if (res.confirm) { + wx.navigateTo({ + url: '/packageDomain/pages/teacherCertification/index', + }) + } + } + }) } }, // 鏁欏璧勬簮涓嬭浇鍓嶅線PC鎻愮ずDiialog diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js index 727756c..1baf9aa 100644 --- a/packageBookService/pages/bookServices/examination/examination.js +++ b/packageBookService/pages/bookServices/examination/examination.js @@ -775,8 +775,6 @@ 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 @@ -796,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') { @@ -813,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({ @@ -832,7 +837,6 @@ subjectiveTotal: this.data.subjectiveTotal + 1 }) } - } // cardList璧嬪�� let cardIndex = this.data.cardList.findIndex((item) => item.path == pathitem.productLinkPath) @@ -841,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 => { @@ -880,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() @@ -892,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') { // 绠�绛� 缈昏瘧 @@ -909,7 +909,6 @@ ) } } - // subjectiveGrade.value += item.score if (typeof item.answer == 'string') { questionList[index].isRight = item.answer == item.userAnswer[0] } else { @@ -925,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') { @@ -1322,12 +1320,6 @@ }, // 鑾峰彇閿欓闆� async getErrorDataList() { - // this.setData({ - // cardList: [{ - // catalogName: '閿欓闆�', - // infoList: [] - // }] - // }) this.setData({ cardList: [{ catalogName: '鍗曢�夐', @@ -1686,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 diff --git a/packageBookService/pages/bookServices/examination/questionList/index.wxml b/packageBookService/pages/bookServices/examination/questionList/index.wxml index f60fe31..02022f2 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.wxml +++ b/packageBookService/pages/bookServices/examination/questionList/index.wxml @@ -172,6 +172,7 @@ wx:key="contentIndex" > <t-checkbox + icon="rectangle" block="{{false}}" value="{{contentItem.value}}" style="background-color:{{isNight ? '#222' :'#F9F9F9'}}; display: flex; align-items: center; margin-bottom: 20rpx;" diff --git a/packageBookService/pages/bookServices/examination/questionList/index.wxss b/packageBookService/pages/bookServices/examination/questionList/index.wxss index 2fb3e19..d59420d 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.wxss +++ b/packageBookService/pages/bookServices/examination/questionList/index.wxss @@ -57,6 +57,7 @@ } .radio-item text { + display: inline-block; height: min-content; } @@ -95,7 +96,7 @@ } .checkbox-group { - --td-checkbox-icon-checked-color: #ff6c00; + --td-checkbox-icon-checked-color: #FF6C00; } .t-checkbox { @@ -163,6 +164,7 @@ } .analysis-text { + display: flex; color: #333333; font-size: 28rpx; margin-top: 20rpx; @@ -216,6 +218,7 @@ } .option-rich-img { + display: inline-block; max-width: 180rpx !important; height: auto; object-fit: contain; -- Gitblit v1.9.1