ZhangXianQiang
2024-06-20 5a3020aaec6815f2f38b140b4b30082ac56371f5
fix:单选题判断问题
2个文件已修改
37 ■■■■ 已修改文件
src/views/grade/components/answer-main/answer-audio/index.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/grade/components/answer-main/answer-single/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/grade/components/answer-main/answer-audio/index.vue
@@ -4,8 +4,7 @@
      <ExamInfo class="mb-5" :questionIndex="currentIndex" :activeQuestion="activeQuestion"></ExamInfo>
      <div class="answer-content">
        <div class="answer-item flex" v-for="item, index in activeQuestion.items"
          :class="answerState(item)">
        <div class="answer-item flex" v-for="item, index in activeQuestion.items" :class="answerState(item)">
          <div class="answer-icon flex flex-col justify-center items-center flex-shrink-0">{{ item.prefix }}</div>
          <div class="answer-text text-gray-700">{{ item.content }}</div>
        </div>
@@ -17,7 +16,7 @@
      <div class="analysis-container">
        <div class="analysis-item" :class="analysisState">
          <div class="item-label">您的答案</div>
          <div class="item-info">{{ activeQuestion.correct ? activeQuestion.correct: '未作答' }}</div>
          <div class="item-info">{{ activeQuestion.correct ? activeQuestion.correct : '未作答' }}</div>
        </div>
        <div class="analysis-item analysis-right">
@@ -49,16 +48,16 @@
const answerState = (item) => {
  const flag = activeQuestion.value.correct === activeQuestion.value.right;
  if (item.prefix === activeQuestion.value.correct) {
    const flag = activeQuestion.value.correct === activeQuestion.value.right;
    return {
      right: flag,
      wrong: !flag
    };
  }
  if (item.prefix === activeQuestion.value.right) {
  } else if(item.prefix === activeQuestion.value.right) {
    return {
      right: true
      right: !flag,
      wrong: flag
    };
  }
};
@@ -76,6 +75,7 @@
  --right-color: #67c23a;
  --wrong-color: #f56c6c;
}
.answer-item {
  max-width: 500px;
  border-radius: 10px;
@@ -100,6 +100,21 @@
  }
}
.right {
  border-color: var(--right-color) !important;
  background-color: rgba($color: #67c23a, $alpha: 0.2) !important;
  .answer-icon {
    color: #ffffff !important;
    border-color: var(--right-color) !important;
    background-color: var(--right-color) !important;
  }
  .answer-text {
    color: var(--right-color) !important;
  }
}
.wrong {
  border-color: var(--wrong-color) !important;
  background-color: rgba($color: #f56c6c, $alpha: 0.2) !important;
src/views/grade/components/answer-main/answer-single/index.vue
@@ -46,16 +46,16 @@
const activeQuestion = ref(gradeStore.getActiveQuestion);
const answerState = (item) => {
  const flag = activeQuestion.value.correct === activeQuestion.value.right;
  if (item.prefix === activeQuestion.value.correct) {
    const flag = activeQuestion.value.correct === activeQuestion.value.right;
    return {
      right: flag,
      wrong: !flag
    };
  }
  if (item.prefix === activeQuestion.value.right) {
  } else if(item.prefix === activeQuestion.value.right) {
    return {
      right: true
      right: !flag,
      wrong: flag
    };
  }
};