This commit is contained in:
2024-10-29 16:56:14 +08:00
26 changed files with 4882 additions and 2329 deletions

View File

@@ -343,10 +343,8 @@
</template>
<template
v-if="!item.reply && thisClass.state == '1'">
<text class="no" >未提交答案 点击开始答题</text>
<!-- <text class="no" v-else style="color: #a0a1a7;">暂未开始学习</text> -->
<!-- <text class="no" v-if="index+1<=currentStudyNumber">未提交答案 点击开始答题</text>
<text class="no" v-else style="color: #a0a1a7;">暂未开始学习</text> -->
<text class="no" v-if="index+1 <= currentStudyNumber || currentStudyNumber == 0">未提交答案 点击开始答题</text>
<text class="no" v-else style="color: #a0a1a7;">暂未开始学习</text>
</template>
<template
v-if="!item.reply && (thisClass.state == '2' || thisClass.state == '3')">
@@ -1497,12 +1495,11 @@
})
return
}
console.log('item', this.thisClass);
// if(index+1<=this.currentStudyNumber){
uni.navigateTo({
if(index+1<=this.currentStudyNumber || this.currentStudyNumber == 0){
uni.navigateTo({
url: `/pages/miniClass/taskDetail?id=${item.id}&classState=${this.thisClass.state}`
})
// }
}
},
delClass() {

View File

@@ -290,6 +290,10 @@
</template>
</text>
<text class="txt555" v-else> 匿名用户 </text>
<!-- {{item.buyState}} -->
<view class="" style="width: 50rpx; height: 50rpx;">
<image style="width: 50rpx; height: 50rpx;" :src="item.buyState.includes('未购买') ? '../../static/icon/notbuy.png' : '../../static/icon/yesbuy.png'" mode="widthFix"></image>
</view>
<text
@click.stop="outClass(item.student.id)"
class="outBtn"

View File

@@ -11,9 +11,31 @@
<view class="scoreBox">
本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text>
</view>
<view class="" v-if="testPaper.type == '2'" style="margin: 20rpx 0; text-align: center;" >
<template v-if="exameResult.score >= 60 && selfStudyCertificate.length > 0">
<view class="">
<view class="congritulations">
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
</view>
<view class="">
<text>恭喜您本次考试获得了自考证书请前往 我的->我的证书查看</text>
<<view class="" style="text-align: center;">
<text class="small_btn border_radius_10"
style="display: inline-block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff"
@click="onPageJump('/pages/certificate/certificate')">查看证书</text>
</view>
</view>
</view>
</template>
<template v-else>
<text>很遗憾本次考试您没有获得自考证书,祝您下次考试旗开得胜!!</text>
</template>
</view>
<view class="flex_box flex_between">
<button type="primary" size="mini" @click="goToClass">返回班级</button>
<button type="warn" size="mini" @click="goToPaper">查看试卷</button>
<button size="mini" type="primary" v-if="testPaper.type == '2'" @click="goToCourse">返回课程</button>
<button size="mini" type="primary" v-else @click="goToClass">返回班级</button>
<button size="mini" type="warn" @click="goToPaper">查看试卷</button>
</view>
<view class="result_imgBox">
<image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image>
@@ -32,7 +54,7 @@
</view>
<view class="flex_box align-items_box" v-if="secondTimeDif > 0">
<view class="" style="font-size: 26rpx;">
剩余时间
剩余时间:
</view>
<view class="">
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false"
@@ -86,10 +108,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 +152,7 @@
showPopup: false,
code: 0, // 英文code
classId: undefined,
courseId:undefined,
testPaper: {},
curQuestion: {
answerIds: []
@@ -139,7 +167,7 @@
step: 8, /// 步长
// questIndexList: [],
nowPart: 1,
selfStudyCertificate:[],
maxNumber: 0,
minNumber: 0,
noAnswerList: [],
@@ -150,12 +178,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()
@@ -180,6 +208,49 @@
},
methods: {
...mapMutations(['setPaperEndTime']),
// 查询证书情况
async getCertificateInfo() {
var list = undefined
await $http.request({
url: "common/userCertificate/getUserCertificateList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"type": '', //证书类型A a证 B b证 ZK自考
"courseId": this.courseId //课程id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code != 0) {
uni.showToast({
title: res.errMsg,
icon: 'none'
})
return
}
if (res.code == 0) {
res.certificateList.forEach(item => {
item.certificateUrl && item.certificateUrl != '' ? item
.certificateUrlList = item.certificateUrl.split(',') : item
.certificateUrlList = []
})
list = res.certificateList
}
console.log('证书接口请求结果', res);
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.errMsg,
icon: 'none'
})
});
return list
},
async getServerTime() {
var time = 0
await $http.request({
@@ -278,16 +349,22 @@
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: "考试结束,系统已为您自动交卷,点击按钮返回所在班级",
content: "考试结束,系统已为您自动交卷,点击按钮返回",
confirmText: '知道了',
showCancel: false,
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: `/pages/miniClass/classInfo?id=${that.classId}`
url: urll
})
}
}
@@ -324,49 +401,60 @@
},300)
},
// q请求提交试卷
sumbitPaper(ids) {
async sumbitPaper(ids) {
let that = this
if(that.flag){
return
}
that.flag = true
uni.showLoading({
title:'正在交卷'
})
let that = this
$http.request({
})
await $http.request({
url: "common/classExam/submitExamPaper",
method: "POST",
data: {
id: that.examId
},
header: { //默认 无 说明:请求头
header: { //默认 无 说明:请求头1
'Content-Type': 'application/json'
},
})
.then(res => {
.then(async res => {
uni.hideLoading()
if (res.code == 0) {
console.log('交卷结果',res);
uni.showToast({
title: '交卷成功',
icon: 'success'
})
setTimeout( ()=>{
setTimeout(async ()=>{
that.exameResult = res.examPaper
// this.timeup()
that.showQuestIndex = false
that.secondTimeDif = 0
that.isOvertime = true
uni.setStorage({
key:'paperEndTime',
data:{
time: 0,
examId: undefined
},
success: function () {
console.log('时间存储成功');
that.isOvertime = true
if(that.testPaper.type == '2' && that.exameResult.score >= 60) {
// if(that.exameResult.score >= 60){
var newCertificate = await that.getCertificateInfo()
console.log('5555555证书资料', newCertificate);
that.selfStudyCertificate = []
if (newCertificate && newCertificate.length > 0) {
newCertificate.forEach(item => {
if (item.classId != '' && item.classId > 0) {
// this.classCertificate.push(item)
} else {
that.selfStudyCertificate.push(item)
}
})
}
})
// }
}
},300)
}else{
that.flag = false
uni.showToast({
title: e.errMsg,
icon: 'error'
@@ -374,6 +462,7 @@
}
}).catch(e => {
that.flag = true
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
@@ -493,6 +582,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 +663,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
@@ -602,7 +702,17 @@
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.congritulations {
width: 120rpx;
height: 120rpx;
text-align: center;
margin: 10rpx auto;
display: block;
image {
width: 120rpx;
height: 120rpx;
}
}
.questIndx { overflow: hidden;
margin-top: 20rpx;
margin-bottom: 20rpx;

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>
@@ -78,6 +78,9 @@
</view>
</view>
</view>
<view class="" style="margin-top: 20rpx;">
<text style="color: #666; font-size: 28rpx;">开始时间{{testPaper.startTime}} <br/> 结束时间{{testPaper.endTime}}</text>
</view>
</view>
</template>
<u-popup key="1" :show="showPopup" :round="10" @close="hidePopup">
@@ -223,8 +226,6 @@ checkAnswer(id){
if (res.code == 0) {
// that.isHave = true
var subOptions = JSON.parse(res.examPaper.subject)
subOptions.forEach(item => {
var code = 0
item.options.forEach(item1 => {
@@ -236,6 +237,7 @@ checkAnswer(id){
this.questionList = subOptions
this.testPaper = res.examPaper
console.log('试卷信息', this.testPaper);
this.answerIdsList = JSON.parse(res.examPaper.answer)
var newList = JSON.parse(res.examPaper.answer)
newList = newList.map(item => {

View File

@@ -32,7 +32,7 @@
</view>
<view class="flex_box align-items_box" v-if="secondTimeDif > 0">
<view class="">
剩余时间
剩余时间:
</view>
<view class="">
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false"
@@ -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