zhongshujie
2024-11-19 253b3f50df303f24fdf880797619432f8b74db21
src/books/civilAviation/view/components/chapter001.vue
@@ -676,7 +676,8 @@
                        <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>
@@ -1842,7 +1843,16 @@
        },
        // 多选题
        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
        },