提交修改

This commit is contained in:
daihh
2022-12-19 18:54:40 +08:00
parent 6201432d85
commit 8a982a695f
2 changed files with 46 additions and 9 deletions

View File

@@ -778,6 +778,12 @@
if(con.contentType==40){ if(con.contentType==40){
//console.log('加载pdf文件内容'); //console.log('加载pdf文件内容');
$this.loadPdfFile(); $this.loadPdfFile();
}else if(con.contentType==50){
//console.log('加载pdf文件内容');
if(!this.scormUrl){
$this.loadScormFile();
}
} }
if(con.contentType==52){ if(con.contentType==52){
if(con.content.startsWith('\{')){ if(con.content.startsWith('\{')){
@@ -836,7 +842,10 @@
}, },
loadScormFile(){ loadScormFile(){
//对于scorm课件内容需要再查一下 //对于scorm课件内容需要再查一下
this.scormUrl=''; //this.scormUrl='';
if(this.scormUrl){
return;
}
apiCourseFile.detail(this.cware.content.contentRefId).then(rs=>{ apiCourseFile.detail(this.cware.content.contentRefId).then(rs=>{
if(rs.status==200){ if(rs.status==200){
this.curCFile=rs.result; this.curCFile=rs.result;
@@ -952,6 +961,7 @@
resetContent(index){ resetContent(index){
if(index==1){ if(index==1){
this.cware.content.id=''; this.cware.content.id='';
this.scormUrl='';
this.cware.content.contentRefId=''; this.cware.content.contentRefId='';
this.cware.content.contentName=''; this.cware.content.contentName='';
this.cware.content.content=''; this.cware.content.content='';
@@ -1030,6 +1040,7 @@
}); });
if(!pass){ if(!pass){
this.$message.error("试卷试题请填写完整,每个试题必须要有答案"); this.$message.error("试卷试题请填写完整,每个试题必须要有答案");
this.loading=false;
return; return;
} }
this.exam.info.paperContent=JSON.stringify(this.exam.paperJson); this.exam.info.paperContent=JSON.stringify(this.exam.paperJson);
@@ -1139,11 +1150,11 @@
if(this.cware.content.contentType==40){ if(this.cware.content.contentType==40){
setTimeout(function(){ setTimeout(function(){
$this.loadPdfFile(); $this.loadPdfFile();
},2000); },1000);
}else if(this.cware.content.contentType==50){ }else if(this.cware.content.contentType==50){
setTimeout(function(){ setTimeout(function(){
$this.loadScormFile(); $this.loadScormFile();
},2000); },500);
} }
}, },
getCoursewareList() { getCoursewareList() {

View File

@@ -85,6 +85,9 @@
<div v-if="resType == 41"> <div v-if="resType == 41">
<div style="padding: 20px;" v-html="contentData.content"></div> <div style="padding: 20px;" v-html="contentData.content"></div>
</div> </div>
<div v-if="resType == 50">
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" border="0px" style="width:100%;height:400px;border:0px"></iframe>
</div>
<div v-if="resType == 52"> <div v-if="resType == 52">
<div v-if="contentData.content != ''"> <div v-if="contentData.content != ''">
<div class="hyper-link" v-if="conLink.openType == 2"> <div class="hyper-link" v-if="conLink.openType == 2">
@@ -317,6 +320,7 @@
data() { data() {
return { return {
cutOrgNamePath, cutOrgNamePath,
scormUrl:'',//当前播放的scormUrl
loading:false, loading:false,
controlHeight:400,//左边控制区域的内容高度 controlHeight:400,//左边控制区域的内容高度
timer: '', timer: '',
@@ -438,7 +442,6 @@
noteChange(){ noteChange(){
//视频点定位,直接到播放的视频位置 //视频点定位,直接到播放的视频位置
this.timer = new Date().getTime() this.timer = new Date().getTime()
}, },
//非音视频课学习时长的增加,每一分钟保存一次 //非音视频课学习时长的增加,每一分钟保存一次
appendStudyOtherTime() { appendStudyOtherTime() {
@@ -592,6 +595,24 @@
} }
}); });
// } // }
}else if(r.contentType==50){ //scorm
this.scormUrl='';
apiCourseFile.detail(r.contentRefId).then(cfrs => {
if(cfrs.status==200){
this.curCFile = cfrs.result;
//this.scormUrl=cfrs
let pars='?mode=normal';
pars+='&scormId='+this.curCFile.id;
pars+='&courseId='+this.courseId;
pars+='&contentId='+r.id;
pars+='&studentId='+this.userInfo.aid;
pars+='&studentName='+encodeURIComponent(this.userInfo.name);
pars+='&lmsId='+this.studyId;
pars+='&scoId=';//不指定scorm模块自动根据学习记录定位
this.scormUrl=process.env.VUE_APP_SCORM_URL+pars;//播放的首页
}
});
}else if (r.contentType == 52) { }else if (r.contentType == 52) {
this.isAppendTime = false; this.isAppendTime = false;
if (r.content.startsWith('\{')) { if (r.content.startsWith('\{')) {
@@ -617,6 +638,7 @@
if (this.contentData.status < 2) { if (this.contentData.status < 2) {
this.contentData.status = 2; //进行中 this.contentData.status = 2; //进行中
} }
//以下是学习记录
if (this.contentData.contentType > 20) { //非视频类的 if (this.contentData.contentType > 20) { //非视频类的
//用户的学习时长,非音视频课程学习,单独的处理 //用户的学习时长,非音视频课程学习,单独的处理
this.isAppendTime = false; this.isAppendTime = false;
@@ -625,9 +647,13 @@
$this.appendStudyOtherTime(); $this.appendStudyOtherTime();
}, 1000*60*2); //非音视频课程学习,2分钟后记录因为一次记录是60秒 }, 1000*60*2); //非音视频课程学习,2分钟后记录因为一次记录是60秒
//this.appendStudyTime(); //this.appendStudyTime();
if (this.contentData.contentType != 50) {
this.handleTimeout = setTimeout(function(){ this.handleTimeout = setTimeout(function(){
$this.saveStudyInfo(); $this.saveStudyInfo();
}, 5000); //5秒后记录学习完成 }, 5000); //5秒后记录学习完成
}else{
//scorm课件不记录完成情况由播放回调记录完成情况
}
} }