summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorankitjavalkar2021-01-08 10:46:59 +0530
committerankitjavalkar2021-01-08 10:46:59 +0530
commit1e519cc43e39432b97cf4c053dff30df0f994145 (patch)
tree3911344f189185026947c8d87cb0fce3687c6d6c
parent30dd519ba7a5277348960a696f3a7cbd91f3f72f (diff)
downloadonline_test-1e519cc43e39432b97cf4c053dff30df0f994145.tar.gz
online_test-1e519cc43e39432b97cf4c053dff30df0f994145.tar.bz2
online_test-1e519cc43e39432b97cf4c053dff30df0f994145.zip
Add check in show_video.html template to ensure that questionpaper exists
-rw-r--r--yaksh/templates/yaksh/show_video.html18
1 files changed, 10 insertions, 8 deletions
diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html
index dde178b..faa7735 100644
--- a/yaksh/templates/yaksh/show_video.html
+++ b/yaksh/templates/yaksh/show_video.html
@@ -55,14 +55,16 @@
{% for unit in module.get_learning_units %}
{% get_unit_status course module unit user as status %}
{% if unit.type == "quiz" %}
- <a href="{% url 'yaksh:start_quiz' unit.quiz.questionpaper_set.get.id module.id course.id %}" class="list-group-item">
- {% if status == "completed" %}
- <i class="fa fa-check-square"></i>
- {% else %}
- <i class="fa fa-square-o"></i>
- {% endif %}
- {{ unit.quiz.description }}
- </a>
+ {% if unit.quiz.questionpaper_set.get.id %}
+ <a href="{% url 'yaksh:start_quiz' unit.quiz.questionpaper_set.get.id module.id course.id %}" class="list-group-item">
+ {% if status == "completed" %}
+ <i class="fa fa-check-square"></i>
+ {% else %}
+ <i class="fa fa-square-o"></i>
+ {% endif %}
+ {{ unit.quiz.description }}
+ </a>
+ {% endif %}
{% else %}
<a href="{% url 'yaksh:show_lesson' unit.lesson.id module.id course.id %}" class="list-group-item">
{% if status == "completed" %}