diff options
author | ankitjavalkar | 2017-10-05 16:27:51 +0530 |
---|---|---|
committer | ankitjavalkar | 2017-10-05 16:27:51 +0530 |
commit | 2aa6ad38c89162eaef2e886947f9b7eabc4dfc4c (patch) | |
tree | 5518a1f47f550919ed8cf50d41b952ca597e6423 /yaksh/models.py | |
parent | 52bb77f0afeec8233702dd854e5a2aa81b89855d (diff) | |
download | online_test-2aa6ad38c89162eaef2e886947f9b7eabc4dfc4c.tar.gz online_test-2aa6ad38c89162eaef2e886947f9b7eabc4dfc4c.tar.bz2 online_test-2aa6ad38c89162eaef2e886947f9b7eabc4dfc4c.zip |
Allow user to quit the paper manually and revisit the paper if necessary
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 68bde48..906dd7e 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1170,6 +1170,7 @@ class AnswerPaper(models.Model): """Returns the current active question to display.""" if self.questions_unanswered.all(): return self.questions_unanswered.all()[0] + return self.questions.all()[0] def questions_left(self): """Returns the number of questions left.""" @@ -1199,8 +1200,6 @@ class AnswerPaper(models.Model): questions = list(all_questions.values_list('id', flat=True)) if len(questions) == 0: return None - if unanswered_questions.count() == 0: - return None try: index = questions.index(int(question_id)) next_id = questions[index+1] |