This commit is contained in:
@fawn-nine
2024-09-02 17:15:29 +08:00
parent b3bb29b36a
commit 9f265afa4a
8 changed files with 671 additions and 349 deletions

View File

@@ -6,8 +6,8 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/"; // socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/"; // baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境 // baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式 baseUrl = "https://api.nuttyreading.com/"; // 线上正式
baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑 // baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
// baseUrl = "http://59.110.212.44:9200/pb/"; // baseUrl = "http://59.110.212.44:9200/pb/";
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑 // baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
// baseUrl = "http://192.168.110.110:9200/pb/"; // baseUrl = "http://192.168.110.110:9200/pb/";

View File

@@ -460,6 +460,7 @@
onShow() { onShow() {
this.getClassInfo() this.getClassInfo()
this.getScore() this.getScore()
}, },
computed: { computed: {
...mapState(["userInfo"]), ...mapState(["userInfo"]),
@@ -478,6 +479,32 @@
} }
return _roleName return _roleName
}, },
// 查询考试成绩
getPaperScore(){
console.log('获取卷面成绩');
// $http.request({
// url: "common/class/getUserRole",
// method: "POST",
// data: {
// "classId": this.classId
// },
// header: { //默认 无 说明:请求头
// 'Content-Type': 'application/json'
// },
// })
// .then((res) => {
// uni.hideLoading()
// console.log('res获取身份信息',res);
// this.roleCode = res.result
// }).catch(e => {
// uni.hideLoading()
// this.roleCode = []
// uni.showToast({
// title: '获取身份信息失败',
// icon: 'error'
// })
// });
},
tabList() { tabList() {
var list = [] var list = []
if (this.thisClass.state == 0) { if (this.thisClass.state == 0) {
@@ -1050,6 +1077,9 @@
this.getList() this.getList()
} }
var dd = this.getBlankNumber var dd = this.getBlankNumber
if(this.thisClass.state == '2'){ // 结班状态下再查询卷面成绩
this.getPaperScore()
}
} }
uni.hideLoading() uni.hideLoading()
}).catch(e => { }).catch(e => {

File diff suppressed because it is too large Load Diff

View File

@@ -138,9 +138,12 @@
getRoleName() { getRoleName() {
var _roleName = '' var _roleName = ''
switch (this.roleCode) { switch (this.roleCode) {
case '66': case '主任':
_roleName = '主任'; _roleName = '主任';
break; break;
case '副主任':
_roleName = '副主任';
break;
case '0': case '0':
_roleName = '学员'; _roleName = '学员';
break; break;

View File

@@ -68,6 +68,7 @@
<view class="score noscore" v-else-if="item.scoreInfo != ''"> <view class="score noscore" v-else-if="item.scoreInfo != ''">
<text v-show="item.scoreInfos < 2 && item.haveGiveScore">等待其他评分员评分</text> <text v-show="item.scoreInfos < 2 && item.haveGiveScore">等待其他评分员评分</text>
<text v-show="item.scoreInfos < 2 && !item.haveGiveScore && roleCode.includes('4')">请您评分</text> <text v-show="item.scoreInfos < 2 && !item.haveGiveScore && roleCode.includes('4')">请您评分</text>
<text v-show="item.scoreInfos < 2 && ( roleCode.includes('1') || roleCode.includes('1') || roleCode.includes('主任') || roleCode.includes('副主任'))">已开始评分</text>
<!-- <button v-show="item.scoreInfos >= 2" class="getScore" @click.stop="getRealScore(item.id)" >生成成绩</button> --> <!-- <button v-show="item.scoreInfos >= 2" class="getScore" @click.stop="getRealScore(item.id)" >生成成绩</button> -->
</view> </view>
<view class="score noscore" v-else>未开始评分</view> <view class="score noscore" v-else>未开始评分</view>

View File

@@ -1,7 +1,35 @@
<template style=""> <template style="">
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;"> <view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
<public-module></public-module> <public-module></public-module>
<z-nav-bar title="正在考试"></z-nav-bar> <z-nav-bar title="正在考试" backState="2000">
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;" @click="showPopup = true">考试说明</text>
</z-nav-bar>
<!-- 有考试结果时候 -->
<template>
<view class="border_radius_10 haveResult">
<view class="scoreBox">
本次考试卷面成绩为<text class="score PM_font">90</text>
</view>
<view class="">
<button type="primary" @click="goToClass">返回班级</button>
</view>
<view class="result_imgBox">
<image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image>
</view>
</view>
</template>
<!-- 没有考试结果的时候 -->
<template>
<view class="tips border_radius_10">
<text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br/>
请在倒计时结束前完成答题倒计时结束后将自动交卷;<br/>
考试结束前中途离开视为放弃此次考试成绩为0分</text>
</view>
<view class="questIndx flex_between flex_box">
<text @click="prev"> << </text>
<text v-for="index of NowList" :key="index" >{{index}}</text>
<text @click="next"> >> </text>
</view>
<view style="padding: 20rpx; " class="timeBox border_radius_10 flex_box flex_between align-items_box" v-if="paperCreateTime > 0"> <view style="padding: 20rpx; " class="timeBox border_radius_10 flex_box flex_between align-items_box" v-if="paperCreateTime > 0">
<!-- <view class=""> --> <!-- <view class=""> -->
<view class=""> <view class="">
@@ -12,7 +40,7 @@
剩余时间 剩余时间
</view> </view>
<view class=""> <view class="">
<uni-countdown :font-size="20" :show-day="false" :hour="paperCreateTime" color="#ffaa7f" /> <uni-countdown @timeup="timeup" :font-size="20" :show-day="false" :hour="paperCreateTime" color="#ffaa7f" />
</view> </view>
</view> </view>
<!-- </view> --> <!-- </view> -->
@@ -43,12 +71,23 @@
<button @click="showNextQuestion" type="primary" v-show="curIndex1 < testPaper.length-1" :disabled="curQuestion.answerIds.length == 0" size="mini">下一题</button> <button @click="showNextQuestion" type="primary" v-show="curIndex1 < testPaper.length-1" :disabled="curQuestion.answerIds.length == 0" size="mini">下一题</button>
</view> </view>
</view> </view>
<view class="" style="margin-top: 20rpx;" v-show="curIndex1 == testPaper.length-1"> <view class="" style="margin-top: 20rpx;" v-show="curIndex1 == testPaper.length-1 && !isOvertime">
<button @click="sumitAnswer" type="primary" > </button> <button @click="sumitAnswer" type="primary" > </button>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template>
<u-popup key="1" :show="showPopup" :round="10" @close="hidePopup">
<view class="guanli">
<h3>考试说明</h3>
<view class="tips border_radius_10">
<text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br/>
请在倒计时结束前完成答题倒计时结束后将自动交卷;<br/>
考试结束前中途离开视为放弃此次考试成绩为0分</text>
</view>
</view>
</u-popup>
</view> </view>
</template> </template>
@@ -60,15 +99,20 @@
export default { export default {
data() { data() {
return { return {
showPopup:false,
code:0, // 英文code code:0, // 英文code
classId:undefined, classId:undefined,
testPaper:[], testPaper:[],
curQuestion:{ curQuestion:{
answerIds:[] answerIds:[]
}, },
result:{}, // 考试结果
curIndex1:0, curIndex1:0,
paperCreateTime:0, paperCreateTime:0,
examId:undefined examId:undefined,
endTime:undefined, // 结束时间戳
isOvertime:false, // 是否超时
nowPart:1, // 段数
} }
}, },
onLoad(e) { onLoad(e) {
@@ -79,10 +123,68 @@
this.getTestPage() this.getTestPage()
} }
}, },
onHide(){
if(!this.isOvertime){}
},
onShow() {
this.endTime = this.hourUp(1)
console.log('this.endTime',this.endTime.getTime());
},
beforeDestroy() {
if(!this.isOvertime){ // 如果中途退出就把成绩记为0
this.giveZero()
}
},
computed: { computed: {
...mapState(["userInfo"]) ...mapState(["userInfo"]),
NowList(){
var _list = []
console.log('this.nowPart * 8', this.nowPart);
var maxNumber = 0
var minNumber = 0
if(this.nowPart == 1){
maxNumber = this.nowPart + 8
minNumber = 1
}else{
minNumber = (this.nowPart - 1) * 8
maxNumber = this.nowPart * 8
}
for (var i = minNumber-1; i < maxNumber-1; i++) {
_list.push(i)
}
return _list
}
}, },
methods: { methods: {
prev(){
if(this.nowPart > 1){
this.nowPart--
}
},
next(){
if(this.nowPart < 12){
this.nowPart++
}
},
// 倒计时结束 (超时)
timeup(){
this.isOvertime = true
let that = this
uni.showModal({
title:'提示',
content:"考试结束您未在规定时间内交卷本次成绩为0分",
confirmText:'知道了',
showCancel:false,
success: (res) => {
if (res.confirm) {
that.goToClass()
}
}
})
},
// 获取交卷数据 // 获取交卷数据
sumitAnswer(){ sumitAnswer(){
var _newList = this.testPaper.map( item =>{ var _newList = this.testPaper.map( item =>{
@@ -115,7 +217,7 @@
title:'交卷成功', title:'交卷成功',
icon:'success' icon:'success'
}) })
this.isOvertime = true
} }
}).catch(e => { }).catch(e => {
@@ -203,6 +305,8 @@
this.testPaper = res.examPaper this.testPaper = res.examPaper
this.examId = res.id this.examId = res.id
this.paperCreateTime = 1 this.paperCreateTime = 1
this.endTime = this.hourUp(1)
console.log('this.endTime',this.endTime);
this.curQuestion = {...this.testPaper[this.curIndex1] } this.curQuestion = {...this.testPaper[this.curIndex1] }
uni.showToast({ uni.showToast({
title: '获取成功', title: '获取成功',
@@ -224,15 +328,56 @@
}) })
}); });
}, },
giveZero(){
// 没有完成完成考试记为0分
},
showElart(){
// uni.showModal({
// title:'提示',
// content:"您还没有完成考试确定要离开吗离开后成绩会记为0分是否继续"
// })
},
goToClass(){
uni.navigateTo({
url:`/pages/miniClass/classInfo?id=${this.classId}`
})
},
hidePopup(){
this.showPopup = false
},
hourUp(e){
// 比现在多几个小时
var end = Date.now()
var start = 1000*60*60*e
var interval = end + start; //结束 - 开始 = 毫秒值
var a =new Date(interval)
return a
},
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @import "@/style/mixin.scss";
.questIndx{
text{padding: 6rpx 10rpx; display: flex; justify-content: center; border-radius: 10rpx; align-items: center; width: 60rpx; height: 60rpx; text-align: center; }
.cur{background-color: #409eff; color: #fff;}
}
.guanli {
padding: 40rpx;
h3 {
text-align: center;
margin-bottom: 20rpx;
color: #333;
}}
.tips{background: #fbe8e8; color: #f56c6c; line-height: 50rpx; font-size: 28rpx; padding: 10rpx 20rpx; text-align:justify;}
.questionType{position: absolute; left: 0 ;top:20rpx; background-color: $themeColor; color: #fff; padding: 10rpx 20rpx; .questionType{position: absolute; left: 0 ;top:20rpx; background-color: $themeColor; color: #fff; padding: 10rpx 20rpx;
border-radius: 0 50rpx 50rpx 0; border-radius: 0 50rpx 50rpx 0;
} }
.haveResult{background-color: #fff; padding: 20rpx; text-align: center;}
.scoreBox{margin-top: 100rpx; color: #333; margin-bottom: 50rpx;}
.score{font-size: 50rpx; }
.question{padding: 20rpx; padding-top: 100rpx; background-color: #fff; position: relative;} .question{padding: 20rpx; padding-top: 100rpx; background-color: #fff; position: relative;}
.optionsBox{ margin: 30rpx 0; .optionsBox{ margin: 30rpx 0;
.item{border: 1px solid #eee; padding: 24rpx 20rpx; margin-bottom: 20rpx;} .item{border: 1px solid #eee; padding: 24rpx 20rpx; margin-bottom: 20rpx;}
@@ -242,6 +387,9 @@
border-color: #fbc4c4; color: #f56c6c; background-color: #fef0f0; border-color: #fbc4c4; color: #f56c6c; background-color: #fef0f0;
} }
} }
.result_imgBox{width: 100%;
image{width: 100%; height: 100%;}
}
.timeBox{background-color: #fff; margin-bottom: 20rpx;} .timeBox{background-color: #fff; margin-bottom: 20rpx;}
.btnBox{ .btnBox{
.item{width:40%; display: flex; justify-content: center;} .item{width:40%; display: flex; justify-content: center;}

View File

@@ -39,6 +39,10 @@
</div> </div>
</view> </view>
</view> </view>
<view class="" @click="onPageJump('/pages/miniClass/test')" style="height: 100rpx; line-height: 100rpx; text-align: center;">
去考试页面
</view>
<view class="newLeve2"> <view class="newLeve2">
<view class="home_nar nomargin" style="padding: 0; background-color: #fff;"> <view class="home_nar nomargin" style="padding: 0; background-color: #fff;">
<view class="flexbox"> <view class="flexbox">
@@ -770,6 +774,9 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/style/mixin.scss'; @import '@/style/mixin.scss';
.classItemBox {.jianjie{
@include bov(2);
}}
.nomargin{margin: 0 !important;} .nomargin{margin: 0 !important;}
.nopadding{padding: 0 !important;} .nopadding{padding: 0 !important;}
.noRadius{border-radius: 0 !important;} .noRadius{border-radius: 0 !important;}

BIN
static/jiesuan_Icon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB