|
@@ -187,7 +187,12 @@
|
|
|
>
|
|
|
确认答案
|
|
|
</div>
|
|
|
- <div class="collect" @click="collect">
|
|
|
+ <div
|
|
|
+ class="collect"
|
|
|
+ @click="
|
|
|
+ collect(collectList[questionIndex], questionIndex)
|
|
|
+ "
|
|
|
+ >
|
|
|
<template v-if="!collectList[questionIndex]"
|
|
|
><i class="el-icon-star-off"></i>收藏本题</template
|
|
|
>
|
|
@@ -253,7 +258,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="question__btns">
|
|
|
- <div class="collect" @click="collect">
|
|
|
+ <div
|
|
|
+ class="collect"
|
|
|
+ @click="
|
|
|
+ collect(collectList[questionIndex], questionIndex)
|
|
|
+ "
|
|
|
+ >
|
|
|
<template v-if="!collectList[questionIndex]"
|
|
|
><i class="el-icon-star-off"></i>收藏本题</template
|
|
|
>
|
|
@@ -687,7 +697,12 @@
|
|
|
</el-tabs>
|
|
|
</div>
|
|
|
<div class="question__btns">
|
|
|
- <div class="collect" @click="collect">
|
|
|
+ <div
|
|
|
+ class="collect"
|
|
|
+ @click="
|
|
|
+ collect(collectList[questionIndex], questionIndex)
|
|
|
+ "
|
|
|
+ >
|
|
|
<template v-if="!collectList[questionIndex]"
|
|
|
><i class="el-icon-star-off"></i>收藏本题</template
|
|
|
>
|
|
@@ -788,7 +803,12 @@
|
|
|
>
|
|
|
确认答案
|
|
|
</div>
|
|
|
- <div class="collect" @click="collect">
|
|
|
+ <div
|
|
|
+ class="collect"
|
|
|
+ @click="
|
|
|
+ collect(collectList[questionIndex], questionIndex)
|
|
|
+ "
|
|
|
+ >
|
|
|
<template v-if="!collectList[questionIndex]"
|
|
|
><i class="el-icon-star-off"></i>收藏本题</template
|
|
|
>
|
|
@@ -859,7 +879,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right-box__footer">
|
|
|
- <div class="submit" @click="submit">交卷</div>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ class="submit"
|
|
|
+ @click="submit"
|
|
|
+ >交卷</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -893,7 +919,34 @@ export default {
|
|
|
questionList: [],
|
|
|
bankList: [],
|
|
|
judge: ["错误", "正确"],
|
|
|
- ast: ["A", "B", "C", "D", "E", "F", "G"],
|
|
|
+ ast: [
|
|
|
+ "A",
|
|
|
+ "B",
|
|
|
+ "C",
|
|
|
+ "D",
|
|
|
+ "E",
|
|
|
+ "F",
|
|
|
+ "G",
|
|
|
+ "H",
|
|
|
+ "I",
|
|
|
+ "J",
|
|
|
+ "K",
|
|
|
+ "L",
|
|
|
+ "M",
|
|
|
+ "N",
|
|
|
+ "O",
|
|
|
+ "P",
|
|
|
+ "Q",
|
|
|
+ "R",
|
|
|
+ "S",
|
|
|
+ "T",
|
|
|
+ "U",
|
|
|
+ "V",
|
|
|
+ "W",
|
|
|
+ "X",
|
|
|
+ "Y",
|
|
|
+ "Z",
|
|
|
+ ],
|
|
|
lastTime: 0, //剩余考试时长
|
|
|
allTimes: 0, //总考试时长
|
|
|
lastCount: 0,
|
|
@@ -901,6 +954,7 @@ export default {
|
|
|
goodsId: 0,
|
|
|
moduleId: 0,
|
|
|
chapterId: 0,
|
|
|
+ loading: false,
|
|
|
current: 0,
|
|
|
examData: {},
|
|
|
orderGoodsId: "",
|
|
@@ -983,6 +1037,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * 是否做完所有题目
|
|
|
+ */
|
|
|
+ isDoOver() {
|
|
|
+ let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
|
|
|
+ if (this.questionList.length == questionOverNum) {
|
|
|
+ //全部做完弹窗
|
|
|
+ this.$confirm("您已完成所有题目,快去交卷吧!", "提示", {
|
|
|
+ confirmButtonText: "立即交卷",
|
|
|
+ cancelButtonText: "暂不交卷",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.examSubmit();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* 请求题目列表
|
|
|
*/
|
|
@@ -1008,6 +1081,7 @@ export default {
|
|
|
radioSelect(question, questionIndex, optionsId) {
|
|
|
if (this.questionList[questionIndex].ques) return;
|
|
|
this.$set(this.questionList[questionIndex], "ques", optionsId);
|
|
|
+ this.isDoOver();
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1017,6 +1091,7 @@ export default {
|
|
|
radioSelectChild(questionIndex, jsonIndex, optionsId) {
|
|
|
if (this.questionList[questionIndex].ques[jsonIndex]) return;
|
|
|
this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
|
|
|
+ this.isDoOver();
|
|
|
},
|
|
|
/**
|
|
|
* 多选点击确认
|
|
@@ -1037,6 +1112,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
this.$set(this.questionList[questionIndex], "ques", arr);
|
|
|
+ this.isDoOver();
|
|
|
},
|
|
|
/**
|
|
|
* @param {Object}
|
|
@@ -1062,6 +1138,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
|
|
|
+ this.isDoOver();
|
|
|
},
|
|
|
/**
|
|
|
* 判断点击确认
|
|
@@ -1069,11 +1146,13 @@ export default {
|
|
|
judgeSelect(question, questionIndex, index) {
|
|
|
if (question.ques) return;
|
|
|
this.$set(this.questionList[questionIndex], "ques", index + "");
|
|
|
+ this.isDoOver();
|
|
|
},
|
|
|
judgeSelectChild(questionIndex, jsonIndex, index) {
|
|
|
console.log(this.questionList[questionIndex].ques[jsonIndex]);
|
|
|
if (this.questionList[questionIndex].ques[jsonIndex]) return;
|
|
|
this.$set(this.questionList[questionIndex].ques, jsonIndex, index + "");
|
|
|
+ this.isDoOver();
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1148,30 +1227,6 @@ export default {
|
|
|
this.$set(this.collectList, current, false);
|
|
|
});
|
|
|
},
|
|
|
- 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;
|
|
|
- },
|
|
|
isOver(item, index) {
|
|
|
if (this.questionList[index].ques) {
|
|
|
if (item.type == 4) {
|
|
@@ -1230,6 +1285,7 @@ export default {
|
|
|
|
|
|
question.ques.imageList = question.ansText.imageList;
|
|
|
question.ques.text = question.ansText.text;
|
|
|
+ this.isDoOver();
|
|
|
|
|
|
console.log(question.ques);
|
|
|
},
|
|
@@ -1254,6 +1310,7 @@ export default {
|
|
|
this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
|
|
|
"",
|
|
|
});
|
|
|
+ this.isDoOver();
|
|
|
},
|
|
|
|
|
|
changeIndex(index) {
|
|
@@ -1481,6 +1538,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
examSubmit() {
|
|
|
+ this.loading = true;
|
|
|
let score = 0; //计算总分
|
|
|
let reportStatus = 0;
|
|
|
let number = 0; //做对的题目数量
|
|
@@ -1506,6 +1564,7 @@ export default {
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques) {
|
|
|
+ console.log(doQuestionNum, "单选");
|
|
|
doQuestionNum++;
|
|
|
doQuestionIds.push(item.questionId);
|
|
|
}
|
|
@@ -1569,6 +1628,7 @@ export default {
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques && item.ques.length) {
|
|
|
+ console.log(doQuestionNum, "多选");
|
|
|
doQuestionNum++;
|
|
|
doQuestionIds.push(item.questionId);
|
|
|
}
|
|
@@ -1584,18 +1644,24 @@ export default {
|
|
|
}
|
|
|
allScore += item.score;
|
|
|
if (item.ques) {
|
|
|
+ console.log(doQuestionNum, "判断");
|
|
|
doQuestionNum++;
|
|
|
doQuestionIds.push(item.questionId);
|
|
|
}
|
|
|
} else if (item.type == 4) {
|
|
|
allScore += item.score;
|
|
|
if (item.ques && item.ques.length) {
|
|
|
+ console.log(doQuestionNum, "案例");
|
|
|
doQuestionNum++;
|
|
|
doQuestionIds.push(item.questionId);
|
|
|
}
|
|
|
} else if (item.type == 5) {
|
|
|
allScore += item.score;
|
|
|
- if (item.ques && (item.ques.imageList || item.ques.text)) {
|
|
|
+ if (
|
|
|
+ item.ques &&
|
|
|
+ (item.ques.imageList.length || item.ques.text.length)
|
|
|
+ ) {
|
|
|
+ console.log(doQuestionNum, "简答");
|
|
|
doQuestionNum++;
|
|
|
doQuestionIds.push(item.questionId);
|
|
|
}
|
|
@@ -1630,6 +1696,7 @@ export default {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.isSubmit = true;
|
|
|
+ this.loading = false;
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "交卷成功",
|
|
@@ -1660,6 +1727,18 @@ export default {
|
|
|
.catch((err) => {
|
|
|
console.log(err, "err");
|
|
|
});
|
|
|
+
|
|
|
+ //错题集id提交(客观题)
|
|
|
+ this.$request
|
|
|
+ .examWrongRecord({
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ examId: this.examId,
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ questionIds: doWrongQuestionIds,
|
|
|
+ recordId: this.recordId,
|
|
|
+ })
|
|
|
+ .then((res) => {})
|
|
|
+ .catch((err) => {});
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -2063,12 +2142,12 @@ export default {
|
|
|
margin: 0 auto;
|
|
|
width: 140px;
|
|
|
height: 32px;
|
|
|
+ color: #fff;
|
|
|
background: #3f8dfd;
|
|
|
box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
|
|
|
border-radius: 16px;
|
|
|
text-align: center;
|
|
|
line-height: 32px;
|
|
|
- color: #fff;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
|
|
@@ -2254,12 +2333,11 @@ export default {
|
|
|
cursor: pointer;
|
|
|
width: 140px;
|
|
|
height: 32px;
|
|
|
- background: #3f8dfd;
|
|
|
+ padding: 0;
|
|
|
box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
|
|
|
border-radius: 16px;
|
|
|
line-height: 32px;
|
|
|
text-align: center;
|
|
|
- color: #fff;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
}
|