|
@@ -905,7 +905,7 @@ export default {
|
|
|
.examWrongRecord({
|
|
|
examId: this.id,
|
|
|
goodsId: this.goodsId,
|
|
|
- questionId: this.questionList[bindex].questionId,
|
|
|
+ questionIds: this.questionList[bindex].questionId,
|
|
|
recordId: this.recordId
|
|
|
})
|
|
|
.then(res => {});
|
|
@@ -967,7 +967,7 @@ export default {
|
|
|
.examWrongRecord({
|
|
|
examId: this.id,
|
|
|
goodsId: this.goodsId,
|
|
|
- questionId: this.questionList[bindex].questionId,
|
|
|
+ questionIds: this.questionList[bindex].questionId,
|
|
|
recordId: this.recordId
|
|
|
})
|
|
|
.then(res => {});
|
|
@@ -1013,7 +1013,7 @@ export default {
|
|
|
.examWrongRecord({
|
|
|
examId: this.id,
|
|
|
goodsId: this.goodsId,
|
|
|
- questionId: this.questionList[bindex].questionId,
|
|
|
+ questionIds: this.questionList[bindex].questionId,
|
|
|
recordId: this.recordId
|
|
|
})
|
|
|
.then(res => {});
|
|
@@ -1089,7 +1089,7 @@ export default {
|
|
|
this.submit();
|
|
|
},
|
|
|
/**
|
|
|
- * 提交数据
|
|
|
+ * 交卷
|
|
|
*/
|
|
|
submit() {
|
|
|
let score = 0; //计算总分
|
|
@@ -1098,15 +1098,19 @@ export default {
|
|
|
let doQuestionNum = 0; //做过的题目数量
|
|
|
let allScore = 0; //总分
|
|
|
let passScore = 0;
|
|
|
+ let doWrongQuestionIds = []; //错题和未做题id(客观题)
|
|
|
let doQuestionIds = []; //做过的题目id
|
|
|
let rightQuestionIds = []; //做对的题目id
|
|
|
this.questionList.forEach((item, index) => {
|
|
|
// passScore = item.passScore
|
|
|
if (item.type == 1) {
|
|
|
+ //正确
|
|
|
if (item.ques == item.ans) {
|
|
|
score += item.score;
|
|
|
number++;
|
|
|
rightQuestionIds.push(item.questionId)
|
|
|
+ } else { //错误
|
|
|
+ doWrongQuestionIds.push(item.questionId)
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques) {
|
|
@@ -1124,6 +1128,8 @@ export default {
|
|
|
score += item.score;
|
|
|
number++;
|
|
|
rightQuestionIds.push(item.questionId)
|
|
|
+ } else {
|
|
|
+ doWrongQuestionIds.push(item.questionId)
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques && item.ques.length) {
|
|
@@ -1135,6 +1141,8 @@ export default {
|
|
|
score += item.score;
|
|
|
number++;
|
|
|
rightQuestionIds.push(item.questionId)
|
|
|
+ } else {
|
|
|
+ doWrongQuestionIds.push(item.questionId)
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques) {
|
|
@@ -1158,7 +1166,8 @@ export default {
|
|
|
} else {
|
|
|
reportStatus = 0
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //交卷
|
|
|
this.$api
|
|
|
.examRecordEdit({
|
|
|
examId: this.id,
|
|
@@ -1181,7 +1190,7 @@ export default {
|
|
|
if (res.data.code == 200) {
|
|
|
uni.showToast({
|
|
|
title: '交卷成功',
|
|
|
- duration: 2000,
|
|
|
+ duration: 1000,
|
|
|
icon: 'none'
|
|
|
});
|
|
|
|
|
@@ -1189,9 +1198,19 @@ export default {
|
|
|
uni.redirectTo({
|
|
|
url: '/pages2/bank/question_report?examId='+this.id+'&id=' + this.recordId
|
|
|
});
|
|
|
- }, 2000);
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ //错题集id提交(客观题)
|
|
|
+ this.$api.examWrongRecord({
|
|
|
+ examId: this.id,
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ questionIds: doWrongQuestionIds.join(','),
|
|
|
+ recordId: this.recordId
|
|
|
+ }).then(res => {
|
|
|
+
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
/**
|