From 28ae9e323d8ce3eff8a02860d0527fb89e5ea530 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 19 十一月 2024 17:15:37 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout --- src/books/civilAviation/view/components/chapter001.vue | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/books/civilAviation/view/components/chapter001.vue b/src/books/civilAviation/view/components/chapter001.vue index 90765c2..3c7d956 100644 --- a/src/books/civilAviation/view/components/chapter001.vue +++ b/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"> 绛旀锛欰BC </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 }, -- Gitblit v1.9.1