|
@@ -839,7 +839,7 @@ export default {
|
|
|
this.orderGoodsId = this.$route.query.orderGoodsId;
|
|
|
await this.getGoodsDetail();
|
|
|
await this.bankExam();
|
|
|
- this.doMode == 1 ? this.goodsQuestionList() : this.simulationQuestionList();
|
|
|
+ this.goodsQuestionList();
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
clearInterval(this.timer);
|
|
@@ -905,168 +905,27 @@ export default {
|
|
|
* 请求题目列表
|
|
|
*/
|
|
|
goodsQuestionList() {
|
|
|
- this.$request
|
|
|
- .goodsQuestionList({
|
|
|
- examId: this.examId,
|
|
|
- })
|
|
|
- .then(async (res) => {
|
|
|
- if (!res.data.length) {
|
|
|
- this.$message({
|
|
|
- type: "warning",
|
|
|
- message: "该试卷暂无题目",
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- this.allTimes = res.data[0].answerTime * 60;
|
|
|
- this.lastTime = res.data[0].answerTime && res.data[0].answerTime * 60;
|
|
|
-
|
|
|
- res.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 = res.data;
|
|
|
- this.lastCount = this.questionList.length;
|
|
|
- this.getCollectInfo(this.current);
|
|
|
- await this.examRecord();
|
|
|
- });
|
|
|
- },
|
|
|
- simulationQuestionList() {
|
|
|
- this.$request
|
|
|
- .goodsRandomQuestionList({
|
|
|
+ this.$request[this.doMode==3?'goodsRandomQuestionList':'goodsQuestionList']({
|
|
|
examId: this.examId,
|
|
|
goodsId: this.goodsId,
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
})
|
|
|
- .then(async (res) => {
|
|
|
- let { questionList, simulateExamId } = res.data
|
|
|
- if (!questionList.length) {
|
|
|
+ .then(async ({data}) => {
|
|
|
+ if(this.doMode==3){
|
|
|
+ this.simulateExamId = data.simulateExamId
|
|
|
+ data = data.questionList
|
|
|
+ }
|
|
|
+ if (!data.length) {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
message: "该试卷暂无题目",
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- this.simulateExamId = simulateExamId
|
|
|
- this.allTimes = questionList[0].answerTime * 60;
|
|
|
- this.lastTime = questionList[0].answerTime && questionList[0].answerTime * 60;
|
|
|
- questionList.forEach((item, index) => {
|
|
|
+ this.allTimes = data[0].answerTime * 60;
|
|
|
+ this.lastTime = data[0].answerTime && data[0].answerTime * 60;
|
|
|
+
|
|
|
+ data.forEach((item, index) => {
|
|
|
if (typeof item.jsonStr == "string") {
|
|
|
item.jsonStr = JSON.parse(item.jsonStr);
|
|
|
|
|
@@ -1186,7 +1045,8 @@ export default {
|
|
|
item.ans = item.answerQuestion;
|
|
|
}
|
|
|
});
|
|
|
- this.questionList = questionList;
|
|
|
+
|
|
|
+ this.questionList = data;
|
|
|
this.lastCount = this.questionList.length;
|
|
|
this.getCollectInfo(this.current);
|
|
|
await this.examRecord();
|
|
@@ -1195,7 +1055,6 @@ export default {
|
|
|
//拍照
|
|
|
openPhoto() {
|
|
|
this.$nextTick(() => {
|
|
|
- console.log(window.navigator.mediaDevices);
|
|
|
if (
|
|
|
(window.navigator.mediaDevices &&
|
|
|
window.navigator.mediaDevices.getUserMedia) ||
|
|
@@ -1558,7 +1417,6 @@ export default {
|
|
|
if (this.bankType == 2) {
|
|
|
this.needBack = true;
|
|
|
}
|
|
|
- console.log(res.data.simulateStatus, 'simulateStatus')
|
|
|
this.doMode = res.data.simulateStatus ? 3 : 1;
|
|
|
return Promise.resolve();
|
|
|
});
|