From 31336af1487201b05681c039c839a9213143fcf2 Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Tue, 12 Feb 2019 16:56:59 +0530 Subject: Fix download file for a question in quiz --- yaksh/models.py | 3 +++ yaksh/templates/yaksh/question.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'yaksh') diff --git a/yaksh/models.py b/yaksh/models.py index cce90e7..7b80306 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1408,6 +1408,9 @@ class FileUpload(models.Model): self.hide = True self.save() + def get_filename(self): + return os.path.basename(self.file.name) + ############################################################################### class Answer(models.Model): diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index da77702..3500132 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -160,7 +160,7 @@ question_type = "{{ question.type }}" Files to download for this question
{% for f_name in files %}
- {{forloop.counter}}. {{f_name.file.name}} + {{forloop.counter}}. {{f_name.get_filename}}
{% endfor %} -- cgit