summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authoradityacp2018-04-10 17:54:49 +0530
committeradityacp2018-04-10 17:54:49 +0530
commitbd2672ea701fb3f6270a3e7af41cc44568f7330b (patch)
tree3ee12ab5c79f6b270d8b9ea4df4b68dfe5136793 /yaksh/models.py
parent9d2522d80f6ddc5e234593c3dc864dd84e91f51f (diff)
downloadonline_test-bd2672ea701fb3f6270a3e7af41cc44568f7330b.tar.gz
online_test-bd2672ea701fb3f6270a3e7af41cc44568f7330b.tar.bz2
online_test-bd2672ea701fb3f6270a3e7af41cc44568f7330b.zip
Get answerpaper status for quiz completion
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index b13e19c..ecf7035 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -390,9 +390,9 @@ class Quiz(models.Model):
qp = None
ans_ppr = AnswerPaper.objects.filter(
user=user, course=course, question_paper=qp
- )
+ ).order_by("-attempt_number")
if ans_ppr.exists():
- status = "completed"
+ status = ans_ppr.first().status
else:
status = "not attempted"
return status