sc
This commit is contained in:
@@ -216,14 +216,12 @@
|
|||||||
},
|
},
|
||||||
toSubmit() {
|
toSubmit() {
|
||||||
const restTime = this.time.hours * 60 * 60 + this.time.minutes * 60 + this.time.seconds
|
const restTime = this.time.hours * 60 * 60 + this.time.minutes * 60 + this.time.seconds
|
||||||
const score = this.list.reduce((pre, cur) => {
|
const trueCount = this.list.reduce((pre, cur) => {
|
||||||
const isTrue = cur.trueAnswer == cur.yourAnswer.replace(/,-g/, '')
|
const ya = cur.trueAnswer.replace('A', '1').replace('B', '2').replace('C', '3').replace('D', '4').replace('E', '5').replace('F', '6').replace('G', '7')
|
||||||
let s = 0
|
const isTrue = ya == cur.yourAnswer.replace(/,/g, '')
|
||||||
if (isTrue) {
|
return pre + 1 * (isTrue ? 1 : 0)
|
||||||
s = this.subject == 1 ? 1 : 2
|
|
||||||
}
|
|
||||||
return pre + s
|
|
||||||
}, 0)
|
}, 0)
|
||||||
|
const score = (trueCount / this.list.length * 100).toFixed(0)
|
||||||
submitTest({
|
submitTest({
|
||||||
"carTypeId": storage.get('carType') || '1001',
|
"carTypeId": storage.get('carType') || '1001',
|
||||||
"score": score,
|
"score": score,
|
||||||
|
|||||||
Reference in New Issue
Block a user