summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorKing2017-10-05 01:05:42 +0530
committerGitHub2017-10-05 01:05:42 +0530
commit8ea7f10a84af44af37a5478c389fa040723542ec (patch)
tree8297fede9858d232cef15d0ec8a818079c166e99 /yaksh/models.py
parent73e6ff974c1bb5bf6c96b73c2eeacdf074e2e8f4 (diff)
downloadonline_test-8ea7f10a84af44af37a5478c389fa040723542ec.tar.gz
online_test-8ea7f10a84af44af37a5478c389fa040723542ec.tar.bz2
online_test-8ea7f10a84af44af37a5478c389fa040723542ec.zip
Will return the last answer submitted
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 92076ab..68bde48 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -1285,7 +1285,7 @@ class AnswerPaper(models.Model):
return q_a
def get_latest_answer(self, question_id):
- return self.answers.filter(question=question_id).order_by("-id").last()
+ return self.answers.filter(question=question_id).order_by("id").last()
def get_questions(self):
return self.questions.filter(active=True)