diff options
author | ankitjavalkar | 2018-03-20 15:26:22 +0530 |
---|---|---|
committer | ankitjavalkar | 2018-04-17 15:28:35 +0530 |
commit | e97249a733a8d915bc50228867ae6ad633d77ae6 (patch) | |
tree | c4e738345344379e6462fafa46de8e2c17f73d04 /yaksh/views.py | |
parent | a7b0c232991208625564f76a56d078e9391c5cb2 (diff) | |
download | online_test-e97249a733a8d915bc50228867ae6ad633d77ae6.tar.gz online_test-e97249a733a8d915bc50228867ae6ad633d77ae6.tar.bz2 online_test-e97249a733a8d915bc50228867ae6ad633d77ae6.zip |
Multiple changes in models
- Add error message to can_attempt_now Questionpaper model method
- Add default value to Quiz time_between_attempt field
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 1cb77fc..dd62ec5 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -534,9 +534,10 @@ 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 = "You cannot attempt {0} quiz more than {1} time(s)".format( + # quest_paper.quiz.description, quest_paper.quiz.attempts_allowed) + 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, |