|
@@ -1072,7 +1072,7 @@ export default {
|
|
|
Footer,
|
|
|
Header,
|
|
|
ToolBar,
|
|
|
- HeaderTabBox
|
|
|
+ HeaderTabBox,
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["sysTime"]),
|
|
@@ -1122,8 +1122,8 @@ export default {
|
|
|
needPhoto: false,
|
|
|
lastTime: 0, //剩余考试时长
|
|
|
allTimes: 0, //总考试时长
|
|
|
- goodsId:"",
|
|
|
- orderGoodsId:"",
|
|
|
+ goodsId: "",
|
|
|
+ orderGoodsId: "",
|
|
|
lastCount: 0,
|
|
|
examId: 0,
|
|
|
current: 0,
|
|
@@ -1138,8 +1138,8 @@ export default {
|
|
|
isAutoSubmit: false,
|
|
|
examEndTime: 0,
|
|
|
examStartTime: 0,
|
|
|
- doMode:1,//3模考组卷1普通考卷
|
|
|
- simulateExamId:''
|
|
|
+ doMode: 1, //3模考组卷1普通考卷
|
|
|
+ simulateExamId: "",
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
@@ -1290,7 +1290,7 @@ export default {
|
|
|
questionId: this.questionList[current].questionId,
|
|
|
goodsId: this.goodsId,
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
- doMode: this.doMode
|
|
|
+ doMode: this.doMode,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.$set(this.collectList, current, res.data);
|
|
@@ -1326,161 +1326,92 @@ export default {
|
|
|
* 请求题目列表
|
|
|
*/
|
|
|
goodsQuestionList() {
|
|
|
- console.log(this.doMode,this.examId,this.goodsId)
|
|
|
- this.$request[this.doMode==3?'goodsRandomQuestionList':'goodsQuestionList']({
|
|
|
- examId: this.examId,
|
|
|
- goodsId: this.goodsId,
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- })
|
|
|
- .then(async (data) => {
|
|
|
- if(this.doMode==3){
|
|
|
- this.simulateExamId = data.data.simulateExamId
|
|
|
- data = data.data.questionList
|
|
|
- }
|
|
|
- if (!data.length) {
|
|
|
- this.$message({
|
|
|
- type: "warning",
|
|
|
- message: "该试卷暂无题目",
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
+ console.log(this.doMode, this.examId, this.goodsId);
|
|
|
+ this.$request[
|
|
|
+ this.doMode == 3 ? "goodsRandomQuestionList" : "goodsQuestionList"
|
|
|
+ ]({
|
|
|
+ examId: this.examId,
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ from: this.doMode == 3 ? 3 : "",
|
|
|
+ }).then(async (data) => {
|
|
|
+ if (this.doMode == 3) {
|
|
|
+ this.simulateExamId = data.data.simulateExamId;
|
|
|
+ data = data.data.questionList;
|
|
|
+ }
|
|
|
+ if (!data.length) {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "该试卷暂无题目",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- if (this.subscribeId) {
|
|
|
- this.lastTime = this.examEndTime - this.sysTime;
|
|
|
- //考试时间到了自动交卷
|
|
|
- if (this.lastTime) {
|
|
|
- this.timer = setInterval(() => {
|
|
|
- if (this.lastTime <= 0) {
|
|
|
- clearInterval(this.timer);
|
|
|
- this.$confirm(`考试时间已到,系统将自动交卷`, "提示", {
|
|
|
- confirmButtonText: "立即交卷",
|
|
|
- closeOnClickModal: false,
|
|
|
- showCancelButton: false,
|
|
|
- closeOnPressEscape: false,
|
|
|
- distinguishCancelAndClose: false,
|
|
|
- showClose: false,
|
|
|
- });
|
|
|
- this.isAutoSubmit = true;
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- try {
|
|
|
- this.$msgbox.close();
|
|
|
- } catch (err) {}
|
|
|
- this.examSubmit();
|
|
|
- }, 3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- this.lastTime--;
|
|
|
- }, 1000);
|
|
|
- } else {
|
|
|
- }
|
|
|
+ if (this.subscribeId) {
|
|
|
+ this.lastTime = this.examEndTime - this.sysTime;
|
|
|
+ //考试时间到了自动交卷
|
|
|
+ if (this.lastTime) {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ if (this.lastTime <= 0) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ this.$confirm(`考试时间已到,系统将自动交卷`, "提示", {
|
|
|
+ confirmButtonText: "立即交卷",
|
|
|
+ closeOnClickModal: false,
|
|
|
+ showCancelButton: false,
|
|
|
+ closeOnPressEscape: false,
|
|
|
+ distinguishCancelAndClose: false,
|
|
|
+ showClose: false,
|
|
|
+ });
|
|
|
+ this.isAutoSubmit = true;
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ try {
|
|
|
+ this.$msgbox.close();
|
|
|
+ } catch (err) {}
|
|
|
+ this.examSubmit();
|
|
|
+ }, 3000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.lastTime--;
|
|
|
+ }, 1000);
|
|
|
+ } else {
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- data.forEach((item, index) => {
|
|
|
- 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) {
|
|
|
- //案例题
|
|
|
- console.log(item.jsonStr);
|
|
|
- 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;
|
|
|
- }
|
|
|
+ data.forEach((item, index) => {
|
|
|
+ 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,
|
|
@@ -1491,15 +1422,86 @@ export default {
|
|
|
/<img/gi,
|
|
|
'<img style="max-width:100%;"'
|
|
|
));
|
|
|
- item.ques = "";
|
|
|
- item.ans = item.answerQuestion;
|
|
|
- });
|
|
|
|
|
|
- this.questionList = data;
|
|
|
- this.lastCount = this.questionList.length;
|
|
|
- this.getCollectInfo(this.current)
|
|
|
- await this.mockRecord();
|
|
|
+ return;
|
|
|
+ } else if (item.type == 4) {
|
|
|
+ //案例题
|
|
|
+ console.log(item.jsonStr);
|
|
|
+ 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.lastCount = this.questionList.length;
|
|
|
+ this.getCollectInfo(this.current);
|
|
|
+ await this.mockRecord();
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 记录总题数,获取recordId
|
|
@@ -2137,7 +2139,7 @@ export default {
|
|
|
questionId: this.questionList[index].questionId,
|
|
|
goodsId: this.goodsId || "",
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
- doMode:this.doMode
|
|
|
+ doMode: this.doMode,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.$set(this.collectList, index, true);
|
|
@@ -2619,7 +2621,7 @@ export default {
|
|
|
examId: this.examId,
|
|
|
questionIds: doWrongQuestionIds,
|
|
|
recordId: this.recordId,
|
|
|
- doMode: this.doMode
|
|
|
+ doMode: this.doMode,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
@@ -2629,7 +2631,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
-
|
|
|
};
|
|
|
</script>
|
|
|
|