From 508f1e1c612e11d73a5dcdb350d2e4ab0abc1752 Mon Sep 17 00:00:00 2001 From: daihh Date: Mon, 19 Dec 2022 20:30:22 +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/study/coursenew.vue | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index ac123ce7..7af6653f 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -653,6 +653,8 @@ }, 5000); //5秒后记录学习完成 }else{ //scorm课件不记录完成情况,由播放回调记录完成情况 + //当前先保存学习记录,未学习状态 + this.saveScormStudy(); } } @@ -1255,6 +1257,34 @@ } } }, + saveScormStudy() { + //只记录SCORM课件的学习 + if (this.contentData.contentType != 50) { + return; + } + if (this.contentData.status == 9) { + //已学习完的,不会再记录 + return; + } + let params = { + studyId: this.studyId, //学习id, + courseId: this.courseId, //课程id, + contentId: this.contentData.id, //内容id, + contentType: this.contentData.contentType, + contentName: this.contentData.contentName, //内容名称 + progress: 0, + status: 1, + contentTotal: this.totalContent + }; + apiStudy.studyContent(params).then(res => { + if (res.status == 200) { + this.contentData.status = 2; //进行中 + this.contentData.studyItemId = res.result; //学习记录id + } else { + console.log('记录学习失败:' + res.message + ',' + res.error); + } + }); + }, saveStudyInfo() { //记录课件学习信息 if (this.contentData.contentType >= 60) {