闫增涛
2024-11-19 28ae9e323d8ce3eff8a02860d0527fb89e5ea530
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>
@@ -1698,7 +1699,7 @@
                </div>
            </div>
        </div>
        <preView :isClear="dialogVisible" :md5="p_md5"  :pdfTitle="somePdfTitleValue" ref="pdfDialogRef"></preView>
        <preView :isClear="dialogVisible" :md5="p_md5" :pdfTitle="somePdfTitleValue" ref="pdfDialogRef"></preView>
    </div>
</template>
@@ -1717,7 +1718,7 @@
    },
    data() {
        return {
            pdfDialogRef:"",
            pdfDialogRef: "",
            iframSrc: "",
            showChoiceAnswer: false,
            showQuestionAnswer: false,
@@ -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
        },