|
@@ -5,13 +5,13 @@
|
|
|
<div class="container">
|
|
<div class="container">
|
|
|
<div class="section__header">
|
|
<div class="section__header">
|
|
|
<!-- <el-breadcrumb separator="/">
|
|
<!-- <el-breadcrumb separator="/">
|
|
|
- <el-breadcrumb-item
|
|
|
|
|
- v-for="(item, index) in $route.matched"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :to="{ path: item.path }"
|
|
|
|
|
- >{{ item.name }}</el-breadcrumb-item
|
|
|
|
|
- >
|
|
|
|
|
- </el-breadcrumb> -->
|
|
|
|
|
|
|
+ <el-breadcrumb-item
|
|
|
|
|
+ v-for="(item, index) in $route.matched"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :to="{ path: item.path }"
|
|
|
|
|
+ >{{ item.name }}</el-breadcrumb-item
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-breadcrumb> -->
|
|
|
</div>
|
|
</div>
|
|
|
<div class="section__body">
|
|
<div class="section__body">
|
|
|
<div class="explain-record">
|
|
<div class="explain-record">
|
|
@@ -1265,6 +1265,9 @@ export default {
|
|
|
self.needPhoto = true;
|
|
self.needPhoto = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if (res.data.erJianErZao) {
|
|
|
|
|
+ self.needPhoto = true;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
resolve();
|
|
resolve();
|
|
|
});
|
|
});
|
|
@@ -1317,129 +1320,7 @@ export default {
|
|
|
this.allTimes = this.examData.answerTime * 60;
|
|
this.allTimes = this.examData.answerTime * 60;
|
|
|
this.lastTime =
|
|
this.lastTime =
|
|
|
this.examData.answerTime && this.examData.answerTime * 60;
|
|
this.examData.answerTime && this.examData.answerTime * 60;
|
|
|
-
|
|
|
|
|
- data.forEach((item, index) => {
|
|
|
|
|
- if (typeof item.jsonStr == "string") {
|
|
|
|
|
- item.jsonStr = JSON.parse(item.jsonStr);
|
|
|
|
|
-
|
|
|
|
|
- if (item.type == 2) {
|
|
|
|
|
- //多选
|
|
|
|
|
- item.jsonStr.forEach(str => {
|
|
|
|
|
- str.optionsId = "" + str.optionsId;
|
|
|
|
|
- });
|
|
|
|
|
- let arr = item.answerQuestion.split(",");
|
|
|
|
|
- arr.forEach((a, i) => {
|
|
|
|
|
- arr[i] = "" + a;
|
|
|
|
|
- });
|
|
|
|
|
- item.ans = arr;
|
|
|
|
|
- item.quesSelect = [];
|
|
|
|
|
- item.analysisContent &&
|
|
|
|
|
- (item.analysisContent = item.analysisContent.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
- item.content &&
|
|
|
|
|
- (item.content = item.content.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
- return;
|
|
|
|
|
- } else if (item.type == 5) {
|
|
|
|
|
- //简答题
|
|
|
|
|
- item.ansText = {
|
|
|
|
|
- text: "",
|
|
|
|
|
- imageList: []
|
|
|
|
|
- };
|
|
|
|
|
- item.ques = {
|
|
|
|
|
- text: "",
|
|
|
|
|
- imageList: []
|
|
|
|
|
- };
|
|
|
|
|
- item.analysisContent &&
|
|
|
|
|
- (item.analysisContent = item.analysisContent.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
- item.content &&
|
|
|
|
|
- (item.content = item.content.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
-
|
|
|
|
|
- return;
|
|
|
|
|
- } else if (item.type == 4) {
|
|
|
|
|
- //案例题
|
|
|
|
|
- item.ques = [];
|
|
|
|
|
- item.tabIndex = "0";
|
|
|
|
|
- let ansArr = [];
|
|
|
|
|
- item.jsonStr.forEach((json, index) => {
|
|
|
|
|
- if (json.type == 1) {
|
|
|
|
|
- ansArr[index] = json.answerQuestion;
|
|
|
|
|
- json.content &&
|
|
|
|
|
- (json.content = json.content.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
- } else if (json.type == 2) {
|
|
|
|
|
- json.optionsList.forEach(str => {
|
|
|
|
|
- str.optionsId = "" + str.optionsId;
|
|
|
|
|
- });
|
|
|
|
|
- let arr = json.answerQuestion.split(",");
|
|
|
|
|
- arr.forEach((a, i) => {
|
|
|
|
|
- arr[i] = "" + a;
|
|
|
|
|
- });
|
|
|
|
|
- ansArr[index] = arr;
|
|
|
|
|
- json.content &&
|
|
|
|
|
- (json.content = json.content.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
- } else if (json.type == 3) {
|
|
|
|
|
- ansArr[index] = json.answerQuestion;
|
|
|
|
|
- json.content &&
|
|
|
|
|
- (json.content = json.content.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
- } else if (json.type == 5) {
|
|
|
|
|
- ansArr[index] = {
|
|
|
|
|
- text: "",
|
|
|
|
|
- imageList: []
|
|
|
|
|
- };
|
|
|
|
|
- json.ansText = {
|
|
|
|
|
- text: "",
|
|
|
|
|
- imageList: []
|
|
|
|
|
- };
|
|
|
|
|
- json.ques = {
|
|
|
|
|
- text: "",
|
|
|
|
|
- imageList: []
|
|
|
|
|
- };
|
|
|
|
|
- json.content &&
|
|
|
|
|
- (json.content = json.content.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- item.ans = ansArr;
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- item.analysisContent &&
|
|
|
|
|
- (item.analysisContent = item.analysisContent.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
- item.content &&
|
|
|
|
|
- (item.content = item.content.replace(
|
|
|
|
|
- /<img/gi,
|
|
|
|
|
- '<img style="max-width:100%;"'
|
|
|
|
|
- ));
|
|
|
|
|
- item.ques = "";
|
|
|
|
|
- item.ans = item.answerQuestion;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- this.questionList = data;
|
|
|
|
|
|
|
+ this.questionList = this.questionOptimizeFormat(data);
|
|
|
this.lastCount = this.questionList.length;
|
|
this.lastCount = this.questionList.length;
|
|
|
this.getCollectInfo(this.current);
|
|
this.getCollectInfo(this.current);
|
|
|
await this.examRecord();
|
|
await this.examRecord();
|
|
@@ -1721,6 +1602,7 @@ export default {
|
|
|
showClose: false
|
|
showClose: false
|
|
|
}
|
|
}
|
|
|
).then(() => {
|
|
).then(() => {
|
|
|
|
|
+ this.mustBack = true;
|
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -1746,6 +1628,7 @@ export default {
|
|
|
distinguishCancelAndClose: false,
|
|
distinguishCancelAndClose: false,
|
|
|
showClose: false
|
|
showClose: false
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
|
|
+ this.mustBack = true;
|
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -1786,7 +1669,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
this.recordId = res.data;
|
|
this.recordId = res.data;
|
|
|
- console.error(self.needPhoto , this.type , this.learning)
|
|
|
|
|
|
|
+ console.error(self.needPhoto, this.type, this.learning);
|
|
|
// 节不需要拍照
|
|
// 节不需要拍照
|
|
|
if (self.needPhoto && this.type != 2 && !this.learning) {
|
|
if (self.needPhoto && this.type != 2 && !this.learning) {
|
|
|
this.openPhoto();
|
|
this.openPhoto();
|
|
@@ -2377,144 +2260,6 @@ export default {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
let form = this.calculateScore(this.questionList);
|
|
let form = this.calculateScore(this.questionList);
|
|
|
- // let score = 0; //计算总分
|
|
|
|
|
- // let reportStatus = 0;
|
|
|
|
|
- // let number = 0; //做对的题目数量
|
|
|
|
|
- // let doQuestionNum = 0; //做过的题目数量
|
|
|
|
|
- // let allScore = 0; //总分
|
|
|
|
|
- // let passScore = 0;
|
|
|
|
|
- // let doWrongQuestionIds = []; //错题和未做题id(客观题)
|
|
|
|
|
- // let doQuestionIds = []; //做过的题目id
|
|
|
|
|
- // let rightQuestionIds = []; //做对的题目id
|
|
|
|
|
- // let lessQuestionNum = 0;
|
|
|
|
|
- // this.questionList.forEach((item, index) => {
|
|
|
|
|
- // passScore = item.passScore;
|
|
|
|
|
- // if (item.type == 1) {
|
|
|
|
|
- // //正确
|
|
|
|
|
- // if (item.ques == item.ans) {
|
|
|
|
|
- // item.scoreResult = item.score;
|
|
|
|
|
- // score += item.score;
|
|
|
|
|
- // number++;
|
|
|
|
|
- // rightQuestionIds.push(item.questionId);
|
|
|
|
|
- // } else {
|
|
|
|
|
- // //错误
|
|
|
|
|
- // item.scoreResult = 0;
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // doWrongQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // allScore += item.score;
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // doQuestionNum++;
|
|
|
|
|
- // doQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // } else if (item.type == 2) {
|
|
|
|
|
- // let isRight =
|
|
|
|
|
- // item.ans &&
|
|
|
|
|
- // item.ans.every((quesItem, quesIndex) => {
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // return item.ques[quesIndex] == item.ans[quesIndex];
|
|
|
|
|
- // } else {
|
|
|
|
|
- // return false;
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
- // if (isRight) {
|
|
|
|
|
- // score += item.score;
|
|
|
|
|
- // number++;
|
|
|
|
|
- // item.scoreResult = item.score;
|
|
|
|
|
- // rightQuestionIds.push(item.questionId);
|
|
|
|
|
- // } else {
|
|
|
|
|
- // let hasPart = false;
|
|
|
|
|
- // let checkboxScore = 1; //获取单题总分数
|
|
|
|
|
- // item.ques &&
|
|
|
|
|
- // item.ques.forEach((ques, quesIndex) => {
|
|
|
|
|
- // //选错一个全扣
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
|
|
|
|
|
- // checkboxScore = 0;
|
|
|
|
|
- // }
|
|
|
|
|
- // } else {
|
|
|
|
|
- // checkboxScore = 0;
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
- // //没选错
|
|
|
|
|
- // if (checkboxScore) {
|
|
|
|
|
- // checkboxScore = 0;
|
|
|
|
|
- // item.ans.forEach((ans, quesIndex) => {
|
|
|
|
|
- // //漏选扣一部分,对n题给n X partScore 分
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
|
|
|
|
|
- // checkboxScore += item.partScore;
|
|
|
|
|
- // hasPart = true;
|
|
|
|
|
- // }
|
|
|
|
|
- // } else {
|
|
|
|
|
- // checkboxScore = 0;
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // if (!hasPart) {
|
|
|
|
|
- // //0分
|
|
|
|
|
- // item.scoreResult = 0;
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // doWrongQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // } else {
|
|
|
|
|
- // //部分分
|
|
|
|
|
- // // number++;
|
|
|
|
|
- // lessQuestionNum++;
|
|
|
|
|
- // // doWrongQuestionIds.push(item.questionId);
|
|
|
|
|
- // item.scoreResult = checkboxScore;
|
|
|
|
|
- // score += checkboxScore;
|
|
|
|
|
- // // rightQuestionIds.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) {
|
|
|
|
|
- // item.scoreResult = item.score;
|
|
|
|
|
- // score += item.score;
|
|
|
|
|
- // number++;
|
|
|
|
|
- // rightQuestionIds.push(item.questionId);
|
|
|
|
|
- // } else {
|
|
|
|
|
- // item.scoreResult = 0;
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // doWrongQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // allScore += item.score;
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // doQuestionNum++;
|
|
|
|
|
- // doQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // } else if (item.type == 4) {
|
|
|
|
|
- // allScore += item.score;
|
|
|
|
|
- // if (item.ques && item.ques.length) {
|
|
|
|
|
- // doQuestionNum++;
|
|
|
|
|
- // doQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // } else if (item.type == 5) {
|
|
|
|
|
- // allScore += item.score;
|
|
|
|
|
- // if (item.ques && (item.ques.imageList || item.ques.text)) {
|
|
|
|
|
- // doQuestionNum++;
|
|
|
|
|
- // doQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
- // //大于分及格
|
|
|
|
|
- // if (score >= passScore) {
|
|
|
|
|
- // reportStatus = 1;
|
|
|
|
|
- // } else {
|
|
|
|
|
- // reportStatus = 0;
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
|
//交卷 /bank/record/edit
|
|
//交卷 /bank/record/edit
|
|
|
this.$request
|
|
this.$request
|
|
@@ -2607,7 +2352,7 @@ export default {
|
|
|
moduleId: this.moduleId,
|
|
moduleId: this.moduleId,
|
|
|
type: this.type,
|
|
type: this.type,
|
|
|
examId: this.examId,
|
|
examId: this.examId,
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
|
|
|
|
+ orderGoodsId: this.orderGoodsId
|
|
|
})
|
|
})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
this.learning = res.data;
|
|
this.learning = res.data;
|
|
@@ -2624,104 +2369,6 @@ export default {
|
|
|
clearInterval(this.postTimer);
|
|
clearInterval(this.postTimer);
|
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
|
let form = this.calculateScore(this.questionList);
|
|
let form = this.calculateScore(this.questionList);
|
|
|
- // let number = 0;
|
|
|
|
|
- // let score = 0;
|
|
|
|
|
- // let doQuestionNum = 0;
|
|
|
|
|
- // let doQuestionIds = []; //做过的题目id
|
|
|
|
|
- // let lessQuestionNum = 0;
|
|
|
|
|
- // this.questionList.forEach((item, index) => {
|
|
|
|
|
- // if (item.type == 1) {
|
|
|
|
|
- // if (item.ques == item.ans) {
|
|
|
|
|
- // score += item.score;
|
|
|
|
|
- // number++;
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // doQuestionNum++;
|
|
|
|
|
- // doQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // } else if (item.type == 2) {
|
|
|
|
|
- // let isRight =
|
|
|
|
|
- // item.ans &&
|
|
|
|
|
- // item.ans.every((quesItem, quesIndex) => {
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // return item.ques[quesIndex] == item.ans[quesIndex];
|
|
|
|
|
- // } else {
|
|
|
|
|
- // return false;
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
- // if (isRight) {
|
|
|
|
|
- // score += item.score;
|
|
|
|
|
- // number++;
|
|
|
|
|
- // } else {
|
|
|
|
|
- // let hasPart = false;
|
|
|
|
|
- // let checkboxScore = 1; //获取单题总分数
|
|
|
|
|
- // item.ques &&
|
|
|
|
|
- // item.ques.forEach((ques, quesIndex) => {
|
|
|
|
|
- // //选错一个全扣
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
|
|
|
|
|
- // checkboxScore = 0;
|
|
|
|
|
- // }
|
|
|
|
|
- // } else {
|
|
|
|
|
- // checkboxScore = 0;
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
- // console.log(checkboxScore);
|
|
|
|
|
-
|
|
|
|
|
- // //没选错
|
|
|
|
|
- // if (checkboxScore) {
|
|
|
|
|
- // checkboxScore = 0;
|
|
|
|
|
- // item.ans.forEach((ans, quesIndex) => {
|
|
|
|
|
- // //漏选扣一部分,对n题给n X partScore 分
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
|
|
|
|
|
- // checkboxScore += item.partScore;
|
|
|
|
|
- // hasPart = true;
|
|
|
|
|
- // }
|
|
|
|
|
- // } else {
|
|
|
|
|
- // checkboxScore = 0;
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // if (!hasPart) {
|
|
|
|
|
- // //0分
|
|
|
|
|
- // } else {
|
|
|
|
|
- // //部分分
|
|
|
|
|
- // // number++;
|
|
|
|
|
- // lessQuestionNum++;
|
|
|
|
|
- // score += checkboxScore;
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // 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++;
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // if (item.ques) {
|
|
|
|
|
- // doQuestionNum++;
|
|
|
|
|
- // doQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // } else if (item == 4) {
|
|
|
|
|
- // if (item.ques.length) {
|
|
|
|
|
- // doQuestionNum++;
|
|
|
|
|
- // doQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // } else if (item.type == 5) {
|
|
|
|
|
- // if (item.ques && (item.ques.imageList.length || item.ques.text)) {
|
|
|
|
|
- // doQuestionNum++;
|
|
|
|
|
- // doQuestionIds.push(item.questionId);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
this.$request
|
|
this.$request
|
|
|
.bankRecordEdit({
|
|
.bankRecordEdit({
|
|
|
examId: this.examId,
|
|
examId: this.examId,
|
|
@@ -2752,91 +2399,85 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
beforeRouteLeave(to, from, next) {
|
|
|
- if (this.mustBack) {
|
|
|
|
|
|
|
+ if (this.mustBack || this.isSubmit) {
|
|
|
next();
|
|
next();
|
|
|
} else {
|
|
} else {
|
|
|
- if (this.isSubmit) {
|
|
|
|
|
- //交卷
|
|
|
|
|
- next();
|
|
|
|
|
- } else {
|
|
|
|
|
- next(false)
|
|
|
|
|
- //离开
|
|
|
|
|
- let ansCount = this.questionOverNum(true); //已答题数
|
|
|
|
|
- this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
|
|
|
|
|
- if (this.bankType == 1) {
|
|
|
|
|
- //所有题目答完
|
|
|
|
|
- if (this.lastCount == 0) {
|
|
|
|
|
- // this.testOver = true;
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
|
|
|
|
|
- confirmButtonText: "结束做题",
|
|
|
|
|
|
|
+ next(false);
|
|
|
|
|
+ //离开
|
|
|
|
|
+ let ansCount = this.questionOverNum(true); //已答题数
|
|
|
|
|
+ this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
|
|
|
|
|
+ if (this.bankType == 1) {
|
|
|
|
|
+ //所有题目答完
|
|
|
|
|
+ if (this.lastCount == 0) {
|
|
|
|
|
+ // this.testOver = true;
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
|
|
|
|
|
+ confirmButtonText: "结束做题",
|
|
|
|
|
+ cancelButtonText: "下次继续",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.examSubmit();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.examRecordEdit();
|
|
|
|
|
+ next();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ //未答完
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$confirm(
|
|
|
|
|
+ `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
|
|
|
|
|
+ "温馨提示",
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: "继续作答",
|
|
|
cancelButtonText: "下次继续",
|
|
cancelButtonText: "下次继续",
|
|
|
type: "warning"
|
|
type: "warning"
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ // confirmButton回调
|
|
|
})
|
|
})
|
|
|
- .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) {
|
|
|
|
|
- //所有题目答完
|
|
|
|
|
- if (this.lastCount == 0) {
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
|
|
|
|
|
- confirmButtonText: "立即交卷",
|
|
|
|
|
- cancelButtonText: "暂不交卷",
|
|
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.examRecordEdit();
|
|
|
|
|
+ next();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ // this.isLastCount = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (this.bankType == 2) {
|
|
|
|
|
+ //所有题目答完
|
|
|
|
|
+ if (this.lastCount == 0) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
|
|
|
|
|
+ confirmButtonText: "立即交卷",
|
|
|
|
|
+ cancelButtonText: "暂不交卷",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ // confirmButton回调
|
|
|
|
|
+ this.examSubmit();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
|
+ });
|
|
|
|
|
+ //未答完
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$confirm(
|
|
|
|
|
+ `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
|
|
|
|
|
+ "温馨提示",
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: "继续离开",
|
|
|
|
|
+ cancelButtonText: "暂不离开",
|
|
|
type: "warning"
|
|
type: "warning"
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.examSubmit();
|
|
|
})
|
|
})
|
|
|
- .then(() => {
|
|
|
|
|
- // confirmButton回调
|
|
|
|
|
- this.examSubmit();
|
|
|
|
|
- next();
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {});
|
|
|
|
|
- });
|
|
|
|
|
- //未答完
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.$confirm(
|
|
|
|
|
- `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
|
|
|
|
|
- "温馨提示",
|
|
|
|
|
- {
|
|
|
|
|
- confirmButtonText: "继续离开",
|
|
|
|
|
- cancelButtonText: "暂不离开",
|
|
|
|
|
- type: "warning"
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.examSubmit();
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {});
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|