dedsudiyu 12 hours ago
parent
commit
1d6d0dcfd7

+ 49 - 0
src/api/safetyEducationExaminationNew/index.js

@@ -585,6 +585,15 @@ export function examElExamAttemptAnswerAttemptAnswer(data) {
     data: data
   })
 }
+//知识点下错题列表
+export function examUserPracticeWrongQuestions(data) {
+  return request({
+    url: '/exam/user/practice/wrongQuestions',
+    method: 'post',
+    data: data
+  })
+}
+
 //我的证书列表
 export function examUserCertificateList(data) {
   return request({
@@ -649,4 +658,44 @@ export function examUserPracticeQuestionDetail(query) {
     params: query
   })
 }
+//课程下的课件列表
+export function examUserCourseLearningCoursewareList(query) {
+  return request({
+    url: '/exam/user/course/learning/coursewareList',
+    method: 'get',
+    params: query
+  })
+}
+//课件学习完成确认
+export function examUserCoursewareLearningConfirmCompletion(data) {
+  return request({
+    url: '/exam/user/courseware/learning/confirmCompletion',
+    method: 'post',
+    data: data
+  })
+}
+//重新开始学习课件
+export function examUserCoursewareLearningRestart(data) {
+  return request({
+    url: '/exam/user/courseware/learning/restart',
+    method: 'post',
+    data: data
+  })
+}
+//上报课件学习进度
+export function examUserCoursewareLearningReportProgress(data) {
+  return request({
+    url: '/exam/user/courseware/learning/reportProgress',
+    method: 'post',
+    data: data
+  })
+}
+//开始训练获取-左侧题目列表
+export function examUserPracticeTrainPanel(data) {
+  return request({
+    url: '/exam/user/practice/train/panel',
+    method: 'post',
+    data: data
+  })
+}
 

+ 186 - 0
src/utils/timerUtils/WarningCountdown.js

@@ -0,0 +1,186 @@
+/**
+ * 考试倒计时预警器工具类 (绝对时间戳版)
+ * 适用场景:固定时长的考试倒计时,切屏/休眠不暂停
+ */
+export default class WarningCountdown {
+  /**
+   * @param {Object} options 配置项
+   * @param {Number} options.totalSeconds - 倒计时总秒数
+   * @param {Function} options.onTick - 每秒回调,返回当前剩余秒数
+   * @param {Function} options.onWarning - 触发预警时的回调 (剩余秒数)
+   * @param {Function} options.onFinished - 倒计时结束时的回调
+   */
+  constructor(options) {
+    this.totalSeconds = options.totalSeconds || 0;
+    this.onTick = options.onTick || (() => {});
+    this.onWarning = options.onWarning || (() => {});
+    this.onFinished = options.onFinished || (() => {});
+
+    // 内部状态
+    this.remainingTime = this.totalSeconds;
+    this.isRunning = false;
+    this.isFinished = false;
+    this.isManualPaused = false;
+    this.isWarningTriggered = false; // 预警是否已触发
+    this.timerId = null;
+
+    // ⚠️ 核心:绝对结束时间戳(不受切屏、休眠影响)
+    this.endTimeStamp = 0;
+
+    // ⚠️ 移除 visibilitychange 监听,考试倒计时不需要切屏暂停
+  }
+
+  /**
+   * 获取当前剩余秒数
+   */
+  getRemainingSeconds() {
+    return this.remainingTime;
+  }
+
+  /**
+   * 内部核心:启动定时器
+   */
+  _startEngine() {
+    // 如果是首次启动,计算绝对结束时间
+    if (this.endTimeStamp === 0) {
+      this.endTimeStamp = Date.now() + this.remainingTime * 1000;
+    }
+
+    this.timerId = setInterval(() => {
+      const now = Date.now();
+      // ⚠️ 核心:直接用绝对结束时间减去当前时间,得出剩余秒数
+      const rawRemaining = (this.endTimeStamp - now) / 1000;
+      const newRemaining = Math.ceil(rawRemaining > 0 ? rawRemaining : 0);
+
+      // 1. 更新剩余时间
+      this.remainingTime = newRemaining;
+
+      // 2. 每秒通知
+      this.onTick(this.remainingTime);
+
+      // 3. 预警逻辑判断
+      if (!this.isWarningTriggered && this.remainingTime > 0) {
+        const total = this.totalSeconds;
+        let shouldWarn = false;
+
+        if (total > 300) {
+          // 大于5分钟:最后5分钟预警
+          if (this.remainingTime <= 300) shouldWarn = true;
+        } else if (total >= 60) {
+          // 不大于5分钟,但大于等于1分钟:最后1分钟预警
+          if (this.remainingTime <= 60) shouldWarn = true;
+        }
+
+        if (shouldWarn) {
+          this.isWarningTriggered = true;
+          this.onWarning(this.remainingTime);
+        }
+      }
+
+      // 4. 倒计时结束判断
+      if (this.remainingTime <= 0) {
+        this._finish();
+      }
+    }, 1000);
+  }
+
+  /**
+   * 内部核心:停止定时器
+   */
+  _stopEngine() {
+    clearInterval(this.timerId);
+    this.timerId = null;
+  }
+
+  /**
+   * 启动/继续倒计时
+   */
+  start() {
+    if (this.isFinished || this.isRunning) return;
+    if (this.isManualPaused) return; // 仅受手动暂停控制
+
+    this.isRunning = true;
+    this._startEngine();
+  }
+
+  /**
+   * 手动暂停倒计时(注意:仅允许用户主动点击暂停,切屏不会暂停)
+   */
+  pause() {
+    if (!this.isRunning) return;
+    this.isRunning = false;
+    this.isManualPaused = true;
+    this._stopEngine();
+  }
+
+  /**
+   * 切换暂停/继续状态(二合一)
+   */
+  toggle() {
+    if (this.isFinished) return;
+    if (this.isRunning) {
+      this.pause();
+    } else {
+      this.start();
+    }
+  }
+
+  /**
+   * 重置并启动(用于多目标切换)
+   */
+  resetAndStart(newOptions) {
+    this._stopEngine();
+    this.isRunning = false;
+    this.isManualPaused = false;
+
+    this.totalSeconds = newOptions.totalSeconds || 0;
+    this.onTick = newOptions.onTick || (() => {});
+    this.onWarning = newOptions.onWarning || (() => {});
+    this.onFinished = newOptions.onFinished || (() => {});
+
+    this.remainingTime = this.totalSeconds;
+    this.isFinished = false;
+    this.isWarningTriggered = false;
+
+    // ⚠️ 重置绝对时间戳,重新计算
+    this.endTimeStamp = 0;
+
+    this.isRunning = true;
+    this._startEngine();
+  }
+
+  /**
+   * 彻底清除定时器
+   */
+  clear() {
+    this._stopEngine();
+    this.isRunning = false;
+    this.isManualPaused = false;
+    this.remainingTime = this.totalSeconds;
+    this.isFinished = false;
+    this.isWarningTriggered = false;
+    this.endTimeStamp = 0;
+
+    this.onTick = null;
+    this.onWarning = null;
+    this.onFinished = null;
+  }
+
+  /**
+   * 内部方法:倒计时结束
+   */
+  _finish() {
+    this._stopEngine();
+    this.isRunning = false;
+    this.isFinished = true;
+    this.remainingTime = 0;
+    this.onFinished();
+  }
+
+  /**
+   * 销毁方法
+   */
+  destroy() {
+    this.clear();
+  }
+}

+ 18 - 13
src/views/safetyEducationExaminationNew/components/historyOfIncorrectQuestions.vue

@@ -63,11 +63,11 @@
     </div>
     <div class="page-content-box">
       <el-table class="table-box"  border :data="dataList">
-        <el-table-column label="题干" prop="questionContent"  show-overflow-tooltip/>
-          <!--<template slot-scope="scope">-->
-            <!--<span style="color:#0183fa;cursor: pointer;" @click="tableButton(2,scope.row)">{{ cleanRichText(scope.row.questionContent) }}</span>-->
-          <!--</template>-->
-        <!--</el-table-column>-->
+        <el-table-column label="题干" prop="questionContent"  show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span>{{ cleanRichText(scope.row.questionContent) }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="题型" prop="content" width="200" show-overflow-tooltip>
           <template slot-scope="scope">
             <span>{{ scope.row.questionType == 1?'单选题':(scope.row.questionType == 2?'多选题':(scope.row.questionType == 3?'判断题':'')) }}</span>
@@ -116,9 +116,11 @@
 <script>
   //import { getDicts } from "@/api/commonality/noPermission";
   //import { systemUserSelect } from "@/api/commonality/permission";
-  import { examElKnowledgePointTreeList, } from "@/api/safetyEducationExaminationNew/index";
   import answerKey from "@/views/safetyEducationExaminationNew/components/answerKey.vue";
-  import { examElExamAttemptAnswerExamAnswer,examElExamAttemptAnswerAttemptAnswer } from "@/api/safetyEducationExaminationNew/index";
+  import {
+    examElKnowledgePointTreeList,examElExamAttemptAnswerExamAnswer,
+    examElExamAttemptAnswerAttemptAnswer,examUserPracticeWrongQuestions,
+  } from "@/api/safetyEducationExaminationNew/index";
   export default {
     name: 'addPage',
     components: {
@@ -173,11 +175,14 @@
           //开始训练
           let obj = {};
           if(this.historyOfIncorrectQuestionsPropsData.type == 1){
-            obj.id = this.historyOfIncorrectQuestionsPropsData.examId;
+            obj.source = 2;
+            obj.examId = this.historyOfIncorrectQuestionsPropsData.examId;
           }else if(this.historyOfIncorrectQuestionsPropsData.type == 2){
-            obj.id = this.historyOfIncorrectQuestionsPropsData.attemptId;
+            obj.source = 3;
+            obj.attemptId = this.historyOfIncorrectQuestionsPropsData.attemptId;
           }else if(this.historyOfIncorrectQuestionsPropsData.type == 3){
-            obj.id = this.historyOfIncorrectQuestionsPropsData.knowledgePointId;
+            obj.source = 1;
+            obj.knowledgePointId = this.historyOfIncorrectQuestionsPropsData.knowledgePointId;
           }
           this.$router.push({
             name: 'startTraining',
@@ -189,7 +194,7 @@
           this.$set(this, 'drawerType', 1)
           this.$set(this, 'drawer', true)
           this.$set(this,'answerKeyPropsData',{
-            id:row.sourceQuestionId,
+            id:this.historyOfIncorrectQuestionsPropsData.type == 3?row.questionId:row.sourceQuestionId,
           });
         }
       },
@@ -230,8 +235,8 @@
             this.$set(this,'total',response.data.total);
           });
         }else if(this.historyOfIncorrectQuestionsPropsData.type == 3){
-          obj.attemptId = this.historyOfIncorrectQuestionsPropsData.knowledgePointId;
-          examElExamAttemptAnswerAttemptAnswer(obj).then(response => {
+          obj.knowledgePointId = this.historyOfIncorrectQuestionsPropsData.knowledgePointId;
+          examUserPracticeWrongQuestions(obj).then(response => {
             this.$set(this,'dataList',response.data.records);
             this.$set(this,'total',response.data.total);
           });

+ 6 - 0
src/views/safetyEducationExaminationNew/featurePage/startPracticing/index.vue

@@ -326,6 +326,12 @@
         examUserPracticeQuestionDetail({
           questionId: questionId,
         }).then(response => {
+          if(response.data.questionType == 3){
+            response.data.options = [
+              { optionContent:"对",optionTag:"Y",sortOrder:1 },
+              { optionContent:"错",optionTag:"N",sortOrder:2 },
+            ]
+          }
           response.data.userAnswer = userAnswer?userAnswer.split(','):[];
           this.$set(this, 'currentQuestion', response.data)
           this.$set(this, 'viewAnswerShowType', false)

+ 57 - 168
src/views/safetyEducationExaminationNew/featurePage/startTraining/index.vue

@@ -1,11 +1,11 @@
 <!-- 开始训练 -->
 <template>
-  <div class="app-container startTraining-addPage">开始训练
+  <div class="app-container startTraining-addPage">
     <div class="page-container-top-max-big-box">
       <p class="top-1-p">开始训练</p>
       <p class="top-2-p" @click="backPage()">返回</p>
     </div>
-    <div class="content-box" v-if="pageType === 1">
+    <div class="content-box">
       <!-- 左侧面板 -->
       <div class="left-panel">
         <div class="exam-title">刷题练习</div>
@@ -88,44 +88,27 @@
         <div class="question-button-box">
           <p class="previous-question" :class="!isFirstQuestion?'check-button':''" @click="prevQuestion">上一题</p>
           <p class="null-p"></p>
-          <!--<p class="submit-exam" @click="submitExam()">交卷</p>-->
           <p class="null-p"></p>
           <p class="next-question" :class="!isLastQuestion?'check-button':''" @click="nextQuestion">下一题</p>
         </div>
       </div>
     </div>
-    <div class="shade-max-big-box" v-if="shadeType">
-      <div class="shade-big-box">
-        <div class="title-box">
-          <p><span>{{shadeData.totalScore}}</span>分</p>
-        </div>
-        <p class="text-p">{{shadeData.type==1?'本次模拟考试成绩不及格!':(shadeData.type==2?'本次模拟考试成绩有效':'')}}</p>
-        <div class="button-box">
-          <p class="null-p"></p>
-          <p class="button-p-2" v-if="shadeData.type == 1" @click="retakeExam()">重新考试</p>
-          <p class="button-p-2" v-if="shadeData.type == 2" @click="backPage()">确定</p>
-          <p class="null-p"></p>
-        </div>
-        <p class="out-button el-icon-close" @click="backPage()"></p>
-      </div>
-    </div>
   </div>
 </template>
 
 <script>
   import {
-    examUserPracticePanel, examUserPracticeQuestionDetail,
+    examUserPracticeTrainPanel, examUserPracticeQuestionDetail,
     examUserPracticeSubmit,
     examUserExamSubmit,examUserExamStart,
   } from '@/api/safetyEducationExaminationNew/index'
   export default {
     name: 'addPage',
     props: {
-      propsData: {}
+      startTrainingPropsData: {}
     },
     data() {
       return {
-        pageType:1,
         newData: {},
         //考试信息
         examInfo: {
@@ -146,7 +129,6 @@
           totalScore:0,//分数
           canContinueExam:0, //重新考试 0不可以1可以
         },
-        historyOfIncorrectQuestionsPropsData:{},
         viewAnswerShowType:false,
       }
     },
@@ -218,18 +200,23 @@
           return
         }
         this.$nextTick(() => {
-          this.examUserPracticePanel();
+          this.examUserPracticeTrainPanel();
         })
       },
       //左侧数据
-      examUserPracticePanel(){
-        examUserPracticePanel({ knowledgePointId: this.newData.knowledgePointId, }).then(response => {
+      examUserPracticeTrainPanel(){
+        examUserPracticeTrainPanel(this.newData).then(response => {
           this.$set(this,'groupIndex',0);
           this.$set(this,'questionIndex',0);
           this.$set(this, 'examInfo', {
             knowledgePointName: response.data.knowledgePointName ? response.data.knowledgePointName : '',
             totalCount: response.data.totalCount ? response.data.totalCount : 0,
           })
+          for(let i=0;i<response.data.questionTypeGroups.length;i++){
+            for(let o=0;o<response.data.questionTypeGroups[i].questions.length;o++){
+              response.data.questionTypeGroups[i].questions[o].userAnswer='';
+            }
+          }
           this.$set(this, 'questionTypeGroups', response.data.questionTypeGroups)
           // 默认选中第一题(假数据直接从 data 里读取,无需接口)
           const firstGroup = this.questionTypeGroups[0]
@@ -252,76 +239,53 @@
         }else if(item.questionType == 3){
           item.userAnswer = [minItem.optionTag]
         }
+        this.checkAnswer(item.correctAnswer,item.userAnswer)
+        this.$set(this.questionTypeGroups[this.groupIndex].questions[this.questionIndex],'userAnswer',item.userAnswer+'');
+        // this.$set(this.questionTypeGroups[this.groupIndex].questions[this.questionIndex],'answerStatus',response.data.answerStatus);
+      },
+      checkAnswer(correctAnswer, userAnswer) {
+        // 1. 防御性编程:处理空值或异常数据
+        if (!correctAnswer || !Array.isArray(userAnswer)) return 2;
+        // 2. 将正确答案字符串统一切割为数组,并去除可能的空格
+        // 'C' -> ['C']
+        // 'A,B,C' -> ['A', 'B', 'C']
+        const correctArr = correctAnswer.split(',').map(item => item.trim());
+        // 3. 核心判断:两个数组长度必须一致,且正确数组中的每一项都存在于用户选择中
+        // 这样可以完美处理 ['A','B'] 和 ['B','A'] 顺序不一致的情况
+        const isCorrect =
+          correctArr.length === userAnswer.length &&
+          correctArr.every(item => userAnswer.includes(item));
+        this.$set(this.questionTypeGroups[this.groupIndex].questions[this.questionIndex],'answerStatus',isCorrect ? 1 : 2);
+        // return isCorrect ? 1 : 2;
       },
       // 上一题
       prevQuestion() {
         // 如果已经是第一题,不做任何操作
         if (this.isFirstQuestion) return
-        //判断当前提是否已作答
-        if(this.currentQuestion.userAnswer[0]){
-          examUserPracticeSubmit({
-            attemptId: this.newData.attemptId,
-            questionId:this.currentQuestion.id,
-            userAnswer:this.currentQuestion.userAnswer+'',
-          }).then(response => {
-            this.$set(this.questionTypeGroups[this.groupIndex].questions[this.questionIndex],'answerStatus',response.data.answerStatus);
-            //切换索引至下一题
-            if (this.questionIndex > 0) {
-              // 当前组内还有上一题,直接题索引减 1
-              this.questionIndex--
-            } else {
-              // 当前已经是该组的第一题,需要切换到上一个组的最后一题
-              this.groupIndex--
-              const prevGroup = this.questionTypeGroups[this.groupIndex]
-              this.questionIndex = prevGroup.questions.length - 1
-            }
-          })
-        }else{
-          //切换索引至下一题
-          if (this.questionIndex > 0) {
-            // 当前组内还有上一题,直接题索引减 1
-            this.questionIndex--
-          } else {
-            // 当前已经是该组的第一题,需要切换到上一个组的最后一题
-            this.groupIndex--
-            const prevGroup = this.questionTypeGroups[this.groupIndex]
-            this.questionIndex = prevGroup.questions.length - 1
-          }
+        //切换索引至下一题
+        if (this.questionIndex > 0) {
+          // 当前组内还有上一题,直接题索引减 1
+          this.questionIndex--
+        } else {
+          // 当前已经是该组的第一题,需要切换到上一个组的最后一题
+          this.groupIndex--
+          const prevGroup = this.questionTypeGroups[this.groupIndex]
+          this.questionIndex = prevGroup.questions.length - 1
         }
       },
       // 下一题
       nextQuestion() {
         // 如果已经是最后一题,不做任何操作
         if (this.isLastQuestion) return
-        //判断当前提是否已作答
-        if(this.currentQuestion.userAnswer[0]){
-          examUserPracticeSubmit({
-            questionId:this.currentQuestion.id,
-            userAnswer:this.currentQuestion.userAnswer+'',
-          }).then(response => {
-            this.$set(this.questionTypeGroups[this.groupIndex].questions[this.questionIndex],'answerStatus',response.data.answerStatus);
-            //切换索引至下一题
-            const currentGroup = this.questionTypeGroups[this.groupIndex]
-            if (this.questionIndex < currentGroup.questions.length - 1) {
-              // 当前组内还有下一题,直接题索引加 1
-              this.questionIndex++
-            } else {
-              // 当前已经是该组的最后一题,需要切换到下一个组的第一题
-              this.groupIndex++
-              this.questionIndex = 0
-            }
-          })
-        }else{
-          //切换索引至下一题
-          const currentGroup = this.questionTypeGroups[this.groupIndex]
-          if (this.questionIndex < currentGroup.questions.length - 1) {
-            // 当前组内还有下一题,直接题索引加 1
-            this.questionIndex++
-          } else {
-            // 当前已经是该组的最后一题,需要切换到下一个组的第一题
-            this.groupIndex++
-            this.questionIndex = 0
-          }
+        //切换索引至下一题
+        const currentGroup = this.questionTypeGroups[this.groupIndex]
+        if (this.questionIndex < currentGroup.questions.length - 1) {
+          // 当前组内还有下一题,直接题索引加 1
+          this.questionIndex++
+        } else {
+          // 当前已经是该组的最后一题,需要切换到下一个组的第一题
+          this.groupIndex++
+          this.questionIndex = 0
         }
       },
       //右侧数据
@@ -329,6 +293,12 @@
         examUserPracticeQuestionDetail({
           questionId: questionId,
         }).then(response => {
+          if(response.data.questionType == 3){
+            response.data.options = [
+              { optionContent:"对",optionTag:"Y",sortOrder:1 },
+              { optionContent:"错",optionTag:"N",sortOrder:2 },
+            ]
+          }
           response.data.userAnswer = userAnswer?userAnswer.split(','):[];
           this.$set(this, 'currentQuestion', response.data)
           this.$set(this, 'viewAnswerShowType', false)
@@ -338,96 +308,15 @@
       backPage() {
         this.$router.back()
       },
-      //交卷按钮
-      submitExam(){
-        let self = this;
-        let num = 0;
-        for(let i=0;i<self.questionTypeGroups.length;i++){
-          for(let o=0;o<self.questionTypeGroups[i].questions.length;o++){
-            if(self.questionTypeGroups[i].questions[o].answerStatus == 0){
-              num++
-            }
-          }
-        }
-        self.$confirm(num==0?'确认要交卷吗?':'还有'+num+'题未答,确认要交卷吗??', "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(async () => {
-          self.examUserExamAnswerSaveExamUserExamSubmit();
-        }).catch(() => {})
-      },
-      examUserExamAnswerSaveExamUserExamSubmit(){
-        if(this.currentQuestion.userAnswer[0]){
-          examUserPracticeSubmit({
-            attemptId: this.newData.attemptId,
-            questionId:this.currentQuestion.id,
-            userAnswer:this.currentQuestion.userAnswer+'',
-          }).then(response => {
-            this.$set(this.questionTypeGroups[this.groupIndex].questions[this.questionIndex],'answerStatus',response.data.answerStatus);
-            this.examUserExamSubmit();
-          })
-        }else{
-          this.examUserExamSubmit();
-        }
-      },
-      //交卷
-      examUserExamSubmit(){
-        examUserExamSubmit({ attemptId: this.newData.attemptId, }).then(response => {
-          this.$set(this,'shadeData',{
-            type:response.data.totalScore >= this.examInfo.totalScore?2:1,
-            totalScore:response.data.totalScore,
-            canContinueExam:0,
-          });
-          this.$set(this,'shadeType',true);
-        })
-      },
-      //查看错题
-      reviewMistakes(){
-        this.$set(this,'historyOfIncorrectQuestionsPropsData',{
-          type:2,
-          attemptId:this.newData.attemptId,
-        });
-        this.$set(this,'shadeType',false);
-        this.$set(this,'pageType',2);
-      },
       //查看错题返回
       tableButton(){
         this.$router.back();
       },
-      //重新考试
-      retakeExam(){
-        examUserExamStart({examId:this.newData.examId,examScene:2,}).then(response => {
-          if(response.data.attemptId){
-            this.$set(this.newData, 'attemptId',response.data.attemptId)
-            this.$set(this,'shadeType',false);
-            this.$nextTick(() => {
-              this.examUserPracticePanel();
-            })
-          }else{
-            this.msgError(response.message)
-            this.$router.back()
-          }
-        })
-      },
       // 点击左侧题号:切换当前题目,按需从接口加载详情
       selectQuestion(item, index, minIndex) {
-        if(this.currentQuestion.userAnswer[0]){
-          examUserPracticeSubmit({
-            attemptId: this.newData.attemptId,
-            questionId:this.currentQuestion.id,
-            userAnswer:this.currentQuestion.userAnswer+'',
-          }).then(response => {
-            this.$set(this.questionTypeGroups[this.groupIndex].questions[this.questionIndex],'answerStatus',response.data.answerStatus);
-            this.$set(this, 'groupIndex', index)
-            this.$set(this, 'questionIndex', minIndex)
-            this.examUserPracticeQuestionDetail(item.questionId,item.userAnswer)
-          })
-        }else {
-          this.$set(this, 'groupIndex', index)
-          this.$set(this, 'questionIndex', minIndex)
-          this.examUserPracticeQuestionDetail(item.questionId,item.userAnswer)
-        }
+        this.$set(this, 'groupIndex', index)
+        this.$set(this, 'questionIndex', minIndex)
+        this.examUserPracticeQuestionDetail(item.questionId,item.userAnswer)
       },
       // 判断选项是否被选中
       isSelectedOption(q, key) {

+ 7 - 4
src/views/safetyEducationExaminationNew/safetyTest/practiceQuestions/index.vue

@@ -64,7 +64,7 @@
                   <p class="text-p">练习进度:{{item.answeredCount}} / {{item.totalCount}}</p>
                   <p class="text-p">正确数:{{item.correctCount}} 丨 错题数:{{item.wrongCount}} 丨 正确率:{{item.correctRate}}%</p>
                 </div>
-                <p class="position-p" v-if="item.hasWrongQuestion" @click="tableButton(2,item)">历史错题</p>
+                <p class="position-p" v-if="item.hasWrongQuestion" @click.stop="tableButton(2,item)">历史错题</p>
                 <el-progress
                   class="num-p" type="circle"
                   :stroke-width="4"
@@ -84,7 +84,7 @@
         </div>
       </div>
     </div>
-    <historyOfIncorrectQuestions :propsData="propsData" v-if="pageType === 2"></historyOfIncorrectQuestions>
+    <historyOfIncorrectQuestions :historyOfIncorrectQuestionsPropsData="historyOfIncorrectQuestionsPropsData" v-if="pageType === 2"></historyOfIncorrectQuestions>
   </div>
 </template>
 <script>
@@ -119,7 +119,7 @@
         dataList: [],
         //数据数量
         total: 0,
-        propsData:{},
+        historyOfIncorrectQuestionsPropsData:{},
       }
     },
     created() {
@@ -186,8 +186,11 @@
           })
         } else if (type == 2) {
           //历史错题
+          this.$set(this,'historyOfIncorrectQuestionsPropsData',{
+            type:3,
+            knowledgePointId:item.knowledgePointId,
+          });
           this.$set(this, 'pageType', 2)
-          this.$set(this, 'propsData', {})
         } else if (type == 6) {
           //返回并刷新
           this.$set(this, 'pageType', 1)