mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-11 03:46:47 +08:00
修改scorm的学习控制
This commit is contained in:
@@ -918,13 +918,20 @@
|
|||||||
if(con.contentType>20){
|
if(con.contentType>20){
|
||||||
let $this=this;
|
let $this=this;
|
||||||
//用户的学习时长,音视频课程学习,单独的处理,不再追加学习时长
|
//用户的学习时长,音视频课程学习,单独的处理,不再追加学习时长
|
||||||
this.isAppendTime = false;
|
this.isAppendTime = false;
|
||||||
this.appendStudyOtherHandle = setTimeout(function() {
|
this.appendStudyOtherHandle = setTimeout(function() {
|
||||||
$this.appendStudyOtherTime();
|
$this.appendStudyOtherTime();
|
||||||
}, 1000*60*2); //非音视频课程学习,2分钟后记录,因为一次记录是60秒
|
}, 1000*60*2); //非音视频课程学习,2分钟后记录,因为一次记录是60秒
|
||||||
//this.appendStudyTime();
|
//this.appendStudyTime();
|
||||||
//非视频,音频的5秒后学习完成
|
//非视频,音频的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){
|
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() { //记录课件学习信息
|
saveStudyInfo() { //记录课件学习信息
|
||||||
if(this.curContent.contentType>=60){
|
if(this.curContent.contentType>=60){
|
||||||
|
|||||||
Reference in New Issue
Block a user