|
@@ -129,7 +129,7 @@
|
|
<template v-if="bank.type == 5">
|
|
<template v-if="bank.type == 5">
|
|
<view class="pad_8 titBox">
|
|
<view class="pad_8 titBox">
|
|
<view class="ans">
|
|
<view class="ans">
|
|
- <view class="ans_input" v-if="!bank.ques">
|
|
|
|
|
|
+ <view class="ans_input" v-if="!bank.ques || (!bank.ques.imageList.length && !bank.ques.text)">
|
|
<view class="top flex">
|
|
<view class="top flex">
|
|
<image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
|
|
<image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
|
|
<view class="progress">{{bank.ansText.imageList.length || '0'}}/4</view>
|
|
<view class="progress">{{bank.ansText.imageList.length || '0'}}/4</view>
|
|
@@ -143,13 +143,13 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="ans_submit answerInfos" v-if="bank.ques">
|
|
|
|
|
|
+ <view class="ans_submit answerInfos" v-if="bank.ques.imageList.length || bank.ques.text">
|
|
<view class="answerTitle">我的答案:</view>
|
|
<view class="answerTitle">我的答案:</view>
|
|
{{ bank.ques.text }}
|
|
{{ bank.ques.text }}
|
|
<view class="imgs"><image class="img" :key="quesIndex" v-for="(ques,quesIndex) in bank.ques.imageList" :src="$method.splitImgHost(ques, true)"></image></view>
|
|
<view class="imgs"><image class="img" :key="quesIndex" v-for="(ques,quesIndex) in bank.ques.imageList" :src="$method.splitImgHost(ques, true)"></image></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="bank.ques">
|
|
|
|
|
|
+ <view v-if="bank.ques.imageList.length || bank.ques.text">
|
|
<view class="pad_8 answerInfos">
|
|
<view class="pad_8 answerInfos">
|
|
<view class="answerTitle">答案解析:</view>
|
|
<view class="answerTitle">答案解析:</view>
|
|
<view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
|
|
<view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
|
|
@@ -287,7 +287,7 @@
|
|
<!-- 简答题 -->
|
|
<!-- 简答题 -->
|
|
<template v-if="ansItem.type == 5">
|
|
<template v-if="ansItem.type == 5">
|
|
<view class="ans">
|
|
<view class="ans">
|
|
- <view class="ans_input" v-if="!bank.ques[ansIndex]">
|
|
|
|
|
|
+ <view class="ans_input" v-if="!bank.ques[ansIndex] || (!bank.ques[ansIndex].text && !bank.ques[ansIndex].imageList.length)">
|
|
<view class="top flex">
|
|
<view class="top flex">
|
|
<image class="icon" @click="chooseImgChild(bankIndex, ansIndex)" src="/static/camera.png" mode=""></image>
|
|
<image class="icon" @click="chooseImgChild(bankIndex, ansIndex)" src="/static/camera.png" mode=""></image>
|
|
<view class="progress">{{ansItem.ansText.imageList.length || '0'}}/4</view>
|
|
<view class="progress">{{ansItem.ansText.imageList.length || '0'}}/4</view>
|
|
@@ -301,15 +301,15 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="ans_submit answerInfos" v-if="bank.ques[ansIndex]">
|
|
|
|
|
|
+ <view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] || bank.ques[ansIndex].imageList.length || bank.ques[ansIndex].text">
|
|
<view class="answerTitle">答案我的</view>
|
|
<view class="answerTitle">答案我的</view>
|
|
- {{ bank.ques[ansIndex].text }}
|
|
|
|
|
|
+ {{ bank.ques[ansIndex].text || ''}}
|
|
<view class="imgs">
|
|
<view class="imgs">
|
|
<image class="img" v-for="(ques,quesIndex) in bank.ques[ansIndex].imageList" :key="quesIndex" :src="$method.splitImgHost(ques, true)"></image>
|
|
<image class="img" v-for="(ques,quesIndex) in bank.ques[ansIndex].imageList" :key="quesIndex" :src="$method.splitImgHost(ques, true)"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="bank.ques[ansIndex]">
|
|
|
|
|
|
+ <view v-if="bank.ques[ansIndex].imageList.length || bank.ques[ansIndex].text">
|
|
<view class="pad_8 answerInfos">
|
|
<view class="pad_8 answerInfos">
|
|
<view class="answerTitle">答案解析</view>
|
|
<view class="answerTitle">答案解析</view>
|
|
<view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
|
|
<view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
|
|
@@ -480,7 +480,7 @@ export default {
|
|
cgType: 0 //对应设计稿弹窗编码
|
|
cgType: 0 //对应设计稿弹窗编码
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- onLoad(option) {
|
|
|
|
|
|
+ async onLoad(option) {
|
|
this.current = +option.current || 0
|
|
this.current = +option.current || 0
|
|
this.id = option.id;
|
|
this.id = option.id;
|
|
this.goodsId = option.goodsid;
|
|
this.goodsId = option.goodsid;
|
|
@@ -498,7 +498,8 @@ export default {
|
|
this.showDialog = true;
|
|
this.showDialog = true;
|
|
uni.setStorageSync('showDialog','1');
|
|
uni.setStorageSync('showDialog','1');
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ //考试被迫返回
|
|
if (isBack) {
|
|
if (isBack) {
|
|
let app = getApp();
|
|
let app = getApp();
|
|
let globalData = app.globalData;
|
|
let globalData = app.globalData;
|
|
@@ -524,8 +525,9 @@ export default {
|
|
this.lastTime--;
|
|
this.lastTime--;
|
|
}, 1000);
|
|
}, 1000);
|
|
} else {
|
|
} else {
|
|
|
|
+ //进入页面
|
|
|
|
+ await this.bankExam();
|
|
this.goodsQuestionList();
|
|
this.goodsQuestionList();
|
|
- this.bankExam();
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onUnload() {
|
|
onUnload() {
|
|
@@ -560,12 +562,17 @@ export default {
|
|
* 获取试卷类型2考试,1练习
|
|
* 获取试卷类型2考试,1练习
|
|
*/
|
|
*/
|
|
bankExam() {
|
|
bankExam() {
|
|
- this.$api.bankExam(this.id).then(res => {
|
|
|
|
- this.bankType = res.data.data.doType;
|
|
|
|
- if (this.bankType == 2) {
|
|
|
|
- this.needBack = true;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ return new Promise(resolve => {
|
|
|
|
+
|
|
|
|
+ this.$api.bankExam(this.id).then(res => {
|
|
|
|
+ this.bankType = res.data.data.doType;
|
|
|
|
+ if (this.bankType == 2) {
|
|
|
|
+ this.needBack = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ resolve()
|
|
|
|
+ });
|
|
|
|
+ })
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 点击后退按钮
|
|
* 点击后退按钮
|
|
@@ -975,20 +982,6 @@ export default {
|
|
questionList = this.questionList.length;
|
|
questionList = this.questionList.length;
|
|
}
|
|
}
|
|
|
|
|
|
- if(this.isFromVideo) { //视频课程
|
|
|
|
- this.$api
|
|
|
|
- .bankRecord({
|
|
|
|
- chapterExamId: this.chapterId || 0,
|
|
|
|
- moduleExamId: this.moduleId || 0,
|
|
|
|
- examId: this.id,
|
|
|
|
- goodsId: this.goodsId,
|
|
|
|
- gradeId:this.gradeId,
|
|
|
|
- totalQuestionNum: questionList
|
|
|
|
- })
|
|
|
|
- .then(res => {
|
|
|
|
- this.recordId = res.data.data;
|
|
|
|
- });
|
|
|
|
- } else { //题库
|
|
|
|
this.$api
|
|
this.$api
|
|
.examRecord({
|
|
.examRecord({
|
|
chapterExamId: this.chapterId || 0,
|
|
chapterExamId: this.chapterId || 0,
|
|
@@ -999,8 +992,12 @@ export default {
|
|
})
|
|
})
|
|
.then(res => {
|
|
.then(res => {
|
|
this.recordId = res.data.data;
|
|
this.recordId = res.data.data;
|
|
|
|
+ //获取recordId 初始化先提交题目 以防突然下次继续做题退出报错
|
|
|
|
+ if(this.bankType == 1) {
|
|
|
|
+ this.examRecordEdit();
|
|
|
|
+ }
|
|
|
|
+
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
@@ -1085,6 +1082,11 @@ export default {
|
|
text: '',
|
|
text: '',
|
|
imageList: []
|
|
imageList: []
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+ item.ques = {
|
|
|
|
+ text: '',
|
|
|
|
+ imageList: []
|
|
|
|
+ }
|
|
} else if (item.type == 4) {
|
|
} else if (item.type == 4) {
|
|
//案例题
|
|
//案例题
|
|
console.log(item.jsonStr);
|
|
console.log(item.jsonStr);
|
|
@@ -1727,8 +1729,8 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
this.$set(this.questionList[bankindex], 'ques', {
|
|
this.$set(this.questionList[bankindex], 'ques', {
|
|
- imageList: this.questionList[bankindex].ansText.imageList,
|
|
|
|
- text: this.questionList[bankindex].ansText.text
|
|
|
|
|
|
+ imageList: this.questionList[bankindex].ansText.imageList || [],
|
|
|
|
+ text: this.questionList[bankindex].ansText.text || ''
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
@@ -1748,8 +1750,8 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
this.$set(this.questionList[bankindex].ques, ansindex, {
|
|
this.$set(this.questionList[bankindex].ques, ansindex, {
|
|
- imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
|
|
|
|
- text: this.questionList[bankindex].jsonStr[ansindex].ansText.text
|
|
|
|
|
|
+ imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList || [],
|
|
|
|
+ text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || ''
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|