Using lms.call across the Vue app
This commit is contained in:
@@ -11,10 +11,10 @@ export default {
|
||||
props: ['nextContent', 'nextContentType'],
|
||||
name: 'ContentNavigation',
|
||||
methods: {
|
||||
goNext() {
|
||||
addActivity() {
|
||||
if(this.$route.params.type != "Quiz"){
|
||||
frappe.call({
|
||||
method: "erpnext.www.lms.add_activity",
|
||||
lms.call({
|
||||
method: "add_activity",
|
||||
args: {
|
||||
enrollment: lms.store.enrolledCourses[this.$route.params.course],
|
||||
content_type: this.$route.params.type,
|
||||
@@ -22,29 +22,14 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
goNext() {
|
||||
this.addActivity()
|
||||
this.$router.push({ name: 'content', params: { course: this.$route.params.course, type:this.nextContentType, content:this.nextContent }})
|
||||
},
|
||||
finish() {
|
||||
if(this.$route.params.type != "Quiz"){
|
||||
frappe.call({
|
||||
method: "erpnext.www.lms.add_activity",
|
||||
args: {
|
||||
enrollment: lms.store.enrolledCourses[this.$route.params.course],
|
||||
content_type: this.$route.params.type,
|
||||
content: this.$route.params.content
|
||||
}
|
||||
})
|
||||
}
|
||||
frappe.call({
|
||||
method: "erpnext.www.lms.mark_course_complete",
|
||||
args: {
|
||||
enrollment: lms.store.enrolledCourses[this.$route.params.course]
|
||||
}
|
||||
})
|
||||
// lms.store.addCompletedCourses(this.$route.params.course)
|
||||
lms.store.updateCompletedCourses()
|
||||
this.addActivity()
|
||||
this.$router.push({ name: 'program', params: { program_name: this.$route.params.program_name}})
|
||||
|
||||
//
|
||||
lms.trigger('course-completed', course_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user