修改scorm的学习控制

This commit is contained in:
daihh
2023-03-01 11:46:26 +08:00
parent c8064b4bbc
commit 72b9a18206

View File

@@ -918,13 +918,20 @@
if(con.contentType>20){
let $this=this;
//用户的学习时长,音视频课程学习,单独的处理,不再追加学习时长
this.isAppendTime = false;
this.appendStudyOtherHandle = setTimeout(function() {
this.isAppendTime = false;
this.appendStudyOtherHandle = setTimeout(function() {
$this.appendStudyOtherTime();
}, 1000*60*2); //非音视频课程学习,2分钟后记录因为一次记录是60秒
//this.appendStudyTime();
}, 1000*60*2); //非音视频课程学习,2分钟后记录因为一次记录是60秒
//this.appendStudyTime();
//非视频音频的5秒后学习完成
this.handleTimeout = setTimeout(function(){$this.saveStudyInfo();},5000);//5秒后记录学习完成
if(con.contentType!=50){
this.handleTimeout = setTimeout(function(){$this.saveStudyInfo();},5000);//5秒后记录学习完成
}else{
//scorm课件不记录完成情况由播放回调记录完成情况
//当前先保存学习记录,未学习状态
this.saveScormStudy();
}
}
},
followUser(tea){
@@ -1522,6 +1529,34 @@
})
}
},
saveScormStudy() {
//只记录SCORM课件的学习
if(this.curContent.contentType!=50){
return;
}
if(this.curContent.status==9){
//已学习完的,不用再添加
return;
}
let params ={
studyId: this.studyId,//学习id,
courseId: this.courseId,//课程id,
contentId: this.curContent.id,//内容id,
contentType: this.curContent.contentType,
contentName: this.curContent.contentName,//内容名称
progress: 1,
status: 2,
contentTotal:this.totalContent
}
apiCourseStudy.studyContent(params).then(res=>{
if(res.status == 200) {
this.curContent.status=2;//完成
this.curContent.studyItemId=res.result;//学习记录id
}else{
console.log('记录学习失败:'+res.message+''+res.error);
}
})
},
//还需要记录播放时间
saveStudyInfo() { //记录课件学习信息
if(this.curContent.contentType>=60){