diff --git a/components/course-exam/course-exam.vue b/components/course-exam/course-exam.vue index 04c15fb..a8d4797 100644 --- a/components/course-exam/course-exam.vue +++ b/components/course-exam/course-exam.vue @@ -94,9 +94,11 @@ this.loadRecord(); }, watch:{ - studyId(newVal){ + content(newObj){ + this.loadExamInfo(); this.loadRecord(); - } + }, + deep:true }, methods: { loadExamInfo(){ @@ -125,24 +127,25 @@ if(this.studyId==''){ return; } - this.loadExamContent(); - if(this.records.length==0){ - let params={ - studyId:this.studyId, - contentId:this.content.id - } - apiStudy.myExamList2(params).then(examRs=>{ - if(examRs.status==200){ - this.records=examRs.result; - let len=examRs.result.length; - if(this.info.times>len){ - this.allowSubmit=true; - }else{ - this.allowSubmit=false; + this.records=[]; + this.loadExamContent(); + //if(this.records.length==0){ + let params={ + studyId:this.studyId, + contentId:this.content.id } - } - }) - } + apiStudy.myExamList2(params).then(examRs=>{ + if(examRs.status==200){ + this.records=examRs.result; + let len=examRs.result.length; + if(this.info.times>len){ + this.allowSubmit=true; + }else{ + this.allowSubmit=false; + } + } + }) + //} }, startTest(){ //转向详细页面 diff --git a/components/course-homework/course-homework.vue b/components/course-homework/course-homework.vue index 0fd2b46..9e15831 100644 --- a/components/course-homework/course-homework.vue +++ b/components/course-homework/course-homework.vue @@ -92,14 +92,12 @@ this.loadHomeworkInfo(); }, watch:{ - studyId(newVal){ - this.loadHomeworkInfo(); - }, content(newVal,oldVal){ if(newVal.id!=oldVal.id){ this.loadHomeworkInfo(); } - } + }, + deep:true }, methods: { loadHomeworkInfo(){ diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index 0a53e1b..e4d0050 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -83,7 +83,8 @@ 查看更多∨
- + +
@@ -709,7 +710,20 @@ this.playContent(this.curContent,0); //this.curSection=this.sectionList[0]; }else{ - this.curContent=this.contentList[0]; + let treelist=this.catalogTree; + this.curSection=treelist[0].sec; + this.curContent=treelist[0].children[0]; + // this.curContent=this.contentList[0]; + // this.curSection=this.sectionList[0]; + //要不要在这里处理? + // if(this.curContent.contentType==10 || this.curContent.contentType==20){ + // if(this.contentList[0].content.startsWith('\{')){ + // this.curriculumData=JSON.parse(this.contentList[0].content); + // }else{ + // this.curriculumData.url=this.contentList[0].content; + // } + // } + //this.curContent=this.contentList[0]; this.playContent(this.curContent,0); } uni.hideLoading(); @@ -821,6 +835,7 @@ this.scormUrl='';//清空地址 this.articleMore=true; this.clearTimeHandle(); + //this.curContent=0; // console.log(con,'con'); this.playerBoxShow=false; if(con.contentType==40){ @@ -851,11 +866,13 @@ pars+='&studentName='+encodeURIComponent(this.userInfo.name); pars+='&lmsId='+this.studyId; pars+='&scoId=';//不指定,scorm模块自动根据学习记录定位 + pars+='&r='+Math.random();//加一个随机数,以便重新加载 let urlPre=window.location.protocol; let configUrl=config.scormPlayer; configUrl=urlPre+configUrl.substring(configUrl.indexOf(':')+1); this.scormUrl=configUrl+pars;//播放的首页 + console.log(this.scormUrl,'this.scormUrl') } }); @@ -877,6 +894,7 @@ this.blobUrl=this.fileBaseUrl+this.curriculumData.url; //console.log(this.blobUrl,'this.blobUrl'); } + //console.log(con.contentType,'con.contentType'); this.curContent=con; this.catalogShow=false; this.scoreInfo.itemId=con.id; diff --git a/pages/study/exam.vue b/pages/study/exam.vue index 4cc9bc0..1ff3b74 100644 --- a/pages/study/exam.vue +++ b/pages/study/exam.vue @@ -12,13 +12,19 @@ - [{{getTypeName(curItem.type)}}]{{curItem.content}} + + [{{getTypeName(curItem.type)}}]{{curItem.content}} + + {{toLetter(optIdx+1)}}.{{opt.content}} + + + @@ -51,8 +57,10 @@