|
@@ -433,7 +433,8 @@ export default {
|
|
|
//继续答题
|
|
|
if(this.isContinue || this.isHistory) {
|
|
|
|
|
|
- console.log(this.isContinue,"历史做题")
|
|
|
+ console.log(this.isHistory,"历史做题")
|
|
|
+ console.log(this.isContinue,"继续做题")
|
|
|
this.$api.examReport(this.recordId).then(res => {
|
|
|
let json = JSON.parse(res.data.data.historyExamJson)
|
|
|
|
|
@@ -567,12 +568,16 @@ export default {
|
|
|
if(!this.isSubmit) {
|
|
|
let number = 0;
|
|
|
let score = 0;
|
|
|
+ let doQuestionNum = 0;
|
|
|
this.questionList.length && this.questionList.forEach((item,index) => {
|
|
|
if(item.type == 1) {
|
|
|
if(item.ques == item.ans) {
|
|
|
score += item.score;
|
|
|
number++
|
|
|
}
|
|
|
+ if (item.ques) {
|
|
|
+ doQuestionNum++;
|
|
|
+ }
|
|
|
} else if(item.type == 2) {
|
|
|
let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
|
|
|
return item.ques[quesIndex] == item.ans[quesIndex]
|
|
@@ -582,11 +587,25 @@ export default {
|
|
|
score += item.score;
|
|
|
number++
|
|
|
}
|
|
|
+ if (item.ques && item.ques.length) {
|
|
|
+ doQuestionNum++;
|
|
|
+ }
|
|
|
} else if(item.type == 3) {
|
|
|
if(item.ques == item.ans) {
|
|
|
score += item.score;
|
|
|
number++
|
|
|
}
|
|
|
+ if (item.ques) {
|
|
|
+ doQuestionNum++;
|
|
|
+ }
|
|
|
+ } else if (item == 4) {
|
|
|
+ if (item.ques.length) {
|
|
|
+ doQuestionNum++;
|
|
|
+ }
|
|
|
+ } else if (item.type == 5) {
|
|
|
+ if (item.ques) {
|
|
|
+ doQuestionNum++;
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -596,6 +615,7 @@ export default {
|
|
|
recordId: this.recordId,
|
|
|
rightQuestionNum:number,
|
|
|
status:0,
|
|
|
+ doQuestionNum: doQuestionNum,
|
|
|
historyExamJson:JSON.stringify(this.questionList)
|
|
|
}).then(res => {
|
|
|
|
|
@@ -638,14 +658,24 @@ export default {
|
|
|
let number = 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) {
|
|
|
+ doQuestionNum++;
|
|
|
+ doQuestionIds.push(item.questionId)
|
|
|
+ }
|
|
|
} else if(item.type == 2) {
|
|
|
let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
|
|
|
return item.ques[quesIndex] == item.ans[quesIndex]
|
|
@@ -654,18 +684,41 @@ export default {
|
|
|
if(isRight) {
|
|
|
score += item.score;
|
|
|
number++
|
|
|
+ rightQuestionIds.push(item.questionId)
|
|
|
+ } else {
|
|
|
+ doWrongQuestionIds.push(item.questionId)
|
|
|
}
|
|
|
allScore += item.score
|
|
|
+ if (item.ques && item.ques.length) {
|
|
|
+ doQuestionNum++;
|
|
|
+ doQuestionIds.push(item.questionId)
|
|
|
+ }
|
|
|
} else if(item.type == 3) {
|
|
|
if(item.ques == item.ans) {
|
|
|
score += item.score;
|
|
|
number++
|
|
|
+ rightQuestionIds.push(item.questionId)
|
|
|
+ } else {
|
|
|
+ doWrongQuestionIds.push(item.questionId)
|
|
|
+ }
|
|
|
+ allScore += item.score;
|
|
|
+ if (item.ques) {
|
|
|
+ doQuestionNum++;
|
|
|
+ doQuestionIds.push(item.questionId)
|
|
|
+ }
|
|
|
+ } else if (item.type == 4) {
|
|
|
+ if (item.ques && item.ques.length) {
|
|
|
+ doQuestionNum++;
|
|
|
+ }
|
|
|
+ } else if (item.type == 5) {
|
|
|
+ if (item.ques) {
|
|
|
+ doQuestionNum++;
|
|
|
}
|
|
|
- allScore += item.score
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- if(score >= passScore) {
|
|
|
+ //大于60分及格
|
|
|
+ if(score >= 60) {
|
|
|
reportStatus = 1
|
|
|
} else {
|
|
|
reportStatus = 0
|
|
@@ -679,7 +732,10 @@ export default {
|
|
|
recordId: this.recordId,
|
|
|
rightQuestionNum:number,
|
|
|
status:1,
|
|
|
- performance:score,
|
|
|
+ doQuestionIds:doQuestionIds.join(','),
|
|
|
+ rightQuestionIds:rightQuestionIds.join(','),
|
|
|
+ doQuestionNum: doQuestionNum,
|
|
|
+ performance: score,
|
|
|
historyExamJson:JSON.stringify(this.questionList)
|
|
|
}).then(res => {
|
|
|
this.isSubmit = true;
|