mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-22 01:06:43 +08:00
Merge branch 'scorm' into third
This commit is contained in:
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
<!-- <div style="margin-top: 10px" v-if="isUpload"><el-button type="primary" size="mini" @click="isUploadHandle()">选择文件并上传</el-button></div> -->
|
||||
<div style="margin-top: 10px">
|
||||
<file-upload dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
||||
<file-upload scorm="zip" dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
@@ -160,7 +160,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="duration" label="时长(秒)" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input type="number" size="small" v-model="scope.row.duration"></el-input>
|
||||
<el-input type="number" size="small" v-model="scope.row.minute"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="可见性" width="100">
|
||||
@@ -190,7 +190,7 @@
|
||||
</el-dialog>
|
||||
<el-dialog title="预览课件" :close-on-click-modal="false" width="800px" :visible.sync="coursewareShow" custom-class="g-dialog">
|
||||
<div>
|
||||
<div class="courseware-title">{{ fileInfo.fileName }}</div>
|
||||
<div class="courseware-title">{{ fileInfo.name }}</div>
|
||||
<div class="courseware-icon">
|
||||
<div v-if="fileInfo.resType == 10" style="position: relative;">
|
||||
<videoPlayer
|
||||
@@ -236,7 +236,7 @@
|
||||
<el-form-item label="课件类型">{{ getType(form.resType) }}</el-form-item>
|
||||
<el-form-item label="时长(分)">
|
||||
<!-- <el-input v-model="form.duration"></el-input> -->
|
||||
<el-input type="number" placeholder="请输入数字" :maxlength="32" show-word-limit v-model="form.duration"></el-input>
|
||||
<el-input type="number" placeholder="请输入数字" :maxlength="32" show-word-limit v-model="form.minute"></el-input>
|
||||
<!-- <el-input-number max="" v-model="form.duration" controls-position="right"></el-input-number> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="可见性">
|
||||
@@ -305,10 +305,8 @@ export default {
|
||||
{ value: 10, label: '视频' },
|
||||
{ value: 20, label: '音频' },
|
||||
{ value: 30, label: '图片' },
|
||||
{ value: 40, label: '文档' }
|
||||
// { value: 41, label: "图文" },
|
||||
// { value: 50, label: "scrom包" },
|
||||
// { value: 90, label: "其他" }
|
||||
{ value: 40, label: '文档' },
|
||||
{ value: 50, label: "scrom" }
|
||||
],
|
||||
form: {
|
||||
id:'',
|
||||
@@ -532,6 +530,11 @@ export default {
|
||||
if (status === 200) {
|
||||
result.device1 = true;
|
||||
result.device2 = true;
|
||||
result.minute='';
|
||||
if(result.duration){
|
||||
result.minute=Math.round(result.duration/60); //四舍五入
|
||||
}
|
||||
|
||||
this.fileList.push(result);
|
||||
} else {
|
||||
this.$message.error(error);
|
||||
@@ -554,6 +557,11 @@ export default {
|
||||
} else if (item.device2 === true) {
|
||||
item.device = 2;
|
||||
}
|
||||
//转化为秒
|
||||
if(item.minute){
|
||||
result.duration=parseFloat(result.minute)*60;
|
||||
}
|
||||
|
||||
});
|
||||
this.loading = true;
|
||||
coueseFile.batchUpdate(this.fileList).then(rs => {
|
||||
@@ -575,6 +583,9 @@ export default {
|
||||
this.params.pageIndex = this.page.pageIndex;
|
||||
const { result, error, status } = await coueseFile.pageList(this.params, this.page);
|
||||
if (status === 200) {
|
||||
result.list.forEach(item=>{
|
||||
item.minute=Math.round(item.duration/60);//转化为分钟
|
||||
})
|
||||
this.tableData = result.list;
|
||||
this.page.count = result.count;
|
||||
this.page.pageSize = result.pageSize;
|
||||
@@ -588,22 +599,27 @@ export default {
|
||||
editFile(row) {
|
||||
coueseFile.detail(row.id).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.form = res.result;
|
||||
if (res.result.resOwner3 == '') {
|
||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2];
|
||||
} else {
|
||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2, res.result.resOwner3];
|
||||
}
|
||||
if (res.result.device === 1) {
|
||||
this.form.device1 = true;
|
||||
} else if (res.result.device === 2) {
|
||||
this.form.device2 = true;
|
||||
} else if (res.result.device === 3) {
|
||||
this.form.device1 = true;
|
||||
this.form.device2 = true;
|
||||
}
|
||||
this.form = res.result;
|
||||
if(this.form.duration){
|
||||
this.form.minute=Math.round(res.result.duration/60);//转化为分钟
|
||||
}else{
|
||||
this.form.minute=0;
|
||||
}
|
||||
})
|
||||
if (res.result.resOwner3 == '') {
|
||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2];
|
||||
} else {
|
||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2, res.result.resOwner3];
|
||||
}
|
||||
if (res.result.device === 1) {
|
||||
this.form.device1 = true;
|
||||
} else if (res.result.device === 2) {
|
||||
this.form.device2 = true;
|
||||
} else if (res.result.device === 3) {
|
||||
this.form.device1 = true;
|
||||
this.form.device2 = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
this.editCoursewareShow = true;
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
@@ -685,11 +701,11 @@ export default {
|
||||
//scorm课件的内容,取第一个sco
|
||||
var scorm=JSON.parse(row.content);
|
||||
//console.log(scorm,'scorm')
|
||||
if(scorm.index){
|
||||
if(scorm){
|
||||
//这里需要提取的到配置文件中,实际中只需要传 rowId就可以了
|
||||
this.scormUrl='http://localhost:9083/scorm-player?scormId='+row.id;//播放的首页
|
||||
this.scormUrl=process.env.VUE_APP_SCORM_URL+'?mode=preview&scormId='+row.id;//播放的首页
|
||||
}else{
|
||||
this.scormUrl='http://localhost:9083/scorm-player?scormId='+row.id;//播放的首页
|
||||
this.$message({type: 'error',message: 'SCORM包解析失败'});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -85,6 +85,9 @@
|
||||
<div v-if="resType == 41">
|
||||
<div style="padding: 20px;" v-html="contentData.content"></div>
|
||||
</div>
|
||||
<div v-if="resType == 50" style="min-height: 500px;">
|
||||
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" scrolling="no" border="0px" style="width:100%;height:500px;border:0px;overflow:hidden;"></iframe>
|
||||
</div>
|
||||
<div v-if="resType == 52">
|
||||
<div v-if="contentData.content != ''">
|
||||
<div class="hyper-link" v-if="conLink.openType == 2">
|
||||
@@ -317,6 +320,7 @@
|
||||
data() {
|
||||
return {
|
||||
cutOrgNamePath,
|
||||
scormUrl:'',//当前播放的scormUrl
|
||||
loading:false,
|
||||
controlHeight:400,//左边控制区域的内容高度
|
||||
timer: '',
|
||||
@@ -436,9 +440,8 @@
|
||||
this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)})
|
||||
},
|
||||
noteChange(){
|
||||
//视频点定位,直接到播放的视频位置
|
||||
//视频点定位,直接到播放的视频位置
|
||||
this.timer = new Date().getTime()
|
||||
|
||||
},
|
||||
//非音视频课学习时长的增加,每一分钟保存一次
|
||||
appendStudyOtherTime() {
|
||||
@@ -592,7 +595,25 @@
|
||||
}
|
||||
});
|
||||
// }
|
||||
} else if (r.contentType == 52) {
|
||||
}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&r='+Math.random();
|
||||
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) {
|
||||
this.isAppendTime = false;
|
||||
if (r.content.startsWith('\{')) {
|
||||
this.conLink = JSON.parse(r.content);
|
||||
@@ -617,6 +638,7 @@
|
||||
if (this.contentData.status < 2) {
|
||||
this.contentData.status = 2; //进行中
|
||||
}
|
||||
//以下是学习记录
|
||||
if (this.contentData.contentType > 20) { //非视频类的
|
||||
//用户的学习时长,非音视频课程学习,单独的处理
|
||||
this.isAppendTime = false;
|
||||
@@ -625,9 +647,15 @@
|
||||
$this.appendStudyOtherTime();
|
||||
}, 1000*60*2); //非音视频课程学习,2分钟后记录,因为一次记录是60秒
|
||||
//this.appendStudyTime();
|
||||
this.handleTimeout = setTimeout(function() {
|
||||
$this.saveStudyInfo();
|
||||
}, 5000); //5秒后记录学习完成
|
||||
if (this.contentData.contentType != 50) {
|
||||
this.handleTimeout = setTimeout(function(){
|
||||
$this.saveStudyInfo();
|
||||
}, 5000); //5秒后记录学习完成
|
||||
}else{
|
||||
//scorm课件不记录完成情况,由播放回调记录完成情况
|
||||
//当前先保存学习记录,未学习状态
|
||||
this.saveScormStudy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1229,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) {
|
||||
|
||||
Reference in New Issue
Block a user