Преглед изворни кода

选择题题目不一致问题修改

SanHQin пре 3 недеља
родитељ
комит
c415f6a0a5

+ 10 - 1
src/views/Student/components/answerTheResult.vue

@@ -267,8 +267,17 @@ const choiceQuestionList = () => {
         const _studentContent: any = JSON.parse(
           decodeURIComponent(studentWork.content)
         ).testJson
+        // let _studentContentCorrection = []
+        // console.log(_workData)
+        // console.log(_studentContent)
+        // _studentContentCorrection = _workData.map((i:any) => {
+        //   return _studentContent.find((i2:any) => {
+        //     return (JSON.stringify({testtitle: i2.testtitle, checkList: i2.checkList, timuList: i2.timuList}) === JSON.stringify({testtitle: i.testtitle, checkList: i.checkList, timuList: i.timuList}))
+        //   })
+        // })
+        // console.log(_studentContentCorrection)
         _studentContent.forEach((test: any, testIndex: number) => {
-          if (test.userAnswer || test.userAnswer === 0) {
+          if (_workData[testIndex] && JSON.stringify({testtitle: test.testtitle, checkList: test.checkList, timuList: test.timuList}) === JSON.stringify({testtitle: _workData[testIndex].testtitle, checkList: _workData[testIndex].checkList, timuList: _workData[testIndex].timuList}) && (test.userAnswer || test.userAnswer === 0)) {
             if (Array.isArray(test.userAnswer)) {
               test.userAnswer.forEach((ch: number) => {
                 _workData[testIndex].choiceUser[ch].user.push(studentWork.name)

+ 2 - 2
src/views/Student/components/choiceQuestionDetailDialog.vue

@@ -17,7 +17,7 @@
         v-if="workDetail && workDetail.type === '45' && props.showData"
       >
         <div class="c_t45_title">
-          <div>{{
+          <div v-if=" props.showData.choiceQuestionListData[props.showData.workIndex]">{{
             props.showData.choiceQuestionListData[props.showData.workIndex]
               .teststitle
           }}</div>
@@ -30,7 +30,7 @@
             props.showData.choiceQuestionListData[props.showData.workIndex]
               .timuList[0].src
           "
-          v-if="
+          v-if=" props.showData.choiceQuestionListData[props.showData.workIndex] &&
             props.showData.choiceQuestionListData[props.showData.workIndex]
               .timuList.length > 0
           "