summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorankitjavalkar2017-02-23 17:33:07 +0530
committerankitjavalkar2017-03-06 17:35:17 +0530
commit9484e8bebcd4363fa3aa1c2fc842de1bdcc25a10 (patch)
treeadffd3c180b6c2ea01841fbc6701d12a58caa6ed /yaksh/models.py
parentaede1c3736077387d63eacd20c2c39d8875e605d (diff)
downloadonline_test-9484e8bebcd4363fa3aa1c2fc842de1bdcc25a10.tar.gz
online_test-9484e8bebcd4363fa3aa1c2fc842de1bdcc25a10.tar.bz2
online_test-9484e8bebcd4363fa3aa1c2fc842de1bdcc25a10.zip
Allow revisiting all types of question to resubmit answer
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 2d84622..61c9059 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -988,7 +988,8 @@ class AnswerPaper(models.Model):
questions and returns the next question.
"""
next_question = self.next_question(question_id)
- self.questions_answered.add(question_id)
+ if question_id not in self.questions_answered.all():
+ self.questions_answered.add(question_id)
self.questions_unanswered.remove(question_id)
if next_question.id == int(question_id):
return None