|
@@ -412,6 +412,8 @@
|
|
|
? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
|
|
|
: cgType === 6
|
|
|
? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
|
|
|
+ : cgType == 9
|
|
|
+ ? `您已完成所有题目,快去交卷吧!?`
|
|
|
: ''
|
|
|
}}
|
|
|
</view>
|
|
@@ -427,6 +429,10 @@
|
|
|
<view class="btnsty btns1" @click="leaveNow()">下次继续</view>
|
|
|
<view class="btnsty btns2" @click="showpopups = false">继续作答</view>
|
|
|
</view>
|
|
|
+ <view class="classFootsty" v-if="cgType === 9">
|
|
|
+ <view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
|
|
|
+ <view class="btnsty btns2" @click="submit">立即交卷</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
<u-mask :show="photoPopup" >
|
|
@@ -490,6 +496,7 @@ export default {
|
|
|
avatarUrl:'',
|
|
|
ossAvatarUrl: '',
|
|
|
goodsDetail:{},
|
|
|
+ isTakePhoto:false,
|
|
|
needPhoto:false //是否需要拍照
|
|
|
};
|
|
|
},
|
|
@@ -511,7 +518,8 @@ export default {
|
|
|
this.showDialog = true;
|
|
|
uni.setStorageSync('showDialog','1');
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //考试时候用手势或者返回键 被迫返回做题
|
|
|
if (isBack) {
|
|
|
console.log(getApp());
|
|
|
let app = getApp();
|
|
@@ -520,22 +528,29 @@ export default {
|
|
|
for (var k in globalData.bankData) {
|
|
|
this[k] = globalData.bankData[k];
|
|
|
}
|
|
|
-
|
|
|
- this.timer = setInterval(() => {
|
|
|
- if (this.lastTime <= 0) {
|
|
|
- clearInterval(this.timer);
|
|
|
- uni.showToast({
|
|
|
- icon:'none',
|
|
|
- mask:true,
|
|
|
- title:'考试时间到,自动交卷',
|
|
|
- duration:10000
|
|
|
- })
|
|
|
-
|
|
|
- this.submit();
|
|
|
- return;
|
|
|
+
|
|
|
+ //需要拍没拍过直接弹出摄像头
|
|
|
+ if(this.needPhoto && !this.isTakePhoto) {
|
|
|
+ this.photoPopup = true;
|
|
|
+ } else { //不需要拍照
|
|
|
+ if(this.lastTime) {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ if (this.lastTime <= 0) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ mask:true,
|
|
|
+ title:'考试时间已到,系统将自动交卷',
|
|
|
+ duration:10000
|
|
|
+ })
|
|
|
+
|
|
|
+ this.submit();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.lastTime--;
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
- this.lastTime--;
|
|
|
- }, 1000);
|
|
|
+ }
|
|
|
} else {
|
|
|
this.goodsQuestionList();
|
|
|
this.bankExam();
|
|
@@ -553,7 +568,7 @@ export default {
|
|
|
app.globalData.bankData = this.$data;
|
|
|
clearInterval(this.timer);
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages2/bank/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
|
|
|
+ url: '/pages2/class/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
|
|
|
});
|
|
|
} else {
|
|
|
//点击返回按钮确认允许退出,交卷
|
|
@@ -569,7 +584,7 @@ export default {
|
|
|
if (self.goodsDetail.goodsPhotoExamConfig) {
|
|
|
let goodsPhotoExamConfig = JSON.parse(self.goodsDetail.goodsPhotoExamConfig);
|
|
|
if (goodsPhotoExamConfig.photograph > 0) {
|
|
|
- self.needPhoto = true;
|
|
|
+ // self.needPhoto = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -583,6 +598,25 @@ export default {
|
|
|
};
|
|
|
this.$api.studyExamPhotoRecord(data).then(res => {
|
|
|
self.ossAvatarUrl = ''
|
|
|
+ self.isTakePhoto = true;
|
|
|
+ //拍照
|
|
|
+ if(this.lastTime) {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ if (this.lastTime <= 0) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ mask:true,
|
|
|
+ title:'考试时间已到,系统将自动交卷',
|
|
|
+ duration:10000
|
|
|
+ })
|
|
|
+
|
|
|
+ this.submit();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.lastTime--;
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
uploadFile(options, int) {
|
|
@@ -789,7 +823,7 @@ export default {
|
|
|
//简答题
|
|
|
if(hasSpecail) {
|
|
|
|
|
|
- if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
|
|
|
+ if (item.ques && (item.ques.text.length || item.ques.imageList.length)) {
|
|
|
count++;
|
|
|
}
|
|
|
}
|
|
@@ -798,6 +832,16 @@ export default {
|
|
|
|
|
|
return count;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 是否做完所有题目
|
|
|
+ */
|
|
|
+ isDoOver() {
|
|
|
+ let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
|
|
|
+ if(this.questionList.length == questionOverNum) { //全部做完弹窗
|
|
|
+ this.cgType = 9;
|
|
|
+ this.showpopups = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
/**
|
|
|
* 暂不交卷
|
|
|
*/
|
|
@@ -1090,25 +1134,7 @@ export default {
|
|
|
}
|
|
|
this.allTimes = res.data.data[0].answerTime * 60;
|
|
|
this.lastTime = res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
|
|
|
- //考试时间到了自动交卷
|
|
|
- if (this.lastTime) {
|
|
|
- this.timer = setInterval(() => {
|
|
|
- if (this.lastTime <= 0) {
|
|
|
- clearInterval(this.timer);
|
|
|
- uni.showToast({
|
|
|
- icon:'none',
|
|
|
- mask:true,
|
|
|
- title:'考试时间到,自动交卷',
|
|
|
- duration:10000
|
|
|
- })
|
|
|
-
|
|
|
- this.submit();
|
|
|
- return;
|
|
|
- }
|
|
|
- this.lastTime--;
|
|
|
- }, 1000);
|
|
|
- } else {
|
|
|
- }
|
|
|
+
|
|
|
res.data.data.forEach((item, index) => {
|
|
|
if (typeof item.jsonStr == 'string') {
|
|
|
item.jsonStr = JSON.parse(item.jsonStr);
|
|
@@ -1210,6 +1236,24 @@ export default {
|
|
|
this.recordId = res.data.data;
|
|
|
if(self.needPhoto){
|
|
|
self.photoPopup = true; //拍照
|
|
|
+ } else {
|
|
|
+ if(this.lastTime) {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ if (this.lastTime <= 0) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ mask:true,
|
|
|
+ title:'考试时间已到,系统将自动交卷',
|
|
|
+ duration:10000
|
|
|
+ })
|
|
|
+
|
|
|
+ this.submit();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.lastTime--;
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
});
|
|
@@ -1221,6 +1265,7 @@ export default {
|
|
|
radioSelect(optionsId, bindex) {
|
|
|
if (this.questionList[bindex].ques) return;
|
|
|
this.$set(this.questionList[bindex], 'ques', optionsId);
|
|
|
+ this.isDoOver()
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1229,6 +1274,7 @@ export default {
|
|
|
radioSelectChild(optionsId, ansIndex, bindex) {
|
|
|
if (this.questionList[bindex].ques[ansIndex]) return;
|
|
|
this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
|
|
|
+ this.isDoOver()
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1258,6 +1304,7 @@ export default {
|
|
|
});
|
|
|
|
|
|
this.$set(this.questionList[bindex], 'ques', arr);
|
|
|
+ this.isDoOver()
|
|
|
|
|
|
let isWrong = this.questionList[bindex].ques.some((quesItem, quesIndex) => {
|
|
|
return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex];
|
|
@@ -1277,6 +1324,7 @@ export default {
|
|
|
});
|
|
|
|
|
|
this.$set(this.questionList[bindex].ques, ansIndex, arr);
|
|
|
+ this.isDoOver()
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1287,6 +1335,7 @@ export default {
|
|
|
judgeSelect(index, bindex) {
|
|
|
if (this.questionList[bindex].ques) return;
|
|
|
this.$set(this.questionList[bindex], 'ques', index + '');
|
|
|
+ this.isDoOver()
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1298,6 +1347,7 @@ export default {
|
|
|
judgeSelectChild(ansindex, childindex, bindex) {
|
|
|
if (this.questionList[bindex].ques[ansindex]) return;
|
|
|
this.$set(this.questionList[bindex].ques, ansindex, childindex + '');
|
|
|
+ this.isDoOver()
|
|
|
},
|
|
|
|
|
|
openFooterTab() {
|
|
@@ -1679,6 +1729,7 @@ export default {
|
|
|
imageList: this.questionList[bankindex].ansText.imageList,
|
|
|
text: this.questionList[bankindex].ansText.text
|
|
|
});
|
|
|
+ this.isDoOver()
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1700,6 +1751,7 @@ export default {
|
|
|
imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
|
|
|
text: this.questionList[bankindex].jsonStr[ansindex].ansText.text
|
|
|
});
|
|
|
+ this.isDoOver()
|
|
|
},
|
|
|
|
|
|
isRight(item, index) {
|