This commit is contained in:
2023-09-17 13:18:59 +08:00
parent bf05f771f7
commit 9e871e4079
23 changed files with 1086 additions and 606 deletions

View File

@@ -346,7 +346,7 @@
},
timeCount() {
const time = this.subject == '1' ? 60 * 60 * 1000 : 45 * 60 * 1000
const time = 45 * 60 * 1000
return time
}
},
@@ -504,21 +504,27 @@
toSubmit() {
const restTime = this.time.hours * 60 * 60 + this.time.minutes * 60 + this.time.seconds
const score = (this.rightList.length / this.questionList.length * 100).toFixed(0)
submitTest({
"carTypeId": storage.get('carType') || '1001',
"score": score,
"testTime": 60 * 60 - restTime,
subject: this.subject
}).then(resp => {
const doNotNum = this.questionList.length - this.rightList.length - this.wrongList.length
const list = JSON.stringify(this.wrongList)
if (resp.code === '0000') {
uni.navigateTo({
url: "/pages/questionBank/examResult?doNotNum=" + doNotNum + "&wrongList=" + list + "&score=" +
score + "&subject=" + this.subject + "&navTitle=" + this.navTitle
})
}
})
if(this.rightList.length+this.wrongList.length==0){
uni.navigateBack({
delta:1
})
}else{
submitTest({
"carTypeId": storage.get('carType') || '1001',
"score": score,
"testTime": 45 * 60 - restTime,
subject: this.subject
}).then(resp => {
const doNotNum = this.questionList.length - this.rightList.length - this.wrongList.length
const list = JSON.stringify(this.wrongList)
if (resp.code === '0000') {
uni.navigateTo({
url: "/pages/questionBank/examResult?doNotNum=" + doNotNum + "&wrongList=" + list + "&score=" +
score + "&subject=" + this.subject + "&navTitle=" + this.navTitle
})
}
})
}
},
//查看考试结果
toResult() {