Quellcode durchsuchen

修复判题逻辑

shmily1213 vor 17 Stunden
Ursprung
Commit
e0b18b94f7

+ 2 - 2
src/composables/useExam.ts

@@ -542,7 +542,7 @@ export const useExam = () => {
     answer1 = answer1 || '';
     answer2 = answer2 || '';
     if ([EnumQuestionType.SINGLE_CHOICE, EnumQuestionType.JUDGMENT].includes(typeId)) {
-      return answer1.includes(answers[0]);
+      return answer1.trim() === answers[0];
     } else if ([EnumQuestionType.MULTIPLE_CHOICE].includes(typeId)) {
       return answers.length === answer1.length && answers.every(item => answer1.includes(item));
     } else {
@@ -561,7 +561,7 @@ export const useExam = () => {
   const isOptionCorrect = (question: Study.Question, option: Study.QuestionOption) => {
     const { answers, answer1, typeId } = question;
     if ([EnumQuestionType.SINGLE_CHOICE, EnumQuestionType.JUDGMENT].includes(typeId)) {
-      return answer1?.trim() === answers[0];
+      return answer1?.includes(option.no);
     } else if ([EnumQuestionType.MULTIPLE_CHOICE].includes(typeId)) {
       return answer1?.includes(option.no);
     } else {

+ 1 - 0
src/pagesStudy/pages/exam-start/components/question-options.vue

@@ -194,6 +194,7 @@ const handleSelect = async (option: Study.QuestionOption) => {
 const handleShowParse = () => {
   props.question.showParse = !props.question.showParse;
 }
+console.log(props.question, 111)
 </script>
 <style lang="scss" scoped>
 .question-options {

+ 3 - 1
src/pagesStudy/pages/exam-start/exam-start.vue

@@ -420,7 +420,9 @@ const handleSwiperTipNext = () => {
 }
 const handleGuideClose = () => {
   userStore.isExamGuideShow = true;
-  startTime();
+  if (!isReadOnly.value) {
+    startTime();
+  }
 }
 const loadData = async () => {
   uni.$ie.showLoading();