From 9189b7e18f36aa177c47a7537b54230cab454a47 Mon Sep 17 00:00:00 2001 From: daihh Date: Fri, 9 Dec 2022 18:56:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A0=E4=B8=BApc=E7=AB=AF=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E8=80=83=E8=AF=95=E9=97=AE=E9=A2=98=EF=BC=8C=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=BF=AE=E6=94=B9=E7=A7=BB=E5=8A=A8=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/study/exam.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pages/study/exam.vue b/pages/study/exam.vue index 6d373d0..4cc9bc0 100644 --- a/pages/study/exam.vue +++ b/pages/study/exam.vue @@ -179,6 +179,7 @@ //console.log(this.paper.items); let totalScore=0; this.paper.items.forEach(item => { + item.score=parseInt(item.score); totalScore+=item.score;//加到总分中 if(item.type != 102){ item.userAnswer=''; @@ -214,8 +215,14 @@ } let allRight = true; item.options.forEach(it =>{ - if(it.answer && item.userAnswer.indexOf(it.id)==-1) { - allRight=false; + if(it.answer){ //正确答案 + if(item.userAnswer.indexOf(it.id)==-1){ + allRight=false; + } + }else{ + if(item.userAnswer.indexOf(it.id)>-1){ + allRight=false; + } } }); if(allRight){