From dc62eace271809ff876b4dede60bddffe4159b72 Mon Sep 17 00:00:00 2001 From: WX0lxh <2062408239@qq.com> Date: Sat, 8 Nov 2025 11:26:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packageB/train/mockExam/startExam.vue | 62 ++++++++++++++------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/packageB/train/mockExam/startExam.vue b/packageB/train/mockExam/startExam.vue index 09392c2..cd5a279 100644 --- a/packageB/train/mockExam/startExam.vue +++ b/packageB/train/mockExam/startExam.vue @@ -33,10 +33,10 @@
-
+
正确
-
+
错误
@@ -164,17 +164,19 @@ function queryData(){ userId: userInfo.value.userId, examPaperId:rows.value.examPaperId },'post',9100,header).then((resData) => { - elapsedTime.value=(rows.value.timeLimit*60) - resData.forEach((item,i)=>{ - if(item.type=='multiple'){ - item.choice=[] - }else{ - item.choice="" - } - problemData.value.push(item) - problemList.value.push({index:i+1,whether:""}) - }) - start() + if(resData&&resData.code==200){ + elapsedTime.value=(rows.value.timeLimit*60) + resData.data.forEach((item,i)=>{ + if(item.type=='multiple'){ + item.choice=[] + }else{ + item.choice="" + } + problemData.value.push(item) + problemList.value.push({index:i+1,whether:""}) + }) + start() + } }); }else if(rows.value.types==2){ $api.myRequest('/train/public/trainExamDash/continueExam', { @@ -190,11 +192,13 @@ function queryData(){ item.submitAnswers=true }else{ item.choice=[] + item.submitAnswers=false } }else{ if(item.choosed){ item.choice=item.choosed; item.submitAnswers=true + item.submitAnswers=false }else{ item.choice="" } @@ -233,14 +237,13 @@ function submit(){ } let header={ 'Authorization':Authorization.value, - 'Content-Type':"application/json" + 'Content-Type':"application/x-www-form-urlencoded" } $api.myRequest('/train/public/trainExamDash/submitAnswer', parm,'post',9100,header).then((resData) => { if(resData&&resData.code==200){ problemData.value[indexs].submitAnswers=true if(problemData.value.length==questionIndex.value){ - $api.msg('已经是最后一题了', '请仔细检查后交卷') - + $api.msg('已经是最后一题了,请仔细检查后交卷!') }else{ questionIndex.value+=1 } @@ -266,18 +269,7 @@ function complete(){ } } }) - this.$confirm((arr.length>0?'第'+arr.join(",")+'题还未作答,':'请仔细检查试卷 ,')+'确认是否交卷?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - onpaper() - }).catch(() => { - this.$message({ - type: 'info', - message: '已取消' - }); - }); + }; function onpaper(){ @@ -290,7 +282,7 @@ function onpaper(){ } let header={ 'Authorization':Authorization.value, - 'Content-Type':"application/json" + 'Content-Type':"application/x-www-form-urlencoded" } $api.myRequest('/train/public/trainExamDash/submitExam', parm,'post',9100,header).then((resData) => { if(resData&&resData.code==200){ @@ -371,7 +363,17 @@ function switchs(i){ dialogVisible.value=false }; function exit(){ - navBack() + wx.showModal({ + title: '提示', + content: '直接退出是不计分的, 确定要退出吗?', + success (res) { + if (res.confirm) { + navBack() + } else if (res.cancel) { + console.log('用户点击取消') + } + } + }) }