ZhangXianQiang
2024-07-05 98f494cf633e3acf5c20f3e9de0d708f2a6c2045
src/store/modules/exam.js
@@ -34,7 +34,7 @@
    examDetail.value.forEach(item => {
      total += item.questionList.length;
      item.questionList.forEach(question => {
        grade += Number(question.score);
        grade += Number(question.questionScore);
      });
    });
    return {
@@ -42,7 +42,6 @@
      grade,
    };
  });
  const setExamInfo = (info) => {
    examInfo.value = info;
@@ -58,6 +57,13 @@
      temp.questionList[index].answer = answer;
    }
  };
  const setQuestionAnswerList = (type, index, answer) => {
    const temp = examDetail.value.find(item => item.questionType === type);
    if (temp) {
      temp.questionList[index].answerList = answer;
    }
  }
  const setProgress = (progress) => {
    answerProgress.value = progress;
@@ -87,6 +93,7 @@
    setExamInfo,
    setExamDetail,
    setQuestionAnswer,
    setQuestionAnswerList,
    setProgress
  };
});