提交
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
本次考试卷面成绩为:<text class="score PM_font">{{exameResult.score}} 分</text>
|
||||
</view>
|
||||
<view class="flex_box flex_between">
|
||||
<button type="primary" size="mini" @click="goToClass">返回班级</button>
|
||||
<button type="primary" v-if="testPaper.type == '2'" size="mini" @click="goToCourse">返回课程</button>
|
||||
<button type="primary" v-else size="mini" @click="goToClass">返回班级</button>
|
||||
<button type="warn" size="mini" @click="goToPaper">查看试卷</button>
|
||||
</view>
|
||||
<view class="result_imgBox">
|
||||
@@ -86,10 +87,15 @@
|
||||
<u-popup key="1" :show="showPopup" :round="10" @close="hidePopup">
|
||||
<view class="guanli">
|
||||
<h3>考试说明</h3>
|
||||
<view class="tips border_radius_10">
|
||||
<view class="tips border_radius_10" v-if="testPaper.type == '1'">
|
||||
<text>①、每位学员共有两次考试的机会,考试成绩以两次成绩的最高分作为最终的卷面成绩,请认真对待每次考试;<br />
|
||||
②、请在倒计时结束前完成答题,倒计时结束后将自动交卷。</text>
|
||||
</view>
|
||||
<view class="tips border_radius_10" v-if="testPaper.type == '2'">
|
||||
<text>①、每位学员共有两次考试的机会,如第一次考试成绩达标则不用进行第二次的考试,请认真对待每次考试;<br />
|
||||
②、请在倒计时结束前完成答题,倒计时结束后将自动交卷;<br/>
|
||||
③、考试时间为 45 分钟。</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup key="2" :show="showQuestIndex" :round="10" @close="hidePopup">
|
||||
@@ -125,6 +131,7 @@
|
||||
showPopup: false,
|
||||
code: 0, // 英文code
|
||||
classId: undefined,
|
||||
courseId:undefined,
|
||||
testPaper: {},
|
||||
curQuestion: {
|
||||
answerIds: []
|
||||
@@ -150,12 +157,12 @@
|
||||
questionList:[],
|
||||
answerIdsList:[],
|
||||
wantSubmit:false, // 想要提交
|
||||
|
||||
flag : false,
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
console.log('收到得值',e);
|
||||
this.classId = e.classId
|
||||
// this.classId = e.classId
|
||||
this.examId = e.id
|
||||
this.wantSubmit = false
|
||||
this.getTestPage()
|
||||
@@ -278,7 +285,13 @@
|
||||
timeup() {
|
||||
this.isOvertime = true
|
||||
this.sumbitPaper()
|
||||
let that = this
|
||||
let that = this
|
||||
var urll = ''
|
||||
if(that.testPaper.type == '1'){
|
||||
urll = `/pages/miniClass/classInfo?id=${that.classId}`
|
||||
}else if(that.testPaper.type == '2'){
|
||||
urll = `/pages/course/courseDetail?id=${that.courseId}`
|
||||
}
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: "考试结束,系统已为您自动交卷,点击按钮返回所在班级",
|
||||
@@ -287,7 +300,7 @@
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/miniClass/classInfo?id=${that.classId}`
|
||||
url: urll
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -325,22 +338,27 @@
|
||||
},
|
||||
// q请求提交试卷
|
||||
sumbitPaper(ids) {
|
||||
let that = this
|
||||
if(that.flag){
|
||||
return
|
||||
}
|
||||
that.flag = true
|
||||
uni.showLoading({
|
||||
title:'正在交卷'
|
||||
})
|
||||
let that = this
|
||||
})
|
||||
$http.request({
|
||||
url: "common/classExam/submitExamPaper",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: that.examId
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
header: { //默认 无 说明:请求头1
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.code == 0) {
|
||||
console.log('交卷结果',res);
|
||||
uni.showToast({
|
||||
@@ -367,6 +385,7 @@
|
||||
},300)
|
||||
|
||||
}else{
|
||||
that.flag = false
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'error'
|
||||
@@ -374,6 +393,7 @@
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
that.flag = true
|
||||
uni.hideLoading()
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
@@ -493,6 +513,11 @@
|
||||
this.haveAnswerList = this.gethaveAnswerList()
|
||||
// console.log('this.answerIdsList', this.answerIdsList);
|
||||
this.testPaper = res.examPaper
|
||||
if(this.testPaper.type == '1'){ // 班级考试
|
||||
this.classId = this.testPaper.relationId
|
||||
}else if(this.testPaper.type == '2'){
|
||||
this.courseId = this.testPaper.relationId
|
||||
}
|
||||
// var planEndTimeDate = new Date(res.planEndTime)
|
||||
// this.endTime = planEndTimeDate.getTime();
|
||||
this.endTime = res.planEndTime
|
||||
@@ -569,6 +594,12 @@
|
||||
url: `/pages/miniClass/classInfo?id=${this.classId}`
|
||||
})
|
||||
},
|
||||
goToCourse(){
|
||||
uni.navigateTo({
|
||||
// url: `/pages/miniClass/classInfo?id=${this.classId}`
|
||||
url: `/pages/course/courseDetail?id=${this.courseId}`
|
||||
})
|
||||
},
|
||||
hidePopup() {
|
||||
this.showPopup = false
|
||||
this.showQuestIndex = false
|
||||
|
||||
Reference in New Issue
Block a user