课件预览判断题显示问题

This commit is contained in:
18571350067 2022-02-24 11:35:31 +08:00
parent 43ffaa56bf
commit e227c9ffa1
1 changed files with 45 additions and 37 deletions

View File

@ -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">正确答案:&nbsp;&nbsp;&nbsp;&nbsp;{{ 正确 }}</div>
</div>
<div v-if="item.questionType == 3 && item.rightAnswers== 2">
<div class="answer">正确答案:&nbsp;&nbsp;&nbsp;&nbsp;{{ 错误 }}</div>
</div>
<!-- 显示简答题 -->
<div v-if="item.questionType == 4">
<div class="answer">正确答案:&nbsp;&nbsp;&nbsp;&nbsp;{{ item.rightAnswers }}</div> <div class="answer">正确答案:&nbsp;&nbsp;&nbsp;&nbsp;{{ 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 {