This commit is contained in:
@fawn-nine
2024-10-14 17:06:09 +08:00
parent 827e5171e1
commit 42da449031
9 changed files with 1275 additions and 32 deletions

View File

@@ -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

View File

@@ -2,8 +2,8 @@
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
<public-module></public-module>
<z-nav-bar title="试卷答案">
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
@click="showPopup = true">考试说明</text>
<!-- <text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
@click="showPopup = true">考试说明</text> -->
</z-nav-bar>
<!-- 有考试结果时候 -->
<template>

View File

@@ -168,6 +168,7 @@
showQuestIndex:false,
secondTimeDif:undefined,
pagetitle:'', // 页面标题
flag:false,
}
},
async onLoad(e) {
@@ -353,10 +354,15 @@
},
// 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",
@@ -394,6 +400,7 @@
},300)
}else{
that.flag = false
uni.showToast({
title: e.errMsg,
icon: 'error'
@@ -401,6 +408,7 @@
}
}).catch(e => {
that.flag = false
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3