From bd2672ea701fb3f6270a3e7af41cc44568f7330b Mon Sep 17 00:00:00 2001 From: adityacp Date: Tue, 10 Apr 2018 17:54:49 +0530 Subject: Get answerpaper status for quiz completion --- yaksh/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yaksh') 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 -- cgit