|
@@ -585,17 +585,19 @@ export default {
|
|
|
let curTime = new Date();
|
|
|
this.answerTime.endTime = curTime; // 赋值开始时间
|
|
|
this.$store.commit("toggleLoading", true);
|
|
|
- let grades = this.getUserExamAllPointsFun(); // 方法:计算成绩
|
|
|
+ let res = this.getUserExamAllPointsFun(); // 方法:计算成绩
|
|
|
+ let grades = res.grades;
|
|
|
+ let num = res.num;
|
|
|
let answers = this.getUserExamAllAnswersFun(); // 方法:获取当前用户所有题目作答的答案
|
|
|
if (this.answerRecruitId === "weekly-questions") {
|
|
|
- this.weeklyExamsEnd(grades, answers);
|
|
|
+ this.weeklyExamsEnd(grades, num, answers);
|
|
|
} else if (this.answerRecruitId === "special-questions") {
|
|
|
- this.specialExamEnd(grades, answers);
|
|
|
+ this.specialExamEnd(grades, num, answers);
|
|
|
} else {
|
|
|
- this.normalExamsEnd(grades, answers);
|
|
|
+ this.normalExamsEnd(grades, num, answers);
|
|
|
}
|
|
|
},
|
|
|
- normalExamsEnd(grades, answers) {
|
|
|
+ normalExamsEnd(grades, num, answers) {
|
|
|
let params = {
|
|
|
userId: this.userInfo.userName,
|
|
|
examId: this.answerRecruitId,
|
|
@@ -617,7 +619,7 @@ export default {
|
|
|
name: "answerRecruitResult",
|
|
|
params: {
|
|
|
allQuestionsNum: this.examQuestionList.length,
|
|
|
- grades: grades
|
|
|
+ rightNum: num
|
|
|
}
|
|
|
});
|
|
|
})
|
|
@@ -628,7 +630,7 @@ export default {
|
|
|
this.$router.back();
|
|
|
});
|
|
|
},
|
|
|
- weeklyExamsEnd(grades, answers) {
|
|
|
+ weeklyExamsEnd(grades, num, answers) {
|
|
|
let params = {
|
|
|
userName: this.userInfo.userName,
|
|
|
weeklyQuestionId: this.questionId,
|
|
@@ -650,7 +652,7 @@ export default {
|
|
|
name: "answerRecruitResult",
|
|
|
params: {
|
|
|
allQuestionsNum: this.examQuestionList.length,
|
|
|
- grades: grades
|
|
|
+ grades: num
|
|
|
}
|
|
|
});
|
|
|
})
|
|
@@ -661,7 +663,7 @@ export default {
|
|
|
this.$router.back();
|
|
|
});
|
|
|
},
|
|
|
- specialExamEnd(grades, answers) {
|
|
|
+ specialExamEnd(grades, num, answers) {
|
|
|
let params = {
|
|
|
userName: this.userInfo.userName,
|
|
|
specialQuestionId: this.questionId,
|
|
@@ -683,7 +685,7 @@ export default {
|
|
|
name: "answerRecruitResult",
|
|
|
params: {
|
|
|
allQuestionsNum: this.examQuestionList.length,
|
|
|
- grades: grades
|
|
|
+ grades: num
|
|
|
}
|
|
|
});
|
|
|
})
|
|
@@ -696,14 +698,15 @@ export default {
|
|
|
},
|
|
|
// 方法:计算成绩
|
|
|
getUserExamAllPointsFun() {
|
|
|
- let grades = 0;
|
|
|
+ let result = { "grades": 0, "num": 0 };
|
|
|
this.examQuestionList.forEach(item => {
|
|
|
let isSure = this.getAnswerItemResultFun(item);
|
|
|
if (isSure) {
|
|
|
- grades++; // 默认每题一分
|
|
|
+ result.grades += item.points; // 默认每题一分
|
|
|
+ result.num += 1;
|
|
|
}
|
|
|
});
|
|
|
- return grades;
|
|
|
+ return result;
|
|
|
},
|
|
|
// 方法:获取题目的答案
|
|
|
getUserExamAllAnswersFun() {
|