|
@@ -1124,36 +1124,40 @@ export default {
|
|
|
//所有题目答完
|
|
|
if (this.lastCount == 0) {
|
|
|
// this.testOver = true;
|
|
|
- this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
|
|
|
- confirmButtonText: "结束做题",
|
|
|
- cancelButtonText: "下次继续",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.examSubmit();
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.examRecordEdit();
|
|
|
- next();
|
|
|
- });
|
|
|
- //未答完
|
|
|
- } else {
|
|
|
- this.$confirm(
|
|
|
- `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
|
|
|
- "温馨提示",
|
|
|
- {
|
|
|
- confirmButtonText: "继续作答",
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
|
|
|
+ confirmButtonText: "结束做题",
|
|
|
cancelButtonText: "下次继续",
|
|
|
type: "warning",
|
|
|
- }
|
|
|
- )
|
|
|
- .then(() => {
|
|
|
- // confirmButton回调
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- this.examRecordEdit();
|
|
|
- next();
|
|
|
- });
|
|
|
+ .then(() => {
|
|
|
+ this.examSubmit();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.examRecordEdit();
|
|
|
+ next();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ //未答完
|
|
|
+ } else {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$confirm(
|
|
|
+ `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
|
|
|
+ "温馨提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "继续作答",
|
|
|
+ cancelButtonText: "下次继续",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ // confirmButton回调
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.examRecordEdit();
|
|
|
+ next();
|
|
|
+ });
|
|
|
+ });
|
|
|
// this.isLastCount = true;
|
|
|
}
|
|
|
} else if (this.bankType == 2) {
|
|
@@ -1163,35 +1167,39 @@ export default {
|
|
|
|
|
|
//所有题目答完
|
|
|
if (this.lastCount == 0) {
|
|
|
- this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
|
|
|
- confirmButtonText: "立即交卷",
|
|
|
- cancelButtonText: "暂不交卷",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- // confirmButton回调
|
|
|
- this.examSubmit();
|
|
|
- next();
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
|
|
|
+ confirmButtonText: "立即交卷",
|
|
|
+ cancelButtonText: "暂不交卷",
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .then(() => {
|
|
|
+ // confirmButton回调
|
|
|
+ this.examSubmit();
|
|
|
+ next();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ });
|
|
|
//未答完
|
|
|
} else {
|
|
|
- this.$confirm(
|
|
|
- `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
|
|
|
- "温馨提示",
|
|
|
- {
|
|
|
- confirmButtonText: "继续离开",
|
|
|
- cancelButtonText: "暂不离开",
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- )
|
|
|
- .then(() => {
|
|
|
- // confirmButton回调
|
|
|
- console.log(12);
|
|
|
- this.leaveNow();
|
|
|
- next();
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$confirm(
|
|
|
+ `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
|
|
|
+ "温馨提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "继续离开",
|
|
|
+ cancelButtonText: "暂不离开",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ // confirmButton回调
|
|
|
+ console.log(12);
|
|
|
+ this.leaveNow();
|
|
|
+ next();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1239,15 +1247,18 @@ export default {
|
|
|
let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
|
|
|
if (this.questionList.length == questionOverNum) {
|
|
|
//全部做完弹窗
|
|
|
- this.$confirm("您已完成所有题目,快去交卷吧!", "提示", {
|
|
|
- confirmButtonText: "立即交卷",
|
|
|
- cancelButtonText: "暂不交卷",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.examSubmit();
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
|
|
|
+ confirmButtonText: "立即交卷",
|
|
|
+ cancelButtonText: "暂不交卷",
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .then(() => {
|
|
|
+ // confirmButton回调
|
|
|
+ this.examSubmit();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -1471,6 +1482,8 @@ export default {
|
|
|
* 离开页面统计回答正确题数
|
|
|
*/
|
|
|
examRecordEdit() {
|
|
|
+ clearInterval(this.postTimer);
|
|
|
+ clearInterval(this.timer);
|
|
|
let number = 0;
|
|
|
let score = 0;
|
|
|
let doQuestionNum = 0;
|
|
@@ -1502,7 +1515,8 @@ export default {
|
|
|
score += item.score;
|
|
|
number++;
|
|
|
} else {
|
|
|
- let checkboxScore = item.score; //获取单题总分数
|
|
|
+ let hasPart = false;
|
|
|
+ let checkboxScore = 1; //获取单题总分数
|
|
|
item.ques &&
|
|
|
item.ques.forEach((ques, quesIndex) => {
|
|
|
//选错一个全扣
|
|
@@ -1524,6 +1538,7 @@ export default {
|
|
|
if (item.ques) {
|
|
|
if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
|
|
|
checkboxScore += item.partScore;
|
|
|
+ hasPart = true;
|
|
|
}
|
|
|
} else {
|
|
|
checkboxScore = 0;
|
|
@@ -1531,7 +1546,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (checkboxScore <= 0) {
|
|
|
+ if (!hasPart) {
|
|
|
//0分
|
|
|
} else {
|
|
|
//部分分
|
|
@@ -1577,6 +1592,7 @@ export default {
|
|
|
rightQuestionNum: number,
|
|
|
moduleExamId: this.moduleId || 0,
|
|
|
chapterExamId: this.chapterId || 0,
|
|
|
+ lessQuestionNum: lessQuestionNum,
|
|
|
status: 0,
|
|
|
doQuestionNum: doQuestionNum,
|
|
|
historyExamJson: JSON.stringify(this.questionList),
|
|
@@ -2162,7 +2178,10 @@ export default {
|
|
|
* 交卷,跳转报告页
|
|
|
*/
|
|
|
examSubmit() {
|
|
|
+ console.log(12313);
|
|
|
this.loading = true;
|
|
|
+ clearInterval(this.timer);
|
|
|
+ clearInterval(this.postTimer);
|
|
|
let score = 0; //计算总分
|
|
|
let reportStatus = 0;
|
|
|
let number = 0; //做对的题目数量
|
|
@@ -2185,7 +2204,9 @@ export default {
|
|
|
} else {
|
|
|
//错误
|
|
|
item.scoreResult = 0;
|
|
|
- doWrongQuestionIds.push(item.questionId);
|
|
|
+ if (item.ques) {
|
|
|
+ doWrongQuestionIds.push(item.questionId);
|
|
|
+ }
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques) {
|
|
@@ -2209,7 +2230,8 @@ export default {
|
|
|
item.scoreResult = item.score;
|
|
|
rightQuestionIds.push(item.questionId);
|
|
|
} else {
|
|
|
- let checkboxScore = item.score; //获取单题总分数
|
|
|
+ let hasPart = false;
|
|
|
+ let checkboxScore = 1; //获取单题总分数
|
|
|
item.ques &&
|
|
|
item.ques.forEach((ques, quesIndex) => {
|
|
|
//选错一个全扣
|
|
@@ -2221,7 +2243,7 @@ export default {
|
|
|
checkboxScore = 0;
|
|
|
}
|
|
|
});
|
|
|
- console.log(checkboxScore);
|
|
|
+ console.log(checkboxScore, "checkboxScore1");
|
|
|
|
|
|
//没选错
|
|
|
if (checkboxScore) {
|
|
@@ -2231,17 +2253,21 @@ export default {
|
|
|
if (item.ques) {
|
|
|
if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
|
|
|
checkboxScore += item.partScore;
|
|
|
+ hasPart = true;
|
|
|
}
|
|
|
} else {
|
|
|
checkboxScore = 0;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ console.log(checkboxScore, "checkboxScore2");
|
|
|
|
|
|
- if (checkboxScore <= 0) {
|
|
|
+ if (!hasPart) {
|
|
|
//0分
|
|
|
item.scoreResult = 0;
|
|
|
- doWrongQuestionIds.push(item.questionId);
|
|
|
+ if (item.ques) {
|
|
|
+ doWrongQuestionIds.push(item.questionId);
|
|
|
+ }
|
|
|
} else {
|
|
|
//部分分
|
|
|
// number++;
|
|
@@ -2265,7 +2291,9 @@ export default {
|
|
|
rightQuestionIds.push(item.questionId);
|
|
|
} else {
|
|
|
item.scoreResult = 0;
|
|
|
- doWrongQuestionIds.push(item.questionId);
|
|
|
+ if (item.ques) {
|
|
|
+ doWrongQuestionIds.push(item.questionId);
|
|
|
+ }
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques) {
|
|
@@ -2333,7 +2361,6 @@ export default {
|
|
|
.then((res) => {
|
|
|
this.isSubmit = true;
|
|
|
this.loading = false;
|
|
|
- clearInterval(this.timer);
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "交卷成功",
|
|
@@ -2352,7 +2379,9 @@ export default {
|
|
|
});
|
|
|
}, 1000);
|
|
|
})
|
|
|
- .catch((err) => {});
|
|
|
+ .catch((err) => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
|
|
|
//错题集id提交(客观题)
|
|
|
this.$request
|
|
@@ -2371,6 +2400,8 @@ export default {
|
|
|
* 交卷,不用跳转
|
|
|
*/
|
|
|
leaveNow() {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ clearInterval(this.postTimer);
|
|
|
let score = 0; //计算总分
|
|
|
let reportStatus = 0;
|
|
|
let number = 0; //做对的题目数量
|
|
@@ -2394,7 +2425,9 @@ export default {
|
|
|
} else {
|
|
|
//错误
|
|
|
item.scoreResult = 0;
|
|
|
- doWrongQuestionIds.push(item.questionId);
|
|
|
+ if (item.ques) {
|
|
|
+ doWrongQuestionIds.push(item.questionId);
|
|
|
+ }
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques) {
|
|
@@ -2418,7 +2451,8 @@ export default {
|
|
|
item.scoreResult = item.score;
|
|
|
rightQuestionIds.push(item.questionId);
|
|
|
} else {
|
|
|
- let checkboxScore = item.score; //获取单题总分数
|
|
|
+ let hasPart = false;
|
|
|
+ let checkboxScore = 1; //获取单题总分数
|
|
|
item.ques &&
|
|
|
item.ques.forEach((ques, quesIndex) => {
|
|
|
//选错一个全扣
|
|
@@ -2430,7 +2464,7 @@ export default {
|
|
|
checkboxScore = 0;
|
|
|
}
|
|
|
});
|
|
|
- console.log(checkboxScore);
|
|
|
+ console.log(checkboxScore, "checkboxScore1");
|
|
|
|
|
|
//没选错
|
|
|
if (checkboxScore) {
|
|
@@ -2440,17 +2474,21 @@ export default {
|
|
|
if (item.ques) {
|
|
|
if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
|
|
|
checkboxScore += item.partScore;
|
|
|
+ hasPart = true;
|
|
|
}
|
|
|
} else {
|
|
|
checkboxScore = 0;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ console.log(checkboxScore, "checkboxScore2");
|
|
|
|
|
|
- if (checkboxScore <= 0) {
|
|
|
+ if (!hasPart) {
|
|
|
//0分
|
|
|
item.scoreResult = 0;
|
|
|
- doWrongQuestionIds.push(item.questionId);
|
|
|
+ if (item.ques) {
|
|
|
+ doWrongQuestionIds.push(item.questionId);
|
|
|
+ }
|
|
|
} else {
|
|
|
//部分分
|
|
|
// number++;
|
|
@@ -2474,7 +2512,9 @@ export default {
|
|
|
rightQuestionIds.push(item.questionId);
|
|
|
} else {
|
|
|
item.scoreResult = 0;
|
|
|
- doWrongQuestionIds.push(item.questionId);
|
|
|
+ if (item.ques) {
|
|
|
+ doWrongQuestionIds.push(item.questionId);
|
|
|
+ }
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques) {
|
|
@@ -2526,9 +2566,7 @@ export default {
|
|
|
doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
|
|
|
historyExamJson: JSON.stringify(this.questionList),
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
- clearInterval(this.timer);
|
|
|
- });
|
|
|
+ .then((res) => {});
|
|
|
|
|
|
console.log(222);
|
|
|
//错题集id提交(客观题)
|
|
@@ -2540,8 +2578,12 @@ export default {
|
|
|
questionIds: doWrongQuestionIds,
|
|
|
recordId: this.recordId,
|
|
|
})
|
|
|
- .then((res) => {})
|
|
|
- .catch((err) => {});
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -2939,7 +2981,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
&__content {
|
|
|
- height: 446px;
|
|
|
+ height: 440px;
|
|
|
overflow-y: scroll;
|
|
|
|
|
|
&::-webkit-scrollbar {
|