summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCruiseDevice2019-07-03 17:31:38 +0530
committerCruiseDevice2019-07-03 17:32:55 +0530
commit745426ecc20bba58fd3721a960057ad8d41e3b99 (patch)
treeea74521ca77df859493cfcc1bd60f493dfab7311
parentdbe52125fd83370dea94ac9c8d870f572f0a14a7 (diff)
downloadonline_test-745426ecc20bba58fd3721a960057ad8d41e3b99.tar.gz
online_test-745426ecc20bba58fd3721a960057ad8d41e3b99.tar.bz2
online_test-745426ecc20bba58fd3721a960057ad8d41e3b99.zip
Minor changes
- Remove commented code. - Add active class to the tab selected on sidebar.
-rw-r--r--yaksh/models.py10
-rw-r--r--yaksh/templates/yaksh/quiz.html4
-rw-r--r--yaksh/templates/yaksh/unit.html4
-rw-r--r--yaksh/views.py1
4 files changed, 4 insertions, 15 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 24cb996..2ae6f45 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -575,16 +575,6 @@ class Quiz(models.Model):
sub_folder_name = os.sep.join((
course_name, module_name, quiz_name
))
- # lesson_files = self.get_files()
- # if self.video_file:
- # video_file = os.sep.join((sub_folder_name, os.path.basename(
- # self.video_file.name)))
- # zip_file.writestr(video_file, self.video_file.read())
- # for lesson_file in lesson_files:
- # if os.path.exists(lesson_file.file.path):
- # filename = os.sep.join((sub_folder_name, os.path.basename(
- # lesson_file.file.name)))
- # zip_file.writestr(filename, lesson_file.file.read())
unit_file_path = os.sep.join((
path, "templates", "yaksh", "quiz.html"
))
diff --git a/yaksh/templates/yaksh/quiz.html b/yaksh/templates/yaksh/quiz.html
index fca0cad..3240244 100644
--- a/yaksh/templates/yaksh/quiz.html
+++ b/yaksh/templates/yaksh/quiz.html
@@ -38,13 +38,13 @@
{% for unit in module.get_learning_units %}
{% if unit.type == 'lesson' %}
<li class="nav-item">
- <a class="nav-link" href="../{{unit.lesson.name|replace_spaces}}/{{unit.lesson.name|replace_spaces}}.html">
+ <a class="nav-link {% if unit.lesson.name == lesson.name %}active{% endif %}" href="../{{unit.lesson.name|replace_spaces}}/{{unit.lesson.name|replace_spaces}}.html">
{{unit.lesson.name}}
</a>
</li>
{% else %}
<li class="nav-item">
- <a class="nav-link" href="../{{unit.quiz.description|replace_spaces}}/{{unit.quiz.description|replace_spaces}}.html">
+ <a class="nav-link {% if unit.lesson.name == lesson.name %}active{% endif %}" href="../{{unit.quiz.description|replace_spaces}}/{{unit.quiz.description|replace_spaces}}.html">
{{unit.quiz.description}}
</a>
</li>
diff --git a/yaksh/templates/yaksh/unit.html b/yaksh/templates/yaksh/unit.html
index 1ceffe8..45092a6 100644
--- a/yaksh/templates/yaksh/unit.html
+++ b/yaksh/templates/yaksh/unit.html
@@ -38,13 +38,13 @@
{% for unit in module.get_learning_units %}
{% if unit.type == 'lesson' %}
<li class="nav-item">
- <a class="nav-link" href="../{{unit.lesson.name|replace_spaces}}/{{unit.lesson.name|replace_spaces}}.html">
+ <a class="nav-link {% if unit.lesson.name == lesson.name %}active{% endif %}" href="../{{unit.lesson.name|replace_spaces}}/{{unit.lesson.name|replace_spaces}}.html">
{{unit.lesson.name}}
</a>
</li>
{% else %}
<li class="nav-item">
- <a class="nav-link" href="../{{unit.quiz.description|replace_spaces}}/{{unit.quiz.description|replace_spaces}}.html">
+ <a class="nav-link {% if unit.lesson.name == lesson.name %}active{% endif %}" href="../{{unit.quiz.description|replace_spaces}}/{{unit.quiz.description|replace_spaces}}.html">
{{unit.quiz.description}}
</a>
</li>
diff --git a/yaksh/views.py b/yaksh/views.py
index 319acde..5f0c41c 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -2954,4 +2954,3 @@ def download_course(request, course_id):
)
response.write(zip_file.read())
return response
- # return HttpResponse("Success") \ No newline at end of file