From b277f9191bf8720533901e58db36851675b8f430 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Fri, 3 Feb 2017 01:28:50 +0530 Subject: added skip question feature. closes #191 The can_skip_questions attribute is to be set True for students to be able to skip questions. If it is set as False, students wont be able to skip to the next question. --- yaksh/models.py | 4 ++++ yaksh/templates/exam.html | 4 ++++ yaksh/templates/yaksh/question.html | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'yaksh') diff --git a/yaksh/models.py b/yaksh/models.py index b917889..b2ba91f 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -580,6 +580,10 @@ class Quiz(models.Model): view_answerpaper = models.BooleanField('Allow student to view their answer\ paper', default=False) + can_skip_questions = models.BooleanField("Allow students to skip questions", + default=True + ) + objects = QuizManager() class Meta: diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html index 101f3f3..00633a3 100644 --- a/yaksh/templates/exam.html +++ b/yaksh/templates/exam.html @@ -31,6 +31,7 @@

Question Navigator

Question(s) left: {{ paper.questions_left }}

diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 41634f2..8fea8b3 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -199,14 +199,17 @@ function call_skip(url) {% else %}    {% endif %} + {% if paper.question_paper.quiz.can_skip_questions %} {% if paper.unanswered.all|length != 1 %} - {% endif %} + {% endif %} + {% endif %} + @@ -208,7 +207,6 @@ function call_skip(url) {% endif %} - {% endif %}