assessmentType
This commit is contained in:
@@ -64,7 +64,7 @@ export default {
|
|||||||
},
|
},
|
||||||
list: [],
|
list: [],
|
||||||
activeIndex: 0, // 当前第几题
|
activeIndex: 0, // 当前第几题
|
||||||
activeAnswer:undefined,
|
activeAnswer: undefined,
|
||||||
endTime: '', // 结束时间
|
endTime: '', // 结束时间
|
||||||
id: '', // 题库id
|
id: '', // 题库id
|
||||||
showConfirm: false,
|
showConfirm: false,
|
||||||
@@ -75,11 +75,12 @@ export default {
|
|||||||
subjectConfigs: [],
|
subjectConfigs: [],
|
||||||
score: 0,
|
score: 0,
|
||||||
assessments: [], // 不合格的分数段
|
assessments: [], // 不合格的分数段
|
||||||
status: 1, // 考试结果,0:未通过、1:通过
|
status: null, // 考试结果,0:未通过、1:通过
|
||||||
startTime: '',
|
startTime: '',
|
||||||
nowTime: '', // 时间戳
|
nowTime: '', // 时间戳
|
||||||
studyDuration: 0,
|
studyDuration: 0,
|
||||||
assessmentType: ''
|
assessmentType: '',
|
||||||
|
examinationId: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -94,6 +95,7 @@ export default {
|
|||||||
this.list = res.data.questions
|
this.list = res.data.questions
|
||||||
this.subjectConfigs = res.data.subjectConfigs
|
this.subjectConfigs = res.data.subjectConfigs
|
||||||
this.assessments = res.data.assessments
|
this.assessments = res.data.assessments
|
||||||
|
this.examinationId = res.data.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -135,39 +137,56 @@ export default {
|
|||||||
this.showTiJiao = true;
|
this.showTiJiao = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getScoreType(score) {
|
||||||
|
let conditionMap = [
|
||||||
|
(a, b) => a - b >= 0,
|
||||||
|
(a, b) => a - b > 0,
|
||||||
|
(a, b) => a - b == 0,
|
||||||
|
(a, b) => a - b <= 0,
|
||||||
|
(a, b) => a - b < 0
|
||||||
|
]
|
||||||
|
let type = ['0','1','2','3']
|
||||||
|
for (let i = 0; i < this.assessments.length; i++) {
|
||||||
|
let ret = this.assessments[i].upScore;
|
||||||
|
let con = this.assessments[i].upCondition;
|
||||||
|
if (conditionMap[con](score, ret)) {
|
||||||
|
this.assessmentType = type[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// 提交
|
// 提交
|
||||||
submit() {
|
submit() {
|
||||||
// 分数区间
|
// 分数区间
|
||||||
// switch(this.assessments) {
|
this.getScoreType(this.score)
|
||||||
// case this.assessments[0]: console.log(1);
|
|
||||||
// break;
|
|
||||||
// case 2:
|
|
||||||
// }
|
|
||||||
// 用时
|
// 用时
|
||||||
const endTime = new Date().getTime()
|
let endTime = new Date().getTime()
|
||||||
this.studyDuration = Math.ceil((endTime - this.nowTime) / 1000 / 60)
|
this.studyDuration = Math.ceil((endTime - this.nowTime) / 1000 / 60)
|
||||||
// 是否合格
|
// 是否合格
|
||||||
const buhege = this.assessments.filter(e=> e.assessmentType == 3)
|
let buhege = this.assessments.filter(e=> e.assessmentType == 3)
|
||||||
if(buhege.upCondition == 3) { // 3:小于等于、4:小于
|
|
||||||
if(this.score <= buhege.upScore) {
|
if(buhege[0].upCondition == 3) { // 3:小于等于、4:小于
|
||||||
this.status = 0
|
if(this.score <= buhege[0].upScore) {
|
||||||
}
|
|
||||||
} else if(buhege.upCondition == 4) {
|
|
||||||
if(this.score < buhege.upScore) {
|
|
||||||
this.status = 0
|
this.status = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// this.$instance.post(`/app/appexaminationinfo/commit`,{
|
if(buhege[0].upCondition == 4) {
|
||||||
// assessmentType: this.assessmentType,
|
if(this.score < buhege[0].upScore) {
|
||||||
// examinationId: this.id,
|
this.status = 0
|
||||||
// startTime: this.startTime,
|
}
|
||||||
// status: this.status,
|
}
|
||||||
// studyDuration: this.studyDuration,
|
this.$instance.post(`/app/appexaminationinfo/commit`,{
|
||||||
// }).then(res=> {
|
assessmentType: this.assessmentType,
|
||||||
// if(res?.code == 0) {
|
examinationId: this.examinationId,
|
||||||
// uni.navigateTo({url: './result'})
|
startTime: this.startTime,
|
||||||
// }
|
status: this.status,
|
||||||
// })
|
studyDuration: this.studyDuration,
|
||||||
|
score: this.score
|
||||||
|
}).then(res=> {
|
||||||
|
if(res?.code == 0) {
|
||||||
|
this.$u.toast('提交成功')
|
||||||
|
// uni.navigateTo({url: './result'})
|
||||||
|
}
|
||||||
|
}).catch(err=> this.$u.toast(err.masg))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
|
|||||||
Reference in New Issue
Block a user