summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2018-05-09 19:19:29 +0530
committerGitHub2018-05-09 19:19:29 +0530
commit31764f78f091122a745a7da2d98e18160cb35eba (patch)
tree7ad6bca66e23ab3c18ea41bfa68e128c38936cbc /yaksh/views.py
parenta7b0c232991208625564f76a56d078e9391c5cb2 (diff)
parentf5fa97802447808744cfc591cc3855a9b57e6d32 (diff)
downloadonline_test-31764f78f091122a745a7da2d98e18160cb35eba.tar.gz
online_test-31764f78f091122a745a7da2d98e18160cb35eba.tar.bz2
online_test-31764f78f091122a745a7da2d98e18160cb35eba.zip
Merge pull request #460 from ankitjavalkar/fix-attempt-error-msg
Display appropriate error when time between attempts condition is not satisfied
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 1cb77fc..5ebe0b5 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -534,9 +534,8 @@ def start(request, questionpaper_id=None, attempt_num=None, course_id=None,
previous_question=last_attempt.current_question()
)
# allowed to start
- if not quest_paper.can_attempt_now(user, course_id):
- msg = "You cannot attempt {0} quiz more than {1} time(s)".format(
- quest_paper.quiz.description, quest_paper.quiz.attempts_allowed)
+ if not quest_paper.can_attempt_now(user, course_id)[0]:
+ msg = quest_paper.can_attempt_now(user, course_id)[1]
if is_moderator(user):
return prof_manage(request, msg=msg)
return view_module(request, module_id=module_id, course_id=course_id,