summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorankitjavalkar2017-03-03 16:35:18 +0530
committerankitjavalkar2017-03-06 17:35:17 +0530
commitd0d4c9ab3a409c68766bc044825bf22b0519f6a3 (patch)
tree2204a5b84caa3db7595c9ad6341964166b146190 /yaksh/models.py
parent0f2a42799d3140de132c203cc255516caa69d617 (diff)
downloadonline_test-d0d4c9ab3a409c68766bc044825bf22b0519f6a3.tar.gz
online_test-d0d4c9ab3a409c68766bc044825bf22b0519f6a3.tar.bz2
online_test-d0d4c9ab3a409c68766bc044825bf22b0519f6a3.zip
Multiple changes:
- Fix movement from one question to another in next_question - Fix random display of errors from MCQs - Add Notification display if question has been attempted - Fix test cases for changes made
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index b80482c..f0f4ca6 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -1000,8 +1000,8 @@ class AnswerPaper(models.Model):
Skips the current question and returns the next sequentially
available question.
"""
- unanswered_questions = self.questions_unanswered.all()
- questions = list(unanswered_questions.values_list('id', flat=True))
+ all_questions = self.questions.all()
+ questions = list(all_questions.values_list('id', flat=True))
if len(questions) == 0:
return None
try:
@@ -1009,7 +1009,7 @@ class AnswerPaper(models.Model):
next_id = questions[index+1]
except (ValueError, IndexError):
next_id = questions[0]
- return unanswered_questions.get(id=next_id)
+ return all_questions.get(id=next_id)
def time_left(self):
"""Return the time remaining for the user in seconds."""