diff --git a/lms/hooks.py b/lms/hooks.py index b1f7ab2b..64cc885a 100644 --- a/lms/hooks.py +++ b/lms/hooks.py @@ -137,6 +137,8 @@ website_route_rules = [ {"from_route": "/courses//", "to_route": "courses/certificate"}, {"from_route": "/courses//learn", "to_route": "batch/learn"}, {"from_route": "/courses//learn/.", "to_route": "batch/learn"}, + {"from_route": "/courses/quiz-list", "to_route": "batch/quiz_list"}, + {"from_route": "/courses/quiz/", "to_route": "batch/quiz"}, {"from_route": "/courses//progress", "to_route": "batch/progress"}, {"from_route": "/courses//join", "to_route": "batch/join"}, {"from_route": "/courses//manage", "to_route": "cohorts"}, diff --git a/lms/lms/doctype/course_lesson/course_lesson.js b/lms/lms/doctype/course_lesson/course_lesson.js index 453aaa58..6b5464f3 100644 --- a/lms/lms/doctype/course_lesson/course_lesson.js +++ b/lms/lms/doctype/course_lesson/course_lesson.js @@ -2,103 +2,103 @@ // For license information, please see license.txt frappe.ui.form.on('Course Lesson', { - setup: function (frm) { - frm.trigger('setup_help'); - }, - setup_help(frm) { - frm.get_field('help').html(` -

You can add some more additional content to the lesson using a special syntax. The table below mentions all types of dynamic content that you can add to the lessons and the syntax for the same.

-
-
- Content Type -
-
- Syntax -
-
+ setup: function (frm) { + frm.trigger('setup_help'); + }, + setup_help(frm) { + frm.get_field('help').html(` +

${__("You can add some more additional content to the lesson using a special syntax. The table below mentions all types of dynamic content that you can add to the lessons and the syntax for the same.")}

+
+
+ ${__("Content Type")} +
+
+ ${__("Syntax")} +
+
-
-
- Video -
-
- {{ Video("url_of_source") }} -
-
+
+
+ ${__("Video")} +
+
+ {{ Video("url_of_source") }} +
+
-
-
- YouTube Video -
-
- {{ YouTubeVideo("unique_embed_id") }} -
-
+
+
+ ${__("YouTube Video")} +
+
+ {{ YouTubeVideo("unique_embed_id") }} +
+
-
-
- Exercise -
-
- {{ Exercise("exercise_name") }} -
-
+
+
+ ${"Exercise"} +
+
+ {{ Exercise("exercise_name") }} +
+
-
-
- Quiz -
-
- {{ Quiz("lms_quiz_name") }} -
-
+
+
+ ${__("Quiz")} +
+
+ {{ Quiz("lms_quiz_name") }} +
+
-
-
- Assignment -
-
- {{ Assignment("id-filetype") }} -
-
+
+
+ ${__("Assignment")} +
+
+ {{ Assignment("id-filetype") }} +
+
-
+
-
-
- Supported File Types for Assignment -
-
- Syntax -
-
+
+
+ ${__("Supported File Types for Assignment")} +
+
+ ${__("Syntax")} +
+
-
-
- .doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document -
-
- Document -
-
+
+
+ .doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document +
+
+ ${__("Document")} +
+
-
-
- .pdf -
-
- PDF -
-
+
+
+ .pdf +
+
+ ${__("PDF")} +
+
-
-
- .png, .jpg, .jpeg -
-
- Image -
-
-`); - } +
+
+ .png, .jpg, .jpeg +
+
+ ${__("Image")} +
+
+ `); + } }); diff --git a/lms/public/css/style.css b/lms/public/css/style.css index 6831e71a..d1665e34 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -1557,7 +1557,7 @@ li { margin-top: 0.25rem; background-color: var(--bg-light-gray); border-radius: var(--border-radius); - border: 1px dashed var(--gray-400); + border: 1px dashed var(--gray-600); padding: 0.5rem 0.75rem; width: fit-content; } @@ -1595,3 +1595,7 @@ li { align-items: center; font-size: var(--text-md); } + +.table { + margin-bottom: 0; +} diff --git a/lms/www/batch/learn.html b/lms/www/batch/learn.html index 95e1dc74..fc837fe5 100644 --- a/lms/www/batch/learn.html +++ b/lms/www/batch/learn.html @@ -120,7 +120,7 @@ {% else %}
-
{{ _("Start Learning") }}
+
{{ _("Start Learning") }}
{{ _("This lesson is not available for preview. Please join the course to access it.") }}
{% endif %} @@ -133,11 +133,13 @@ {% endmacro %} + + {% macro pagination(prev_url, next_url) %}
{% if prev_url %} - @@ -154,14 +156,14 @@
-
{{ _("Mark as Incomplete") }}
{% endif %}
{{ _("Create a Quiz") }}
@@ -192,7 +197,7 @@ 0 {{ _("attachments") }}
- + @@ -203,6 +208,51 @@
+ +{{ HelpArticle() }} +{% endmacro %} + + + +{% macro HelpArticle() %} +
+

{{ _("Help Article") }}

+

+ {{ _("You can add additional content to the lesson using a special syntax.The table below + mentions all types of dynamic content that you can add to the lessons and the syntax for the + same.") }} +

+ + + + + + + + + + + + + + + + + +
{{ _("Content Type") }} {{ _("Syntax") }}
+ {{ _("Video") }} + + {% raw %} {{ Video("url_of_source") }} {% endraw %} +
+ {{ _("YouTube Video") }} + + {% raw %} {{ YouTubeVideo("unique_embed_id") }} {% endraw %} +
+ {{ _("Quiz") }} + + {% raw %} {{ Quiz("lms_quiz_name") }} {% endraw %} +
+
{% endmacro %} diff --git a/lms/www/batch/learn.py b/lms/www/batch/learn.py index f1711869..4e705d17 100644 --- a/lms/www/batch/learn.py +++ b/lms/www/batch/learn.py @@ -56,7 +56,6 @@ def get_current_lesson_details(lesson_number, context): redirect_to_lesson(context.course) lesson_info = details_list[0] lesson_info.body = lesson_info.body.replace("\"", "'") - print(lesson_info) return lesson_info diff --git a/lms/www/batch/quiz.html b/lms/www/batch/quiz.html new file mode 100644 index 00000000..e69de29b diff --git a/lms/www/batch/quiz.py b/lms/www/batch/quiz.py new file mode 100644 index 00000000..e69de29b diff --git a/lms/www/batch/quiz_list.html b/lms/www/batch/quiz_list.html new file mode 100644 index 00000000..44bda479 --- /dev/null +++ b/lms/www/batch/quiz_list.html @@ -0,0 +1,36 @@ +{% extends "templates/base.html" %} +{% block title %} + {{ _("Quiz List") }} +{% endblock %} + + +{% block head_include %} + {% include "public/icons/symbol-defs.svg" %} +{% endblock %} + + +{% block content %} +
+
+ {{ _("Add Quiz") }} +
{{ _("Quiz List") }}
+
+ + + + + + {% for quiz in quiz_list %} + + + + + {% endfor %} +
{{ _("No.") }} {{ _("Quiz") }}
{{ loop.index }} + {{ quiz.name }} +
+
+
+
+{% endblock %} + diff --git a/lms/www/batch/quiz_list.py b/lms/www/batch/quiz_list.py new file mode 100644 index 00000000..5dbdca66 --- /dev/null +++ b/lms/www/batch/quiz_list.py @@ -0,0 +1,4 @@ +import frappe + +def get_context(context): + context.quiz_list = frappe.get_all("LMS Quiz", {"owner": frappe.session.user}, ["name", "title"])