From 39aa1d443df846f32ddf602895f6e4baff1ee8b0 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 19 Feb 2024 17:07:22 +0530 Subject: [PATCH 1/3] fix: removed unnecessary start learning buttons --- lms/lms/widgets/NoPreviewModal.html | 4 ---- lms/templates/reviews_cta.html | 4 ---- 2 files changed, 8 deletions(-) diff --git a/lms/lms/widgets/NoPreviewModal.html b/lms/lms/widgets/NoPreviewModal.html index c6f06aa5..a82fded4 100644 --- a/lms/lms/widgets/NoPreviewModal.html +++ b/lms/lms/widgets/NoPreviewModal.html @@ -29,10 +29,6 @@ - {% elif show_start_learing_cta(course, membership) %} - {% endif %} {% endif %} diff --git a/lms/templates/reviews_cta.html b/lms/templates/reviews_cta.html index dfb06f44..85def038 100644 --- a/lms/templates/reviews_cta.html +++ b/lms/templates/reviews_cta.html @@ -6,8 +6,4 @@ {{ _("Write a review") }} -{% elif show_start_learing_cta(course, membership) %} -
- {{ _("Start Learning") }} -
{% endif %} From a5d000f70271330ef4d3f3779b19305522848640 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 21 Feb 2024 17:02:18 +0530 Subject: [PATCH 2/3] fix: quix show correct answers --- lms/lms/doctype/lms_quiz/lms_quiz.py | 2 ++ lms/templates/quiz/quiz.js | 4 +++- lms/www/batches/batch.js | 11 ++++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lms/lms/doctype/lms_quiz/lms_quiz.py b/lms/lms/doctype/lms_quiz/lms_quiz.py index 80f0ab46..9dc10fa8 100644 --- a/lms/lms/doctype/lms_quiz/lms_quiz.py +++ b/lms/lms/doctype/lms_quiz/lms_quiz.py @@ -270,6 +270,8 @@ def check_choice_answers(question, answers): for num in range(1, 5): if question_details[f"option_{num}"] in answers: is_correct.append(question_details[f"is_correct_{num}"]) + elif question_details[f"is_correct_{num}"]: + is_correct.append(2) else: is_correct.append(0) diff --git a/lms/templates/quiz/quiz.js b/lms/templates/quiz/quiz.js index d7b891b6..810bac4d 100644 --- a/lms/templates/quiz/quiz.js +++ b/lms/templates/quiz/quiz.js @@ -239,7 +239,9 @@ const parse_choices = (element, is_correct) => { ? add_icon(elem, "check") : add_icon(elem, "wrong"); } else { - add_icon(elem, "minus-circle"); + if (this.show_answers && is_correct[i] == 2) + add_icon(elem, "minus-circle-green"); + else add_icon(elem, "minus-circle"); } }); }; diff --git a/lms/www/batches/batch.js b/lms/www/batches/batch.js index 3ac054d2..6e27ca10 100644 --- a/lms/www/batches/batch.js +++ b/lms/www/batches/batch.js @@ -711,9 +711,14 @@ const get_calendar_options = (element, calendar_id) => { event.start.d.d )} - ${frappe.datetime.get_time(event.end.d.d)}"> -
${frappe.datetime.get_time(event.start.d.d)} - - ${frappe.datetime.get_time(event.end.d.d)}
-
${event.title}
+
+ ${event.title} + + ${frappe.datetime.get_time(event.start.d.d)} - ${frappe.datetime.get_time( + event.end.d.d + )} + +
`; }, }, From 4cc27adb8bb334100bfeff28763b78780ed65a72 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 7 Mar 2024 10:21:18 +0530 Subject: [PATCH 3/3] fix: batch registration button conditions --- lms/www/batches/batch_details.html | 394 +++++++++++++---------------- 1 file changed, 181 insertions(+), 213 deletions(-) diff --git a/lms/www/batches/batch_details.html b/lms/www/batches/batch_details.html index bf24e971..41ed8a3a 100644 --- a/lms/www/batches/batch_details.html +++ b/lms/www/batches/batch_details.html @@ -1,246 +1,214 @@ -{% extends "lms/templates/lms_base.html" %} -{% block title %} - {{ _(batch_info.title) }} -{% endblock %} - - -{% block page_content %} +{% extends "lms/templates/lms_base.html" %} {% block title %} {{ +_(batch_info.title) }} {% endblock %} {% block page_content %}
- {{ BatchHeader(batch_info) }} + {{ BatchHeader(batch_info) }}
- {{ BatchOverlay(batch_info, courses, students) }} -
- {{ BatchDetails(batch_info) }} - {{ CourseList(courses) }} -
+ {{ BatchOverlay(batch_info, courses, students) }} +
+ {{ BatchDetails(batch_info) }} {{ CourseList(courses) }} +
- {{ BatchDetailsRaw() }} + {{ BatchDetailsRaw() }}
-{% endblock %} - -{% macro BatchHeader(batch_info) %} +{% endblock %} {% macro BatchHeader(batch_info) %}
-
-
- {{ BreadCrumb(batch_info) }} - {{ BatchHeaderDetails(batch_info, courses, students) }} -
-
+
+
+ {{ BreadCrumb(batch_info) }} {{ BatchHeaderDetails(batch_info, + courses, students) }} +
+
-{% endmacro %} - -{% macro BreadCrumb(batch_info) %} +{% endmacro %} {% macro BreadCrumb(batch_info) %} -{% endmacro %} +{% endmacro %} {% macro BatchHeaderDetails(batch_info, courses, students) %} +
+
{{ batch_info.title }}
-{% macro BatchHeaderDetails(batch_info, courses, students) %} -
+
{{ batch_info.description }}
-
- {{ batch_info.title }} -
+
+ + + + + {{ frappe.utils.format_date(batch_info.start_date, "long") }} + + {% if batch_info.start_date != batch_info.end_date %} + + - {{ frappe.utils.format_date(batch_info.end_date, "long") }} + + {% endif %} +
-
- {{ batch_info.description }} -
- -
- - - - - {{ frappe.utils.format_date(batch_info.start_date, "long") }} - - {% if batch_info.start_date != batch_info.end_date %} - - - {{ frappe.utils.format_date(batch_info.end_date, "long") }} - - {% endif %} -
- - {% if batch_info.start_time and batch_info.end_time %} -
- - - - - {{ frappe.utils.format_time(batch_info.start_time, "hh:mm a") }} - - - - {{ frappe.utils.format_time(batch_info.end_time, "hh:mm a") }} - -
- {% endif %} -
-{% endmacro %} - -{% macro BatchOverlay(batch_info, courses, students) %} + {% if batch_info.start_time and batch_info.end_time %} +
+ + + + + {{ frappe.utils.format_time(batch_info.start_time, "hh:mm a") }} - + + + {{ frappe.utils.format_time(batch_info.end_time, "hh:mm a") }} + +
+ {% endif %} +
+{% endmacro %} {% macro BatchOverlay(batch_info, courses, students) %}
+
+ {% if batch_info.seat_count %} {% if seats_left %} +
+ {{ _("Seats Available") }}: {{ seats_left }} +
+ {% else %} +
+ {{ _("No seats left") }} +
+ {% endif %} {% endif %} {% if batch_info.paid_batch %} +
+ {{ frappe.utils.fmt_money(batch_info.amount, 0, batch_info.currency) + }} +
+ {% endif %} -
+
+ + + + {{ courses | length }} {{ _("Courses") }} +
- {% if batch_info.seat_count %} - {% if seats_left %} -
- {{ _("Seats Available") }}: {{ seats_left }} -
- {% else %} -
- {{ _("No seats left") }} -
- {% endif %} - {% endif %} - - {% if batch_info.paid_batch %} -
- {{ frappe.utils.fmt_money(batch_info.amount, 0, batch_info.currency) }} -
- {% endif %} - -
- - - - {{ courses | length }} {{ _("Courses") }} -
- -
- - - - - {{ frappe.utils.format_date(batch_info.start_date, "long") }} - +
+ + + + + {{ frappe.utils.format_date(batch_info.start_date, "long") }} + {% if batch_info.start_date != batch_info.end_date %} - {{ frappe.utils.format_date(batch_info.end_date, "long") }} {% endif %} -
+
- {% if batch_info.start_time and batch_info.end_time %} -
- - - - - {{ frappe.utils.format_time(batch_info.start_time, "hh:mm a") }} - - - - {{ frappe.utils.format_time(batch_info.end_time, "hh:mm a") }} - -
- {% endif %} + {% if batch_info.start_time and batch_info.end_time %} +
+ + + + + {{ frappe.utils.format_time(batch_info.start_time, "hh:mm a") }} + - + + + {{ frappe.utils.format_time(batch_info.end_time, "hh:mm a") }} + +
+ {% endif %} -
- {% if is_moderator or is_evaluator %} - - {{ _("Manage Batch") }} - - {% elif batch_info.paid_batch %} - - {{ _("Register Now") }} - - {% elif batch_info.allow_self_enrollment and batch_info.seat_count and seats_left %} - - {% else %} -
- {{ _("To join this batch, please contact the Administrator.") }} -
- {% endif %} -
- {% if is_moderator %} -
-
- {{ _("Edit") }} -
-
- {% endif %} -
+
+ {% if is_moderator or is_evaluator %} + + {{ _("Manage Batch") }} + + {% elif batch_info.paid_batch and batch_info.start_date > + frappe.utils.getdate() %} + + {{ _("Register Now") }} + + {% elif batch_info.allow_self_enrollment and batch_info.seat_count + and seats_left and batch_info.start_date > frappe.utils.getdate() %} + + {% else %} +
+ {{ _("To join this batch, please contact the Administrator.") }} +
+ {% endif %} +
+ {% if is_moderator %} +
+
+ {{ _("Edit") }} +
+
+ {% endif %} +
-{% endmacro %} - - -{% macro BatchDetails(batch_info) %} -
- {{ batch_info.batch_details }} -
-{% endmacro %} - - -{% macro CourseList(courses) %} -{% if courses | length or is_moderator %} +{% endmacro %} {% macro BatchDetails(batch_info) %} +
{{ batch_info.batch_details }}
+{% endmacro %} {% macro CourseList(courses) %} {% if courses | length or +is_moderator %}
+
+
{{ _("Courses") }}
+ {% if is_moderator %} + + {% endif %} +
-
-
- {{ _("Courses") }} -
- {% if is_moderator %} - - {% endif %} -
- - {% if courses | length %} + {% if courses | length %}
{% for course in courses %}
- {% if is_moderator %} -
- - -
- {% endif %} - {{ widgets.CourseCard(course=course, read_only=False) }} + {% if is_moderator %} +
+ + +
+ {% endif %} {{ widgets.CourseCard(course=course, read_only=False) }}
{% endfor %}
{% else %} -
- {{ _("No courses") }} -
+
{{ _("No courses") }}
{% endif %}
-{% endif %} -{% endmacro %} - - -{% macro BatchDetailsRaw() %} - {% if batch_info.batch_details_raw %} -
- {{ batch_info.batch_details_raw }} -
- {% endif %} -{% endmacro %} - -{%- block script %} - {{ super() }} - {% if is_moderator %} - - {% endif %} -{% endblock %} +{% endif %} {% endmacro %} {% macro BatchDetailsRaw() %} {% if +batch_info.batch_details_raw %} +
{{ batch_info.batch_details_raw }}
+{% endif %} {% endmacro %} {%- block script %} {{ super() }} {% if is_moderator +%} + +{% endif %} {% endblock %}