90 lines
1.7 KiB
Vue
Raw Normal View History

2018-10-30 18:25:49 +05:30
<template>
2018-11-01 17:19:53 +05:30
<div>
<component v-bind:is="currentComponent" :content="content" :type="type">
<ContentNavigation :nextContent="nextContent" :nextContentType="nextContentType"/>
2018-11-01 17:19:53 +05:30
</component>
</div>
2018-10-30 18:25:49 +05:30
</template>
<script>
2018-11-13 17:24:07 +05:30
import Article from "../components/Article.vue"
import Quiz from "../components/Quiz.vue"
import Video from "../components/Video.vue"
import ContentNavigation from "../components/ContentNavigation.vue"
2018-11-01 17:19:53 +05:30
2018-10-30 18:25:49 +05:30
export default {
2018-11-12 12:50:54 +05:30
props:['program_name', 'course', 'type', 'content'],
2018-11-22 12:22:20 +05:30
name: "ContentPage",
2018-11-01 17:19:53 +05:30
data() {
return{
2018-11-05 13:11:37 +05:30
nextContent: '',
2018-11-01 17:19:53 +05:30
nextContentType: '',
}
},
computed: {
currentComponent: function() {
if(this.type === "Article") {
2018-11-13 17:24:07 +05:30
return 'Article'
2018-11-01 17:19:53 +05:30
}
else if(this.type === "Quiz") {
2018-11-13 17:24:07 +05:30
return 'Quiz'
2018-11-01 17:19:53 +05:30
}
else if(this.type === "Video") {
2018-11-13 17:24:07 +05:30
return 'Video'
2018-11-01 17:19:53 +05:30
}
},
},
mounted() {
2018-11-19 15:12:39 +05:30
this.getNextContent().then(data => {
2018-11-20 17:36:57 +05:30
this.nextContent = data.content,
this.nextContentType = data.content_type
2018-11-01 17:19:53 +05:30
});
},
2018-11-19 15:12:39 +05:30
methods: {
getNextContent(){
2018-11-20 17:36:57 +05:30
window.t = this
return lms.call("get_next_content",
{
2018-11-19 15:12:39 +05:30
content: this.content,
content_type: this.type,
course: this.course
}
2018-11-20 17:36:57 +05:30
);
2018-11-19 15:12:39 +05:30
}
},
2018-11-01 17:19:53 +05:30
components: {
2018-11-13 17:24:07 +05:30
Article,
Video,
Quiz,
ContentNavigation
2018-11-01 17:19:53 +05:30
}
2018-10-30 18:25:49 +05:30
};
2018-11-01 17:19:53 +05:30
</script>
<style>
.footer-message {
display: none;
}
.video-top-section {
padding-top: 3rem !important;
padding-bottom: 1rem !important;
}
.video-description-section {
padding-top: 0em !important;
}
.article-top-section {
padding-top: 0.5em !important;
padding-bottom: 0rem !important;
}
.article-content-section {
padding-top: 0em !important;
}
.quiz-section {
2018-11-02 11:29:02 +05:30
padding-top: 0.5em !important;
2018-11-01 17:19:53 +05:30
padding-bottom: 0rem !important;
}
</style>