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) {