{{ answerNum }}
@@ -210,7 +224,7 @@ export default {
showModal: false,
showModalSelect: false,
// 正确率
- correctRate: '80%',
+ correctRate: '0',
// 已用时间 - 计时器 - 用于显示已用时间 格式 00:00:00
usedTime: '00:00:00',
// 正确题数
@@ -463,7 +477,7 @@ export default {
// 提交答案
// insertPracticeAnswerById(params)
uni.request({
- url: config.baseUrl + 'exam-student/studentPractice/insertPracticeAnswerById',
+ url: config.baseUrl + '/exam-student/studentPractice/insertPracticeAnswerById',
method: 'post',
data: params,
header: {
@@ -477,8 +491,11 @@ export default {
}
},
// 处理多选题选项点击事件
- handleCheckbox(option, index) {
+ handleCheckbox(option, index, item) {
console.log('🚀 ~ handleCheckbox ~ option, index:', option, index)
+ if (item.isSelect) {
+ return
+ }
// 给当前点击的增加边框 再次点击取消
if (!option.isCheck) {
this.questionList[0].listOption[index].isCheck = !option.isCheck
@@ -513,7 +530,7 @@ export default {
})
// 给正确选项添加标记
this.questionList[0].listOption.forEach(item => {
- if (correctGrade.includes(item.value)) {
+ if (correctGrade.includes(item.optionIdent)) {
item.isCorrect = true
}
})
@@ -524,9 +541,10 @@ export default {
this.questionList[0].isError = true
// 给错误选项添加标记
this.questionList[0].listOption.forEach(item => {
- if (correctGrade.includes(item.value)) {
+ if (correctGrade.includes(item.optionIdent)) {
item.isCorrect = true
- } else if (item.isCheck) {
+ }
+ if (!correctGrade.includes(item.optionIdent) && item.isCheck) {
item.isError = true
}
})
@@ -541,7 +559,7 @@ export default {
console.log('🚀 ~ handleOk ~ params-多选:', params)
// insertPracticeAnswerById(params)
uni.request({
- url: config.baseUrl + 'exam-student/studentPractice/insertPracticeAnswerById',
+ url: config.baseUrl + '/exam-student/studentPractice/insertPracticeAnswerById',
method: 'post',
data: params,
header: {
@@ -557,37 +575,30 @@ export default {
// 提交
async handleSubmit() {
console.log('提交')
+ this.answerNum = this.trueNum + this.falseNum
+ let rate = ((Number(this.trueNum) / Number(this.answerNum)) * 100).toFixed(2)
+ // 计算正确率 = 正确题数 / 已答题数
+ this.correctRate = rate == 'NaN' ? '0' : rate
this.showModal = true
- const params = {
- id: this.practiceId
- }
- // const res = await getPracticeQuestionRate(params)
- // // trueRate 正确率
- // this.correctRate = res.data.trueRate
- // // allQuestionNum 答题数
- // this.answerNum = res.data.allQuestionNum
- // // trueQuestionNum 正确数
- // this.trueNum = res.data.trueQuestionNum
- // console.log('🚀 ~ handleSubmit ~ res:', res)
- uni.request({
- url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionRate',
- method: 'post',
- data: params,
- header: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- Authorization: uni.getStorageSync('access_token')
- },
- success: res => {
- console.log('🚀 ~ handleSubmit ~ res:', res)
- res = res.data
- this.correctRate = res.data.trueRate
- this.answerNum = res.data.allQuestionNum
- this.trueNum = res.data.trueQuestionNum
- },
- fail: err => {
- console.log(err)
- }
- })
+ // const params = {
+ // id: this.practiceId
+ // }
+ // uni.request({
+ // url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionRate',
+ // method: 'post',
+ // data: params,
+ // header: {
+ // 'Content-Type': 'application/x-www-form-urlencoded',
+ // Authorization: uni.getStorageSync('access_token')
+ // },
+ // success: res => {
+ // console.log('🚀 ~ handleSubmit ~ res:', res)
+ // res = res.data
+ // },
+ // fail: err => {
+ // console.log(err)
+ // }
+ // })
},
handleConfirm() {
console.log('确认')
@@ -658,13 +669,13 @@ export default {
console.log(err)
}
})
- uni.redirectTo({
+ uni.reLaunch({
url: '/pages/YNEduApp/learnProj/learnProjDetail?studyId=' + this.studyId
})
}
this.showModal = false
// uni.navigateBack()
- uni.redirectTo({
+ uni.reLaunch({
url: '/pages/YNEduApp/prac/prac'
})
},
@@ -674,6 +685,11 @@ export default {
// const res = await this.getPracticeQuestionList()
// console.log('🚀 ~ openSelect ~ res:', res)
// this.questionListSelect = res.data
+ const params = {
+ recordId: this.recordId,
+ practiceId: this.practiceId,
+ isMiss: this.isError ? 1 : ''
+ }
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionList',
method: 'post',
@@ -807,12 +823,20 @@ export default {
.option {
margin-bottom: 5px;
padding: 0 15px;
- height: 40px;
+ min-height: 45px;
+ max-height: 100px;
display: flex;
justify-content: space-between;
align-items: center;
background: #ffffff;
border-radius: 8px;
+ overflow: auto;
+ .label {
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+ text-align: left;
+ }
}
.active {
border: 1px solid #1f92df;
diff --git a/pages/YNEduApp/prac/prac.vue b/pages/YNEduApp/prac/prac.vue
index c659bfd..6d18f8b 100644
--- a/pages/YNEduApp/prac/prac.vue
+++ b/pages/YNEduApp/prac/prac.vue
@@ -17,7 +17,7 @@
完成率:{{ item.completionRate }}
@@ -108,14 +108,14 @@ export default {
title: item.name || '',
isNew: item.alreadyNum == 0 ? true : false
}
- uni.navigateTo({
+ uni.reLaunch({
url: '/pages/YNEduApp/prac/pracDetail?params=' + JSON.stringify(params)
})
uni.removeStorageSync('from')
uni.setStorageSync('from', '/pages/YNEduApp/prac/prac')
},
leftClick() {
- uni.navigateTo({
+ uni.reLaunch({
url: '/pages/YNEduApp/index/index'
})
},
diff --git a/pages/YNEduApp/prac/pracDetail.vue b/pages/YNEduApp/prac/pracDetail.vue
index 31f53d3..8129041 100644
--- a/pages/YNEduApp/prac/pracDetail.vue
+++ b/pages/YNEduApp/prac/pracDetail.vue
@@ -1,10 +1,10 @@
-
+
{{ title }}
@@ -128,14 +128,6 @@ export default {
const params = {
id: this.practiceId
}
- // const res = await getPracticeQuestionRate(params)
- // this.title = res.data.name
- // this.userName = res.data.userName
- // this.correctRate = res.data.trueRate
- // this.totalAnswer = res.data.allQuestionNum
- // this.totalCorrect = res.data.trueQuestionNum
- // this.recordId = res.data.recordId
- // console.log('🚀 ~ getData ~ res:', res)
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionRate',
method: 'post',
@@ -147,12 +139,12 @@ export default {
success: res => {
res = res.data
console.log('🚀 ~ handleSubmit ~ res:', res)
- // this.title = res.data.name
- // this.userName = res.data.userName
- // this.correctRate = res.data.trueRate
- // this.totalAnswer = res.data.allQuestionNum
- // this.totalCorrect = res.data.trueQuestionNum
- // this.recordId = res.data.recordId
+ this.title = res.data.name
+ this.userName = res.data.userName
+ this.correctRate = res.data.trueRate || '0%'
+ this.totalAnswer = res.data.allQuestionNum || 0
+ this.totalCorrect = res.data.trueQuestionNum || 0
+ this.recordId = res.data.recordId
},
fail: err => {
console.log(err)
@@ -181,7 +173,7 @@ export default {
params.isNew = '1'
}
console.log('params', params)
- uni.navigateTo({
+ uni.reLaunch({
url: `/pages/YNEduApp/prac/exercises?params=${JSON.stringify(params)}`
})
},
@@ -190,7 +182,7 @@ export default {
if (this.studyId) {
from = from + '?id=' + this.studyId
}
- uni.navigateTo({
+ uni.reLaunch({
url: from
})
}
@@ -219,7 +211,7 @@ export default {
}
.title {
margin-top: 50px;
- margin-bottom: 30px;
+ margin-bottom: 80px;
font-weight: 800;
font-size: 26px;
color: #fff;
diff --git a/pages/YNEduApp/user/faceScan.vue b/pages/YNEduApp/user/faceScan.vue
index 5ce27f8..6f439a5 100644
--- a/pages/YNEduApp/user/faceScan.vue
+++ b/pages/YNEduApp/user/faceScan.vue
@@ -21,7 +21,10 @@
正对手机
-
+
+
+
+
@@ -33,13 +36,15 @@
收集您的信息,以实现在考试中检测是否是您本人操作,请务必录入您本人的面部信息
-
+
+