41 lines
1.1 KiB
Vue
Raw Normal View History

2018-11-01 17:20:04 +05:30
<template>
<div class="nav-buttons">
2018-11-02 16:29:04 +05:30
<button class='btn btn-outline-secondary' @click="$router.go(-1)">Back</button>
2018-11-05 13:11:37 +05:30
<button v-if="nextContent" class='btn btn-primary' @click="goNext()">Next</button>
2019-02-28 16:33:38 +05:30
<button v-else class='btn btn-primary' @click="finish()">Finish Topic</button>
2018-11-01 17:20:04 +05:30
</div>
</template>
<script>
export default {
props: ['nextContent', 'nextContentType'],
2018-11-14 13:05:22 +05:30
name: 'ContentNavigation',
2018-11-03 20:43:59 +05:30
methods: {
2018-11-19 15:12:39 +05:30
addActivity() {
2018-11-05 13:11:37 +05:30
if(this.$route.params.type != "Quiz"){
2018-11-20 18:37:01 +05:30
console.log("Adding Activity")
2018-11-20 17:36:57 +05:30
lms.call("add_activity",
{
course: this.$route.params.course_name,
2018-11-05 13:11:37 +05:30
content_type: this.$route.params.type,
2019-02-28 16:33:38 +05:30
content: this.$route.params.content,
2018-11-05 13:11:37 +05:30
}
2018-11-20 17:36:57 +05:30
)
2018-11-05 13:11:37 +05:30
}
2018-11-19 15:12:39 +05:30
},
goNext() {
this.addActivity()
this.$router.push({ name: 'content', params: { course: this.$route.params.course_name, type:this.nextContentType, content:this.nextContent }})
},
finish() {
2018-11-19 15:12:39 +05:30
this.addActivity()
2019-02-28 16:33:38 +05:30
this.$router.push({ name: 'course', params: { program_name: this.$route.params.program_name, course_name: this.$route.params.course_name}})
2018-11-13 16:47:46 +05:30
lms.trigger('course-completed', course_name);
2018-11-03 20:43:59 +05:30
}
}
2018-11-01 17:20:04 +05:30
};
</script>
<style lang="css" scoped>
</style>