Browse Source

修改h5问题

aaa 3 years ago
parent
commit
d54a407505

+ 2 - 2
src/views/home/answer/page-answer-recruit.vue

@@ -654,7 +654,7 @@ export default {
             name: "answerRecruitResult",
             params: {
               allQuestionsNum: this.examQuestionList.length,
-              grades: num
+              rightNum: num
             }
           });
         })
@@ -687,7 +687,7 @@ export default {
             name: "answerRecruitResult",
             params: {
               allQuestionsNum: this.examQuestionList.length,
-              grades: num
+              rightNum: num
             }
           });
         })

+ 45 - 23
src/views/home/answer/through/through-question-doing.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="page-through-question-box">
-    <van-nav-bar v-if="env!=='pro'" title="闯关答题" left-arrow @click-left="handleBackFun" />
+    <van-nav-bar
+      v-if="env !== 'pro'"
+      title="闯关答题"
+      left-arrow
+      @click-left="handleBackFun"
+    />
     <!-- 题目卡片 -->
     <div v-if="answerThroughNumber" class="through-question-div">
       <div class="through-question-card">
@@ -30,7 +35,7 @@
         <div class="through-question-describe">
           {{
             examQuestionList[answerIndex].questionContent ||
-              examQuestionList[answerIndex].content
+            examQuestionList[answerIndex].content
           }}
         </div>
         <!-- 答题列表 -->
@@ -38,9 +43,8 @@
         <div
           v-if="
             examQuestionList[answerIndex].type === questionType.TrueOrFalse ||
-              examQuestionList[answerIndex].type ===
-                questionType.singleChoice ||
-              examQuestionList[answerIndex].type === questionType.multipleChoice
+            examQuestionList[answerIndex].type === questionType.singleChoice ||
+            examQuestionList[answerIndex].type === questionType.multipleChoice
           "
           class="through-question-options"
         >
@@ -49,11 +53,10 @@
             :key="index"
             :class="{
               'through-question-options-item': true,
-              'through-question-options-item-checked': answerValue.includes(
-                item
-              ),
+              'through-question-options-item-checked':
+                answerValue.includes(item),
               'through-question-options-false':
-                answerValue.includes(item) && answerStatus === 2
+                answerValue.includes(item) && answerStatus === 2,
             }"
             @click="handleExamQuestionOptionsItemFun(item)"
           >
@@ -79,8 +82,7 @@
           />
         </div>
         <div v-else class="through-question-button-box">
-          <div class="through-question-single-button-box">
-          </div>
+          <div class="through-question-single-button-box"></div>
           <div class="through-question-single-button-box">
             <van-button
               v-show="answerStatus === 0"
@@ -410,24 +412,43 @@ export default {
       // return isSure;
       let isSure = false;
       let lastAnswer = [""];
-      lastAnswer[0] = this.getUserAnswerSortFun(item);
-      if (lastAnswer[0] === item.finalAnswer[0]) {
-        isSure = true;
+      lastAnswer = this.getUserAnswerSortFun(item);
+      for (let i = 0; i < item.finalAnswer.length; i++) {
+        if (lastAnswer[i] && lastAnswer[i] === item.finalAnswer[i]) {
+          isSure = true;
+        } else {
+          isSure = false;
+          break;
+        }
       }
       return isSure;
     },
     // 获取用户所选选项的升序编号答案
     getUserAnswerSortFun(item) {
       let newUnserAnswer = [];
-      item.answers.forEach((itemOne, indexOne) => {
-        item.userAnswer.forEach(itemTwo => {
-          if (itemOne === itemTwo) {
-            newUnserAnswer.push(this.formatQuestionIndex(indexOne));
-          }
-        });
-      });
-      newUnserAnswer.sort();
-      return newUnserAnswer.join("");
+      switch (item.type) {
+        case this.questionType.singleChoice:
+        case this.questionType.multipleChoice:
+        case this.questionType.TrueOrFalse:
+          let arr = [];
+          item.answers.forEach((itemOne, indexOne) => {
+            item.userAnswer.forEach(itemTwo => {
+              if (itemOne === itemTwo) {
+                arr.push(this.formatQuestionIndex(indexOne));
+              }
+            });
+          });
+          arr = arr.sort();
+          newUnserAnswer = [arr.join("")];
+          break;
+        case this.questionType.gapFilling:
+          newUnserAnswer = item.answers;
+          break;
+        default:
+          break;
+      }
+      // return newUnserAnswer.join("");
+      return newUnserAnswer;
     },
     // 操作:下一题
     handleNextFun() {
@@ -506,6 +527,7 @@ export default {
       return result;
     },
     // 方法:获取题目的答案
+
     getUserExamAllAnswersFun() {
       let answers = [];
       this.examQuestionList.forEach((item, index) => {

+ 4 - 4
src/views/home/learn/page-learn-content.vue

@@ -31,6 +31,9 @@
           {{ contentObj.contents }}
         </p>
         <div v-if="contentObj.type == 'VIDEO'">
+          <div class="learn-content-body-title p-content" style="margin-top: 0.5rem">
+            {{ contentObj.name }}
+          </div>
           <video
             :poster="getContentObj(contentObj.contents).faceUrl"
             :src="getContentObj(contentObj.contents).videoUrl"
@@ -38,11 +41,8 @@
           >
             您的浏览器不支持 video 标签。
           </video>
-          <div class="learn-content-body-title" style="margin-top: 0.5rem;">
-            {{ contentObj.name }}
-          </div>
         </div>
-        <div style="margin-top: 0.5rem;">
+        <div style="margin-top: 0.5rem">
           <!-- <div>附件</div> -->
           <div
             v-for="(item, index) in contentObj.links"