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