summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorankitjavalkar2020-05-26 12:33:30 +0530
committerankitjavalkar2020-05-27 10:50:43 +0530
commitb3b450f7c575f9cf8ed9a8b12e495f4be0adc143 (patch)
treec7a77c9929ae967c2da82159c99f9f9fd3890eb9
parentbff6dc7a6234535df8143cd35fa455333a4eefab (diff)
downloadonline_test-b3b450f7c575f9cf8ed9a8b12e495f4be0adc143.tar.gz
online_test-b3b450f7c575f9cf8ed9a8b12e495f4be0adc143.tar.bz2
online_test-b3b450f7c575f9cf8ed9a8b12e495f4be0adc143.zip
Change condition and function name
-rw-r--r--yaksh/views.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index d8502a3..d034b9d 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -738,12 +738,11 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None,
question_paper=questionpaper_id,
course_id=course_id
)
- questionpaper = QuestionPaper.objects.get(id=questionpaper_id)
current_question = get_object_or_404(Question, pk=q_id)
if request.method == 'POST':
# Add the answer submitted, regardless of it being correct or not.
- if paper.time_left() <= 0 or not questionpaper.can_attempt_now(user, course_id)[0]:
+ if (paper.time_left() <= -10 or paper.status == "completed"):
reason = 'Your time is up!'
return complete(
request, reason, paper.attempt_number, paper.question_paper.id,