| | |
| | | <p class="event-header-text-bc pd-5 fl jc-sa" style="margin-left: 8px; width: 93%" |
| | | v-if="showCheckAnswer"> |
| | | <span class="c-g"> 答案:ABC </span> |
| | | <span>您的答案: |
| | | <span |
| | | :class="{ 'c-g': questionData.check.isRight, 'c-r': questionData.check.isRight == false }">您的答案: |
| | | <span v-for="(item, index) in questionData.check.value" :key="index"> |
| | | {{ item }} |
| | | </span> |
| | |
| | | }, |
| | | // 多选题 |
| | | goCheckJudge() { |
| | | this.questionData.check.isComplete = true |
| | | this.questionData.check.isComplete = true; |
| | | const sortedAnswer = [...this.questionData.check.answer].sort(); |
| | | const sortedUserAnswer = [...this.questionData.check.value].sort(); |
| | | |
| | | // 然后比较排序后的数组是否相等 |
| | | if (JSON.stringify(sortedAnswer) === JSON.stringify(sortedUserAnswer)) { |
| | | this.questionData.check.isRight = true; |
| | | } else { |
| | | this.questionData.check.isRight = false; |
| | | } |
| | | this.showCheckAnswer = true |
| | | }, |
| | | |