From 8951c165f0232595c620eb22f21c60384db8fb6e Mon Sep 17 00:00:00 2001 From: scmmishra Date: Tue, 20 Nov 2018 17:36:57 +0530 Subject: [PATCH] Fixed major bugs --- .../education/lms/components/ContentNavigation.vue | 7 +++---- .../public/js/education/lms/components/Quiz.vue | 14 ++++++-------- .../education/lms/components/TopSectionButton.vue | 13 ++++++------- .../public/js/education/lms/pages/CoursePage.vue | 12 ++++++------ 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/erpnext/public/js/education/lms/components/ContentNavigation.vue b/erpnext/public/js/education/lms/components/ContentNavigation.vue index 40420be46d..bf677a302f 100644 --- a/erpnext/public/js/education/lms/components/ContentNavigation.vue +++ b/erpnext/public/js/education/lms/components/ContentNavigation.vue @@ -13,14 +13,13 @@ export default { methods: { addActivity() { if(this.$route.params.type != "Quiz"){ - lms.call({ - method: "add_activity", - args: { + lms.call("add_activity", + { enrollment: lms.store.enrolledCourses[this.$route.params.course], content_type: this.$route.params.type, content: this.$route.params.content } - }) + ) } }, goNext() { diff --git a/erpnext/public/js/education/lms/components/Quiz.vue b/erpnext/public/js/education/lms/components/Quiz.vue index 92d6a94bb7..43f9f375ee 100644 --- a/erpnext/public/js/education/lms/components/Quiz.vue +++ b/erpnext/public/js/education/lms/components/Quiz.vue @@ -61,25 +61,23 @@ export default { }, methods: { getQuizWithoutAnswers() { - return lms.call({ - method: "get_quiz_without_answers", - args: { + return lms.call("get_quiz_without_answers", + { quiz_name: this.content, } - }) + ) }, updateResponse(res) { this.quizResponse[res.question] = (res.option) }, submitQuiz() { - lms.call({ - method: "evaluate_quiz", - args: { + lms.call("evaluate_quiz", + { enrollment: lms.store.enrolledCourses[this.$route.params.course], quiz_response: this.quizResponse, quiz_name: this.content } - }).then(data => { + ).then(data => { this.score = data, this.submitted = true, this.quizResponse = null diff --git a/erpnext/public/js/education/lms/components/TopSectionButton.vue b/erpnext/public/js/education/lms/components/TopSectionButton.vue index 40ec4e5d67..c4a04caa5a 100644 --- a/erpnext/public/js/education/lms/components/TopSectionButton.vue +++ b/erpnext/public/js/education/lms/components/TopSectionButton.vue @@ -60,13 +60,12 @@ export default { this.$router.push({ name: 'content', params: { program_name: this.$route.params.program_name, course: this.nextCourse, type: this.nextContentType, content: this.nextContent}}) } else { - lms.call({ - method: "enroll_in_program", - args:{ - program_name: this.$route.params.program_name, - student_email_id: frappe.session.user - } - }) + lms.call("enroll_in_program", + { + program_name: this.$route.params.program_name, + student_email_id: frappe.session.user + } + ) lms.store.updateEnrolledPrograms() } }, diff --git a/erpnext/public/js/education/lms/pages/CoursePage.vue b/erpnext/public/js/education/lms/pages/CoursePage.vue index 22d51cd2c2..1f39b445da 100644 --- a/erpnext/public/js/education/lms/pages/CoursePage.vue +++ b/erpnext/public/js/education/lms/pages/CoursePage.vue @@ -35,20 +35,20 @@ export default { }, mounted() { this.getNextContent().then(data => { - this.nextContent = r.message.content, - this.nextContentType = r.message.content_type + this.nextContent = data.content, + this.nextContentType = data.content_type }); }, methods: { getNextContent(){ - return lms.call({ - method: "get_next_content", - args:{ + window.t = this + return lms.call("get_next_content", + { content: this.content, content_type: this.type, course: this.course } - }); + ); } }, components: {