feat: certificate evaluation

This commit is contained in:
Jannat Patel
2022-03-29 16:49:50 +05:30
parent b4eda0e7cd
commit ca5ea6032c
22 changed files with 420 additions and 10 deletions

View File

@@ -189,15 +189,21 @@
{% set certificate = is_certified(course.name) %}
{% set progress = frappe.utils.cint(membership.progress) %}
{% if membership and course.enable_certification %}
{% if certificate %}
<a class="button wide-button is-secondary mt-2" href="/courses/{{ course.name }}/{{ certificate }}">
{{ _("Get Certificate") }}
</a>
{% elif course.enable_certification and progress == 100 %}
{% elif course.grant_certificate_after == "Evaluation" %}
<a class="button wide-button is-secondary mt-2" href="/courses/{{ course.name }}/{{ certificate }}">
{{ _("Apply for Certificate") }}
</a>
{% elif progress == 100 %}
<div class="button wide-button is-secondary mt-4" id="certification" data-course="{{ course.name }}">
{{ _("Get Certificate") }}
</div>
{% endif %}
{% endif %}
</div>

View File

@@ -13,7 +13,7 @@ def get_context(context):
course = frappe.db.get_value("LMS Course", course_name,
["name", "title", "image", "short_introduction", "description", "published", "upcoming",
"disable_self_learning", "video_link", "enable_certification", "status"],
"disable_self_learning", "video_link", "enable_certification", "status", "grant_certificate_after"],
as_dict=True)
related_courses = frappe.get_all("Related Courses", {"parent": course.name}, ["course"])