From 2d1b8eb907c7e142d4e3c76e43707fb9f82d6683 Mon Sep 17 00:00:00 2001 From: adityacp Date: Mon, 7 Sep 2020 13:43:09 +0530 Subject: Show the lesson contents on student interface --- yaksh/static/yaksh/css/custom.css | 16 +++++ yaksh/static/yaksh/js/lesson.js | 1 + yaksh/templates/yaksh/show_video.html | 117 +++++++++++++++++++++++++--------- yaksh/views.py | 1 - 4 files changed, 105 insertions(+), 30 deletions(-) (limited to 'yaksh') diff --git a/yaksh/static/yaksh/css/custom.css b/yaksh/static/yaksh/css/custom.css index b737090..a3d5c79 100644 --- a/yaksh/static/yaksh/css/custom.css +++ b/yaksh/static/yaksh/css/custom.css @@ -145,3 +145,19 @@ body, .dropdown-menu { .CodeMirror-fullscreen .CodeMirror-scroll { max-height: none !important; } + +::-webkit-scrollbar { + width: 10px; +} + +::-webkit-scrollbar { + // Width of vertical scroll bar + width: 8px; + // Height of horizontal scroll bar + height: 10px; + +} +::-webkit-scrollbar-thumb { +border-radius: 8px; +background: #c2c9d2; +} \ No newline at end of file diff --git a/yaksh/static/yaksh/js/lesson.js b/yaksh/static/yaksh/js/lesson.js index 92038c9..0558bd0 100644 --- a/yaksh/static/yaksh/js/lesson.js +++ b/yaksh/static/yaksh/js/lesson.js @@ -1,6 +1,7 @@ $(document).ready(function() { var simplemde = new SimpleMDE({ element: document.getElementById("id_description"), + forceSync: true, }); const player = new Plyr('#player'); var timer = $("#vtimer"); diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html index 236f8ef..4c54518 100644 --- a/yaksh/templates/yaksh/show_video.html +++ b/yaksh/templates/yaksh/show_video.html @@ -4,6 +4,8 @@ {% block title %} {{ learning_module.name }} {% endblock %} {% block script %} + {% endblock %} @@ -127,37 +129,94 @@ {% endif %} {% else %} -
- {{lesson.html_data|safe}} -
-
- -
- - Next  - -
-
-
- {% with lesson.get_files as lesson_files %} - {% if lesson_files %} -
-
- Files for this lesson -
-
- {% for f in lesson_files %} - - {{forloop.counter}}.{{ f.file.name|file_title }} - - {% endfor %} + +
+
+
+ {% if lesson.video_path %} + {% with lesson.video_path|video_name as video %} + {% if video.1 == "others" %} + + {% else %} +
+ {% endif %} + {% endwith %} +
+ + Next  + + {% endif %} +
+
+
+
+ +
+
+ + {% for content in toc %} + {% with content.get_toc_text as toc_name %} + + + + + + {% endwith %} + {% empty %} +
+ No Table of contents added +
+ {% endfor %} +
+ {{ toc_name }} + + {{content.get_content_display}} + + {{content.time}} +
- {% endif %} - {% endwith %} +
+
+
+
+

Lesson Description

+
+
+ {{lesson.html_data|safe}} +
+
+ {% if not lesson.video_path %} + + Next  + +
+ {% endif %} +
+ {% with lesson.get_files as lesson_files %} + {% if lesson_files %} +
+
+ Files for this lesson +
+
+ {% for f in lesson_files %} + + {{forloop.counter}}.{{ f.file.name|file_title }} + + {% endfor %} +
+
+ {% endif %} + {% endwith %} +
+
{% endif %}
diff --git a/yaksh/views.py b/yaksh/views.py index 60d72e9..fffefe8 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2689,7 +2689,6 @@ def show_lesson(request, lesson_id, module_id, course_id): toc = TableOfContents.objects.filter( course_id=course_id, lesson_id=lesson_id ) - all_modules = course.get_learning_modules() if learn_unit.has_prerequisite(): if not learn_unit.is_prerequisite_complete(user, learn_module, course): -- cgit