ZhangXianQiang
2024-07-05 98f494cf633e3acf5c20f3e9de0d708f2a6c2045
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;