|
@@ -19,9 +19,11 @@
|
|
|
<div class="left-box">
|
|
|
<Header-tab-box
|
|
|
:num="questionOverNum(true)"
|
|
|
+ :allNum="questionList.length"
|
|
|
@prevQuestion="prevQuestion"
|
|
|
@nextQuestion="nextQuestion"
|
|
|
- ></Header-tab-box>
|
|
|
+ >
|
|
|
+ </Header-tab-box>
|
|
|
<div class="left-box__body">
|
|
|
<template v-for="(question, questionIndex) in questionList">
|
|
|
<div
|
|
@@ -782,7 +784,8 @@
|
|
|
rows="5"
|
|
|
v-model="json.ansText.text"
|
|
|
resize="none"
|
|
|
- ></el-input>
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
<div class="upload clearfix">
|
|
|
<div
|
|
|
class="upload__imgs"
|
|
@@ -987,7 +990,8 @@
|
|
|
:param="param"
|
|
|
@sumit="getCollectInfo(current)"
|
|
|
:showT="!collectList[current]"
|
|
|
- ></Collection-box>
|
|
|
+ >
|
|
|
+ </Collection-box>
|
|
|
</div>
|
|
|
<div class="right-box">
|
|
|
<div class="right-box__header">
|
|
@@ -998,8 +1002,8 @@
|
|
|
size="small"
|
|
|
class="back-btn"
|
|
|
@click="$router.back(-1)"
|
|
|
- >返回</el-button
|
|
|
- >
|
|
|
+ >返回
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
|
|
|
<div class="right-box__footer">
|
|
@@ -1143,24 +1147,28 @@ export default {
|
|
|
current: 0,
|
|
|
bankType: 0,
|
|
|
timer: null,
|
|
|
- examData: {},
|
|
|
orderGoodsId: "",
|
|
|
collectList: [],
|
|
|
isSubmit: false,
|
|
|
postTimer: null,
|
|
|
- examName: "",
|
|
|
+ number: "",
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
|
this.orderGoodsId = this.$route.query.orderGoodsId || "";
|
|
|
this.current = +this.$route.query.current || 0;
|
|
|
this.goodsId = this.$route.params.goodsId;
|
|
|
+ this.number = this.$route.query.number;
|
|
|
this.examId = this.$route.query.examId;
|
|
|
this.moduleId = this.$route.query.moduleId;
|
|
|
this.chapterId = this.$route.query.chapterId;
|
|
|
-
|
|
|
await this.bankExam();
|
|
|
- this.goodsQuestionList();
|
|
|
+ if (!this.number) {
|
|
|
+ this.goodsQuestionList();
|
|
|
+ } else {
|
|
|
+ // 随机练习
|
|
|
+ this.goodsExamRandomList();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
beforeDestroy() {
|
|
@@ -1291,6 +1299,7 @@ export default {
|
|
|
questionId: this.questionList[current].questionId,
|
|
|
goodsId: this.goodsId,
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
+ doMode: this.doMode,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.$set(this.collectList, current, res.data);
|
|
@@ -1370,8 +1379,6 @@ export default {
|
|
|
|
|
|
res.data.forEach((item, index) => {
|
|
|
item.jsonStr = JSON.parse(item.jsonStr);
|
|
|
-
|
|
|
- console.log(item.type, "item");
|
|
|
if (item.type == 2) {
|
|
|
//多选
|
|
|
item.jsonStr.forEach((str) => {
|
|
@@ -1495,7 +1502,150 @@ export default {
|
|
|
await this.examRecord();
|
|
|
});
|
|
|
},
|
|
|
+ // 随机练习题目
|
|
|
+ goodsExamRandomList() {
|
|
|
+ this.$request
|
|
|
+ .goodsExamRandomList({
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ number: this.number,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ })
|
|
|
+ .then(async (res) => {
|
|
|
+ if (!res.data.questionList.length) {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "该试卷暂无题目",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.examId = res.data.examId;
|
|
|
+ this.bankType = 1;
|
|
|
+ res.data.questionList.forEach((item, index) => {
|
|
|
+ item.jsonStr = JSON.parse(item.jsonStr);
|
|
|
+
|
|
|
+ console.log(item.type, "item");
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ 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 = res.data.questionList;
|
|
|
+ this.lastCount = this.questionList.length;
|
|
|
+ this.getCollectInfo(this.current);
|
|
|
+ await this.examRecord();
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* 记录总题数,获取recordId
|
|
|
* hasSpecial (是否包含简答和案例) true 包含 false 不包含
|
|
@@ -1523,6 +1673,7 @@ export default {
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
totalQuestionNum: questionList,
|
|
|
allQuestionNum: this.questionList.length,
|
|
|
+ doMode: this.doMode,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.recordId = res.data;
|
|
@@ -1657,7 +1808,9 @@ export default {
|
|
|
doQuestionNum: doQuestionNum,
|
|
|
historyExamJson: JSON.stringify(this.questionList),
|
|
|
})
|
|
|
- .then((res) => {});
|
|
|
+ .then((res) => {
|
|
|
+ this.punchClock();
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1665,10 +1818,13 @@ export default {
|
|
|
*/
|
|
|
bankExam() {
|
|
|
return new Promise((resolve) => {
|
|
|
+ if (this.examType) {
|
|
|
+ this.bankType = 1;
|
|
|
+ resolve();
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$request.bankExam(this.examId).then((res) => {
|
|
|
this.bankType = res.data.doType;
|
|
|
- this.examName = res.data.examName;
|
|
|
- this.examData = res.data;
|
|
|
if (this.bankType == 2) {
|
|
|
this.needBack = true;
|
|
|
}
|
|
@@ -1804,6 +1960,7 @@ export default {
|
|
|
* 判断点击确认
|
|
|
*/
|
|
|
judgeSelect(question, questionIndex, index) {
|
|
|
+ console.log(this.bankType);
|
|
|
// if (question.ques) return;
|
|
|
if (question.ques && this.bankType == 1) {
|
|
|
return;
|
|
@@ -2171,7 +2328,7 @@ export default {
|
|
|
|
|
|
if (isOver) {
|
|
|
count++;
|
|
|
- console.log(item, 444);
|
|
|
+ console.log(item, 4441);
|
|
|
}
|
|
|
}
|
|
|
} else if (item.type == 5) {
|
|
@@ -2187,31 +2344,6 @@ export default {
|
|
|
|
|
|
return count;
|
|
|
},
|
|
|
-
|
|
|
- collect(state, index) {
|
|
|
- if (!state) {
|
|
|
- this.$request
|
|
|
- .collectQuestion({
|
|
|
- examId: this.examId,
|
|
|
- questionId: this.questionList[index].questionId,
|
|
|
- goodsId: this.goodsId || "",
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.$set(this.collectList, index, true);
|
|
|
- this.$message.success("收藏成功");
|
|
|
- this.getCollectInfo(index);
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$request
|
|
|
- .deleteCollectQuestion(this.collectList[index].collectQuestionId)
|
|
|
- .then((res) => {
|
|
|
- this.$set(this.collectList, index, false);
|
|
|
- this.$message.success("取消收藏成功");
|
|
|
- });
|
|
|
- }
|
|
|
- return;
|
|
|
- },
|
|
|
submit() {
|
|
|
let ansCount = this.questionOverNum(true); //已答题数
|
|
|
this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
|
|
@@ -2279,7 +2411,6 @@ export default {
|
|
|
* 交卷,跳转报告页
|
|
|
*/
|
|
|
examSubmit() {
|
|
|
- console.log(12313);
|
|
|
this.loading = true;
|
|
|
clearInterval(this.timer);
|
|
|
clearInterval(this.postTimer);
|
|
@@ -2466,7 +2597,7 @@ export default {
|
|
|
type: "success",
|
|
|
message: "交卷成功",
|
|
|
});
|
|
|
-
|
|
|
+ this.punchClock();
|
|
|
setTimeout(() => {
|
|
|
this.$router.replace({
|
|
|
path: "/bank-report/" + this.goodsId,
|
|
@@ -2476,6 +2607,7 @@ export default {
|
|
|
moduleId: this.moduleId,
|
|
|
examId: this.examId,
|
|
|
recordId: this.recordId,
|
|
|
+ examType: this.examType,
|
|
|
},
|
|
|
});
|
|
|
}, 1000);
|
|
@@ -2493,11 +2625,24 @@ export default {
|
|
|
questionIds: doWrongQuestionIds,
|
|
|
recordId: this.recordId,
|
|
|
type: 1,
|
|
|
+ doMode: this.doMode,
|
|
|
})
|
|
|
.then((res) => {})
|
|
|
.catch((err) => {});
|
|
|
},
|
|
|
-
|
|
|
+ // 打卡
|
|
|
+ punchClock() {
|
|
|
+ if (this.examType != 1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$request.punchClock({
|
|
|
+ chapterExamId: this.chapterId,
|
|
|
+ examId: this.examId,
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ moduleExamId: this.moduleId,
|
|
|
+ recordTime: new Date(new Date().setHours(0, 0, 0, 0)) / 1000,
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* 交卷,不用跳转
|
|
|
*/
|
|
@@ -2668,7 +2813,9 @@ export default {
|
|
|
doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
|
|
|
historyExamJson: JSON.stringify(this.questionList),
|
|
|
})
|
|
|
- .then((res) => {});
|
|
|
+ .then((res) => {
|
|
|
+ this.punchClock();
|
|
|
+ });
|
|
|
|
|
|
console.log(222);
|
|
|
//错题集id提交(客观题)
|
|
@@ -2680,6 +2827,7 @@ export default {
|
|
|
questionIds: doWrongQuestionIds,
|
|
|
recordId: this.recordId,
|
|
|
type: 1,
|
|
|
+ doMode: this.doMode,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
@@ -2701,8 +2849,15 @@ export default {
|
|
|
collectQuestionId: this.collectList[this.current]
|
|
|
? this.collectList[this.current].collectQuestionId
|
|
|
: undefined,
|
|
|
+ doMode: this.doMode,
|
|
|
};
|
|
|
},
|
|
|
+ doMode() {
|
|
|
+ return this.number ? 2 : 1;
|
|
|
+ },
|
|
|
+ examType() {
|
|
|
+ return this.$route.query.examType || (this.number ? 2 : 0);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -2712,6 +2867,7 @@ export default {
|
|
|
.course-exam {
|
|
|
.section {
|
|
|
overflow: hidden;
|
|
|
+
|
|
|
&__header {
|
|
|
height: 20px;
|
|
|
margin-top: 20px;
|
|
@@ -2719,12 +2875,10 @@ export default {
|
|
|
|
|
|
&__body {
|
|
|
.explain-record {
|
|
|
- &__header {
|
|
|
- }
|
|
|
-
|
|
|
&__body {
|
|
|
margin-bottom: 20px;
|
|
|
border: 1px solid #eee;
|
|
|
+
|
|
|
.left-box {
|
|
|
position: relative;
|
|
|
float: left;
|
|
@@ -2738,6 +2892,7 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
height: 100%;
|
|
|
+
|
|
|
&__title {
|
|
|
padding-left: 12px;
|
|
|
font-size: 16px;
|
|
@@ -2756,6 +2911,7 @@ export default {
|
|
|
color: #666666;
|
|
|
line-height: 24px;
|
|
|
text-align: justify;
|
|
|
+
|
|
|
/deep/ img {
|
|
|
max-width: 100% !important;
|
|
|
}
|
|
@@ -2775,6 +2931,7 @@ export default {
|
|
|
.question-list {
|
|
|
padding: 24px 0 24px 24px;
|
|
|
border-bottom: 1px solid #eee;
|
|
|
+
|
|
|
.checkbox,
|
|
|
.radio {
|
|
|
cursor: pointer;
|
|
@@ -2793,13 +2950,16 @@ export default {
|
|
|
&.right {
|
|
|
background: #37c65b;
|
|
|
}
|
|
|
+
|
|
|
&.wrong {
|
|
|
background: #ff3a30;
|
|
|
}
|
|
|
+
|
|
|
&.user_choose {
|
|
|
background: #007aff;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
&.textarea {
|
|
|
margin-right: 12px;
|
|
|
|
|
@@ -2824,6 +2984,7 @@ export default {
|
|
|
max-height: 100%;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
&__btn {
|
|
|
margin-right: 10px;
|
|
|
width: 80px;
|
|
@@ -2863,14 +3024,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/deep/
|
|
|
.el-checkbox__input.is-checked
|
|
|
+ .el-checkbox__label {
|
|
|
color: #000 !important;
|
|
|
}
|
|
|
+
|
|
|
.el-checkbox__input.is-disabled + span.el-checkbox__label {
|
|
|
color: #000;
|
|
|
}
|
|
|
+
|
|
|
/deep/ .el-checkbox {
|
|
|
white-space: normal;
|
|
|
}
|
|
@@ -2946,6 +3110,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.question {
|
|
|
padding-bottom: 58px;
|
|
|
}
|
|
@@ -2954,6 +3119,7 @@ export default {
|
|
|
&__btns {
|
|
|
position: relative;
|
|
|
height: 32px;
|
|
|
+
|
|
|
.submit {
|
|
|
cursor: pointer;
|
|
|
margin: 0 auto;
|
|
@@ -3058,6 +3224,7 @@ export default {
|
|
|
&.green {
|
|
|
background: #37c65b;
|
|
|
}
|
|
|
+
|
|
|
&.red {
|
|
|
background: #ff3a30;
|
|
|
}
|
|
@@ -3065,6 +3232,7 @@ export default {
|
|
|
&.yellow {
|
|
|
background: #ffc53d;
|
|
|
}
|
|
|
+
|
|
|
&.blue,
|
|
|
&.check_ans {
|
|
|
background: #3f8dfd;
|
|
@@ -3080,18 +3248,21 @@ export default {
|
|
|
&::-webkit-scrollbar {
|
|
|
width: 6px;
|
|
|
}
|
|
|
+
|
|
|
&::-webkit-scrollbar-track {
|
|
|
background-color: #fff;
|
|
|
-webkit-border-radius: 2em;
|
|
|
-moz-border-radius: 2em;
|
|
|
border-radius: 2em;
|
|
|
}
|
|
|
+
|
|
|
&::-webkit-scrollbar-thumb {
|
|
|
background-color: #eeeeee;
|
|
|
-webkit-border-radius: 2em;
|
|
|
-moz-border-radius: 2em;
|
|
|
border-radius: 2em;
|
|
|
}
|
|
|
+
|
|
|
.list {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
@@ -3128,6 +3299,7 @@ export default {
|
|
|
color: #fff;
|
|
|
background: #3f8dfd;
|
|
|
}
|
|
|
+
|
|
|
&.yellow {
|
|
|
background: #ffc53d;
|
|
|
}
|
|
@@ -3174,6 +3346,7 @@ export default {
|
|
|
/deep/ .el-dialog__header {
|
|
|
display: none;
|
|
|
}
|
|
|
+
|
|
|
/deep/ .el-dialog__body {
|
|
|
padding: 0;
|
|
|
overflow: unset;
|
|
@@ -3207,6 +3380,7 @@ export default {
|
|
|
&__body {
|
|
|
height: 400px;
|
|
|
padding: 40px 24px;
|
|
|
+
|
|
|
.left-box {
|
|
|
width: 336px;
|
|
|
float: left;
|
|
@@ -3245,6 +3419,7 @@ export default {
|
|
|
height: 90px;
|
|
|
border-top: 1px solid #eee;
|
|
|
text-align: center;
|
|
|
+
|
|
|
.take {
|
|
|
display: inline-block;
|
|
|
width: 200px;
|