From 5fa79d372cf11598fe74de75cbfba5076425f2c1 Mon Sep 17 00:00:00 2001 From: daihh Date: Wed, 16 Nov 2022 17:56:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/exam/Test.vue | 12 +++++++++++- src/views/study/coursenew.vue | 30 ++++-------------------------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/views/exam/Test.vue b/src/views/exam/Test.vue index 0f79de21..389309ad 100644 --- a/src/views/exam/Test.vue +++ b/src/views/exam/Test.vue @@ -242,6 +242,8 @@ export default { toScoreTow, examId:'',//考试的id taskId:'',//考试任务的id + refId:'',//关联的id + refType:'1',//关联的类型,1表默认的独立考试 lastId:'',//最后一次提交的答卷 canExam:false,//能否参加考试 noExam:false,//不能参加考试 @@ -296,7 +298,14 @@ export default { ...mapGetters(['userInfo']) }, mounted() { - this.examId = this.$route.query.id + this.examId = this.$route.query.id; + if(this.$route.query.refId){ + this.refId = this.$route.query.refId; + } + if(this.$route.query.refType){ + this.refType = this.$route.query.refType; + } + if(this.examId) { this.loadData() }else{ @@ -506,6 +515,7 @@ export default { } let that = this; let data = {}; + data.aloneId=this.taskId; data.testId = this.testPaper.id; data.testName = this.testPaper.testName; data.testDuration = this.testPaper.testDuration; diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 76b4e6cb..a37716ea 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -1070,7 +1070,7 @@ }, audioPause() { //console.log("暂停"); - this.stopStudyTime();//启动追加学习时长 + this.stopStudyTime();//停止追加学习时长 }, audioEnd() { //console.log("播放结束"); @@ -1342,35 +1342,13 @@ let sen = parseInt(m / 1000); //计算秒数 duration = duration + $this.appentInterval/1000;//追加的是秒 if (sen>=60) { //一分钟保存一次 - this.saveStudyDuration(duration); - // if (duration > 0) { - // let postData = { - // id: this.appentId, - // studyId: this.studyId, - // courseId: this.courseInfo.id, - // contentId: this.contentData.id, - // studyInfo: this.courseInfo.name + - // "-" + - // this.contentData.contentName, - // duration: duration - // }; - // apiStudy.appendStudyTime(postData).then(rs => { - // if (rs.status == 200) { - // $this.appentId = rs.result; - // $this.appendStartTime = new Date(); //重置开始时间 - // studyUtil.clearStudyDuration(); //清除本地存储 - // //this.appendHandle=setTimeout(function() {$this.appendStudyTime();}, $this.appentInterval); - // } else { - // console.log(rs.message); - // } - // }); - // } + this.saveStudyDuration(duration); } else { - studyUtil.setStudyDuration(duration); //添加到本地存储中 + studyUtil.setStudyDuration(duration); //添加到本地存储中 } //启动下次追加学习时长 this.appendHandle = setTimeout(function() { - $this.appendStudyTime(); + $this.appendStudyTime(); }, $this.appentInterval); },