课件预览判断题显示问题

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>
<!-- 显示简答题 || 判断题内容-->
<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>
@ -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)
}else{
if (this.$route.query.isOther) {
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 {