|
@@ -495,12 +495,39 @@ export default {
|
|
return omit(item, ["key", "mainId", "expandSub"]);
|
|
return omit(item, ["key", "mainId", "expandSub"]);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ statPaperStructure() {
|
|
|
|
+ const questionCount = this.tableData.length;
|
|
|
|
+
|
|
|
|
+ const subjectiveQuestionCount = this.tableData.filter(
|
|
|
|
+ (item) => !item.isObjective
|
|
|
|
+ ).length;
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ questionCount,
|
|
|
|
+ paperTotalScore: calcSum(
|
|
|
|
+ this.tableData.map((item) => item.totalScore || 0)
|
|
|
|
+ ),
|
|
|
|
+ subjectiveQuestionCount,
|
|
|
|
+ objectiveQuestionCount: questionCount - subjectiveQuestionCount,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
async submit() {
|
|
async submit() {
|
|
if (this.loading) return;
|
|
if (this.loading) return;
|
|
if (!this.checkData()) return;
|
|
if (!this.checkData()) return;
|
|
|
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
const questions = this.getData();
|
|
const questions = this.getData();
|
|
|
|
+ const paperStat = this.statPaperStructure();
|
|
|
|
+ let tipsContent = `本试卷共${paperStat.questionCount}道小题,客观题${paperStat.objectiveQuestionCount}道,主观题${paperStat.subjectiveQuestionCount}道,总分为${paperStat.paperTotalScore}分。`;
|
|
|
|
+ const confirm = await this.$confirm(
|
|
|
|
+ `${tipsContent}确定要提交吗?`,
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
const res = await markStructureSave({
|
|
const res = await markStructureSave({
|
|
examId: this.basicInfo.examId,
|
|
examId: this.basicInfo.examId,
|
|
paperNumber: this.basicInfo.paperNumber,
|
|
paperNumber: this.basicInfo.paperNumber,
|