diff --git a/pages.json b/pages.json index fe9e4c7..e83b932 100644 --- a/pages.json +++ b/pages.json @@ -715,7 +715,8 @@ "path" : "pages/miniClass/test", "style" : { - "navigationBarTitleText" : "考试页面" + "navigationBarTitleText" : "考试页面", + "enablePullDownRefresh": false } }, { diff --git a/pages/miniClass/classInfo.vue b/pages/miniClass/classInfo.vue index 5df062b..291a28c 100644 --- a/pages/miniClass/classInfo.vue +++ b/pages/miniClass/classInfo.vue @@ -38,6 +38,58 @@ class="mainTxt">{{students.length}}/{{thisClass.number}}人 管理成员点击查看 + + + + 笔试分 + + + + + + + + + + 去考试{{showCountDown}} + + + + + + + + {{paperSore}} + 分 + + + + 再考一次 + + + + + + + 恭喜您获得A证查看证书 + 很遗憾,您的成绩未达标 + + 加入新班级重修 + + + + + + @@ -67,29 +119,7 @@ {{performanceScore.questionScore}} --> - - - - - 去考试 - - - 卷面成绩:60分再考一次 - - - - - 恭喜您获得A证查看证书 - 很遗憾,您的成绩未达标 - - 加入新班级重修 - - 总成绩为:90(50考试分+40平时表现分) - - @@ -178,7 +208,7 @@ 考试成绩 {{item.student.score.testScoreNumber}} - + @@ -212,7 +242,7 @@ - 全部同学的 + 全部同学的 只看我自己的 @@ -237,7 +267,8 @@ - {{item.zhedie ? '收起' : '展开'}} + {{item.zhedie ? '收起' : '展开'}} + 日期:{{item.createTime}} @@ -254,10 +285,12 @@ 已提交答案 - + 未提交答案 点击开始答题 - + 未作答 已不可作答 @@ -332,6 +365,50 @@ + + +

考试说明

+ + ①、每位学员共有两次考试的机会,考试成绩以两次成绩的最高分作为最终的卷面成绩,请认真对待每次考试;
+ ②、请在倒计时结束前完成答题,倒计时结束后将自动交卷。
+
+
+
+ + +

+ 试卷列表 +

+ + + + + +
+
@@ -373,6 +450,8 @@ active: false }, ], +timeDif:{}, +showCountDown:false, thisClass: {}, students: [], @@ -481,7 +560,11 @@ }, roleCode: [], firstLoad: true, // 是否是第一次请求 - blankNumber: 0 + blankNumber: 0, + paperList: [], + paperSore: 0, // 最终的笔试成绩 + showTestTips: false, + showPaperList:false, } }, onLoad(e) { @@ -515,10 +598,32 @@ this.getList() uni.stopPullDownRefresh() }, - onShow() { - this.getClassInfo() + async onShow() { + var ss = await this.getClassInfo() this.getScore() - + console.log('this.thisClass.state', this.thisClass.state); + console.log('this.$store.state.paperEndTime',this.$store.state); + if(this.$store.state.paperEndTime && this.$store.state.paperEndTime.time - Date.now() > 0){ + var secondTimeDif = this.$store.state.paperEndTime.time - Date.now() + this.timeDif.hour = (secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) + this.timeDif.minutes = (secondTimeDif % (1000 * 60 * 60)) / (1000 * 60); + this.timeDif.second = (secondTimeDif % (1000 * 60)) / 1000 + this.showCountDown = true + console.log('时间符合吗?',this.showCountDown, secondTimeDif); + } + if (this.thisClass.state == '3') { + var ll = await this.getPaperList() + console.log('this.paperList.length',this.paperList.length); + if (!this.showAlert && this.paperList.length <= 0 ) { + uni.showModal({ + title: '提示', + content: '您好,当前教学进度已进入考试周,请尽快完成最终的笔试考试,如在结班(endTime)之前未完成考试,则卷面成绩记为0分', + confirmText: '好的', + showCancel: false + }) + this.showAlert = true + } + } }, computed: { ...mapState(["userInfo"]), @@ -552,6 +657,7 @@ } return list }, + // 获得提交项目的tab getTijiaoTitleList() { var _list = [] @@ -589,6 +695,65 @@ } }, methods: { + goToPaper(id){ + uni.navigateTo({ + url: `/pages/miniClass/paperBack?id=${id}` + }) + }, + timeup(){ + this.showCountDown = false + }, + + // 获取试卷列表 + async getPaperList() { + console.log('--------------',parseInt(this.classId),this.userInfo.id); + await $http.request({ + url: "common/classExam/getExamPaperList", + method: "POST", + data: { + "classId": parseInt(this.classId), + "userId": this.userInfo.id + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then((res) => { + if (res.code == 0) { + console.log('获取试卷列表', res); + this.paperList = res.examPaper + if (this.paperList.length > 0) { + var _list = [...this.paperList] + _list = _list.map(item => { + return item.score + }) + var maxNmber = 0 + for (var i = 0; i < _list.length; i++) { + if (_list[i] > maxNmber) { + maxNmber = _list[i] + } + } + this.paperSore = maxNmber + } else { + this.paperSore = 0 + } + } else { + this.paperSore = 0 + uni.showToast({ + title: errMsg, + icon: 'none' + }) + } + + }).catch(e => { + this.paperSore = 0 + console.log('获取试卷列表失败', e); + uni.showToast({ + title: '获取试卷列表失败', + icon: 'none' + }) + }); + }, // 查询考试成绩 getPaperScore() { console.log('获取卷面成绩'); @@ -761,6 +926,7 @@ } }) }, + getList() { console.log('进入函数了吗'); this.status = 1; @@ -943,6 +1109,8 @@ }, closeManager() { this.showMan = false + this.showTestTips = false + this.showPaperList = false }, fabClick() { // uni.showToast({ @@ -1088,7 +1256,7 @@ uni.showLoading({ title: '正在加载' }) - $http.request({ + await $http.request({ url: "common/class/getClassInfo", method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 data: { @@ -1103,16 +1271,7 @@ if (res.code == 0) { res = classData // 测试数据 this.isHave = res.result.isJoin - this.thisClass = res.result.class - if (!this.showAlert && this.thisClass.state == '3') { - uni.showModal({ - title: '提示', - content: '您好,当前教学进度已进入考试周,请尽快完成最终的笔试考试,如在结班(endTime)之前未完成考试,则卷面成绩记为0分', - confirmText: '好的', - showCancel: false - }) - this.showAlert = true - } + this.thisClass = res.result.class if (this.thisClass.state == '0') { this.tabId = '0' } else { @@ -1288,6 +1447,15 @@ } } + .testBox { + .mainTxt{color: #55aa00 !important;} + .scoreTitle { + .titles { + background-color: #55aa00; + } + } + } + .pingfenBox { border: 2px dotted #bed4ee; padding: 20rpx; @@ -1321,6 +1489,11 @@ } } + .testBox { + border-color: #aee5b5; + margin-bottom: 20rpx; + } + .zhengshu { color: #ffaa7f; border: 1px solid #ffaa7f @@ -1346,7 +1519,29 @@ .scoreNumber { font-size: 60rpx; } + +.upopBox { + padding: 40rpx; + max-height: 80vh; + overflow-y: scroll; + color: #666; + .item { + padding: 10rpx 0; + border-bottom: 1px solid #eee; + } + } + .scoreBox{ + align-items: center; + border: none !important; + margin-top: 20rpx; + text-align: center; background-color: #fff; padding: 10rpx 20rpx; + .ciyao{color: #999; margin-bottom: 20rpx;} + .score{color: #258feb; font-weight: bold; font-size: 36rpx;} + .seePaper{width: 50rpx; height: 50rpx; + image{width: 100%; height: 100%;} + } + } .chengji { padding-top: 20rpx; margin-top: 20rpx; @@ -1461,6 +1656,7 @@ color: #ff9277; text-align: center; } + .leve3.cantAnswer { color: #999; text-align: center; @@ -1537,9 +1733,7 @@ } .gotoExams { - margin: 20rpx 0; - margin-top: -10rpx; - + margin: 60rpx 0; text { display: block; text-align: center; @@ -1552,15 +1746,17 @@ } } - .scoreBox { border-top: 1px solid #eee; padding-top: 10rpx; - justify-content: space-around; + .scoreBox { + border-top: 1px solid #eee; + padding-top: 10rpx; + justify-content: space-around; align-items: center; margin-top: 20rpx; text-align: center; background-color: #fff; - + font-size: 26rpx; - + .ciyao { color: #999; } @@ -1570,7 +1766,7 @@ font-weight: bold; font-size: 36rpx; } - + } .classMateBox { @@ -1826,8 +2022,10 @@ } } + .optionsBox {} + .retake { - border: 1px solid #5049cf; - color: #5049cf; + border: 1px solid #55aa00; + color: #55aa7f; } \ No newline at end of file diff --git a/pages/miniClass/classInfoMan.vue b/pages/miniClass/classInfoMan.vue index 00e5075..84a04a5 100644 --- a/pages/miniClass/classInfoMan.vue +++ b/pages/miniClass/classInfoMan.vue @@ -258,7 +258,6 @@
- 创建日期 {{thisClass.createTime.substring(0,10)}} diff --git a/pages/miniClass/paperBack.vue b/pages/miniClass/paperBack.vue index 350cd3a..81d31b9 100644 --- a/pages/miniClass/paperBack.vue +++ b/pages/miniClass/paperBack.vue @@ -1,7 +1,7 @@