课件预览判断题显示问题
This commit is contained in:
parent
43ffaa56bf
commit
e227c9ffa1
|
@ -57,8 +57,16 @@
|
||||||
<div v-if="item.answerF" class="answer">F. {{ item.answerF }}</div>
|
<div v-if="item.answerF" class="answer">F. {{ item.answerF }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 显示简答题 || 判断题内容-->
|
<!-- 判断题内容 -->
|
||||||
<div v-if="item.questionType == 3 || item.questionType == 4">
|
<div v-if="item.questionType == 3 && item.rightAnswers== 1">
|
||||||
|
<div class="answer">正确答案: {{ 正确 }}</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="item.questionType == 3 && item.rightAnswers== 2">
|
||||||
|
<div class="answer">正确答案: {{ 错误 }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 显示简答题 -->
|
||||||
|
<div v-if="item.questionType == 4">
|
||||||
<div class="answer">正确答案: {{ item.rightAnswers }}</div>
|
<div class="answer">正确答案: {{ item.rightAnswers }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -88,11 +96,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import 'video.js/dist/video-js.css'
|
import 'video.js/dist/video-js.css';
|
||||||
import 'vue-video-player/src/custom-theme.css'
|
import 'vue-video-player/src/custom-theme.css';
|
||||||
import { videoPlayer } from 'vue-video-player'
|
import { videoPlayer } from 'vue-video-player';
|
||||||
import { coursewareDeatil } from '@/api/course/courseware'
|
import { coursewareDeatil } from '@/api/course/courseware';
|
||||||
import { testing } from '@/api/course/question/requiredQuestion'
|
import { testing } from '@/api/course/question/requiredQuestion';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { videoPlayer },
|
components: { videoPlayer },
|
||||||
|
@ -130,80 +138,80 @@ export default {
|
||||||
],
|
],
|
||||||
// poster: 'https://pica.zhimg.com/v2-c79ec963f532b2ad2749d5c71353c0d0_1440w.jpg?source=172ae18b', //封面图片
|
// poster: 'https://pica.zhimg.com/v2-c79ec963f532b2ad2749d5c71353c0d0_1440w.jpg?source=172ae18b', //封面图片
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
console.log('porp - coursewareId :', this.coursewareId)
|
console.log('porp - coursewareId :', this.coursewareId);
|
||||||
let parameter = {}
|
let parameter = {};
|
||||||
coursewareDeatil(Object.assign(parameter, this.queryParam)).then((res) => {
|
coursewareDeatil(Object.assign(parameter, this.queryParam)).then(res => {
|
||||||
//课件内容
|
//课件内容
|
||||||
this.courseware = res.data
|
this.courseware = res.data;
|
||||||
if (this.courseware.videoList.length > 0) {
|
if (this.courseware.videoList.length > 0) {
|
||||||
//视频截取的封面图
|
//视频截取的封面图
|
||||||
if (this.courseware.image != '' || this.courseware.image) {
|
if (this.courseware.image != '' || this.courseware.image) {
|
||||||
this.images = this.courseware.image.split(',')
|
this.images = this.courseware.image.split(',');
|
||||||
this.playerOptions.poster = this.images[0]
|
this.playerOptions.poster = this.images[0];
|
||||||
}
|
}
|
||||||
//课件视频展现
|
//课件视频展现
|
||||||
if (this.courseware.type == '1') this.play(this.courseware.videoList[0].path, 0)
|
if (this.courseware.type == '1') this.play(this.courseware.videoList[0].path, 0);
|
||||||
|
|
||||||
//文本下载
|
//文本下载
|
||||||
if (this.courseware.type == '2') {
|
if (this.courseware.type == '2') {
|
||||||
this.coursewareName = this.courseware.videoList[0].name
|
this.coursewareName = this.courseware.videoList[0].name;
|
||||||
this.path = this.courseware.videoList[0].path
|
this.path = this.courseware.videoList[0].path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//课中检测必选题
|
//课中检测必选题
|
||||||
testing(Object.assign(parameter, this.queryParam)).then((res1) => {
|
testing(Object.assign(parameter, this.queryParam)).then(res1 => {
|
||||||
this.question = res1.data
|
this.question = res1.data;
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//返回
|
//返回
|
||||||
goback() {
|
goback() {
|
||||||
if(this.$route.query.isOther){
|
if (this.$route.query.isOther) {
|
||||||
this.$router.go(-1)
|
this.$router.go(-1);
|
||||||
}else{
|
} else {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/course/CoursewareList',
|
path: '/course/CoursewareList',
|
||||||
query: { id: this.$route.query.courseId, type: this.$route.query.types },
|
query: { id: this.$route.query.courseId, type: this.$route.query.types },
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//选择播放的文件/下载的文件
|
//选择播放的文件/下载的文件
|
||||||
play(path, index, name) {
|
play(path, index, name) {
|
||||||
this.isactive = index
|
this.isactive = index;
|
||||||
|
|
||||||
if (this.courseware.type == '2') {
|
if (this.courseware.type == '2') {
|
||||||
this.coursewareName = name
|
this.coursewareName = name;
|
||||||
this.path = path
|
this.path = path;
|
||||||
} else {
|
} else {
|
||||||
// 加载视频
|
// 加载视频
|
||||||
this.playerOptions.sources = []
|
this.playerOptions.sources = [];
|
||||||
this.playerOptions.sources.push({ type: 'video/mp4', src: path })
|
this.playerOptions.sources.push({ type: 'video/mp4', src: path });
|
||||||
console.log('index', index)
|
console.log('index', index);
|
||||||
console.log('images', this.images)
|
console.log('images', this.images);
|
||||||
this.playerOptions.poster = this.images[index]
|
this.playerOptions.poster = this.images[index];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//下载课件
|
//下载课件
|
||||||
download() {
|
download() {
|
||||||
window.location.href = this.path //文件下载
|
window.location.href = this.path; //文件下载
|
||||||
},
|
},
|
||||||
|
|
||||||
//控制显示视频还是课中检测
|
//控制显示视频还是课中检测
|
||||||
callback(key) {
|
callback(key) {
|
||||||
console.log(key)
|
console.log(key);
|
||||||
},
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
console.log(`checked = ${e.target.value}`)
|
console.log(`checked = ${e.target.value}`);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.vjs-custom-skin {
|
.vjs-custom-skin {
|
||||||
|
|
Loading…
Reference in New Issue