summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorankitjavalkar2019-08-19 12:51:39 +0530
committerankitjavalkar2019-08-19 12:51:39 +0530
commit52abccc4ca76c6f95bf41a7d1fc0b5ae258f5328 (patch)
tree922a2617ea92188acdb3425626fc0398b35f66d2 /yaksh/models.py
parentf977eb246efd835d041837378bb13778ae3037f9 (diff)
downloadonline_test-52abccc4ca76c6f95bf41a7d1fc0b5ae258f5328.tar.gz
online_test-52abccc4ca76c6f95bf41a7d1fc0b5ae258f5328.tar.bz2
online_test-52abccc4ca76c6f95bf41a7d1fc0b5ae258f5328.zip
Move all download related templates to a new subfolder and add homepage link to navbar logo
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index c97a616..6881b4f 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -316,7 +316,7 @@ class Lesson(models.Model):
lesson_file.file.name)))
zip_file.writestr(filename, lesson_file.file.read())
unit_file_path = os.sep.join((
- path, "templates", "yaksh", "unit.html"
+ path, "templates", "yaksh", "download_course_templates", "unit.html"
))
lesson_data = {"course": course, "module": module,
"lesson": self, "next_unit": next_unit,
@@ -576,7 +576,7 @@ class Quiz(models.Model):
course_name, module_name, quiz_name
))
unit_file_path = os.sep.join((
- path, "templates", "yaksh", "quiz.html"
+ path, "templates", "yaksh", "download_course_templates", "quiz.html"
))
quiz_data = {"course": course, "module": module,
"quiz": self, "next_unit": next_unit}
@@ -812,7 +812,7 @@ class LearningModule(models.Model):
path)
module_file_path = os.sep.join((
- path, "templates", "yaksh", "module.html"
+ path, "templates", "yaksh", "download_course_templates", "module.html"
))
module_data = {"course": course, "module": self, "units": units}
write_templates_to_zip(zip_file, module_file_path, module_data,
@@ -1079,7 +1079,12 @@ class Course(models.Model):
with zipfile.ZipFile(zip_file_name, "a") as zip_file:
course_name = self.name.replace(" ", "_")
modules = self.get_learning_modules()
- file_path = os.sep.join((path, "templates", "yaksh", "index.html"))
+ file_path = os.sep.join(
+ (
+ path, "templates", "yaksh",
+ "download_course_templates", "index.html"
+ )
+ )
write_static_files_to_zip(zip_file, course_name, path,
static_files)
course_data = {"course": self, "modules": modules}