From 4f1dcbfb7829209116e01ad16409571707c46154 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 24 Feb 2025 19:15:26 +0530 Subject: [PATCH] feat: eval and certification flow with purchased certificate --- .../src/components/CertificationLinks.vue | 67 ++++++++++ frontend/src/components/CourseCardOverlay.vue | 45 +++---- .../src/components/Modals/EvaluationModal.vue | 5 + .../src/components/UpcomingEvaluations.vue | 10 +- frontend/src/pages/CourseCertification.vue | 118 +++++++++++++++++- frontend/src/pages/CourseForm.vue | 20 +-- frontend/src/pages/Lesson.vue | 41 +----- lms/lms/api.py | 18 +++ .../course_evaluator/course_evaluator.json | 2 +- .../course_evaluator/course_evaluator.py | 1 + lms/lms/doctype/lms_course/lms_course.json | 10 +- lms/lms/doctype/lms_course/lms_course.py | 5 + lms/lms/utils.py | 15 ++- 13 files changed, 277 insertions(+), 80 deletions(-) create mode 100644 frontend/src/components/CertificationLinks.vue diff --git a/frontend/src/components/CertificationLinks.vue b/frontend/src/components/CertificationLinks.vue new file mode 100644 index 00000000..1ddc22f4 --- /dev/null +++ b/frontend/src/components/CertificationLinks.vue @@ -0,0 +1,67 @@ + + diff --git a/frontend/src/components/CourseCardOverlay.vue b/frontend/src/components/CourseCardOverlay.vue index d34b3b54..63c2fc76 100644 --- a/frontend/src/components/CourseCardOverlay.vue +++ b/frontend/src/components/CourseCardOverlay.vue @@ -9,27 +9,29 @@
{{ course.data.price }}
- - - +
+ + + + +
{{ __('Upcoming Evaluations') }} - @@ -60,7 +66,7 @@
- {{ __('No upcoming evaluations.') }} + {{ __('Please schedule an evaluation to get certified.') }}
Course Certificate - + + diff --git a/frontend/src/pages/CourseForm.vue b/frontend/src/pages/CourseForm.vue index 6d62275a..eb7ff969 100644 --- a/frontend/src/pages/CourseForm.vue +++ b/frontend/src/pages/CourseForm.vue @@ -196,11 +196,11 @@ -
-
+
+
{{ __('Pricing and Certification') }}
-
+
- + +
@@ -299,6 +301,7 @@ const course = reactive({ disable_self_learning: false, enable_certification: false, paid_course: false, + paid_certificate: false, course_price: '', currency: '', }) @@ -394,6 +397,7 @@ const courseResource = createResource({ 'paid_course', 'featured', 'enable_certification', + 'paid_certifiate', ] for (let idx in checkboxes) { let key = checkboxes[idx] diff --git a/frontend/src/pages/Lesson.vue b/frontend/src/pages/Lesson.vue index 1ba06ede..fb65bc0d 100644 --- a/frontend/src/pages/Lesson.vue +++ b/frontend/src/pages/Lesson.vue @@ -4,45 +4,7 @@ class="sticky top-0 z-10 flex items-center justify-between border-b bg-surface-white px-3 py-2.5 sm:px-5" > -
- - - - - - -
+