diff options
author | Palaparthy Adityachandra | 2020-08-28 11:39:45 +0530 |
---|---|---|
committer | GitHub | 2020-08-28 11:39:45 +0530 |
commit | 052ac313e9f38e43cf16a3ae1f7f77cc58802529 (patch) | |
tree | a5a6bfd8bbdbdb358c8a8912261ab4e7407606c0 /yaksh/views.py | |
parent | 574e92a8586d4fc900be2c0d8f5114c93e826358 (diff) | |
parent | e3c3a0d9f7819f851890ea2611ba12b4f6255f06 (diff) | |
download | online_test-052ac313e9f38e43cf16a3ae1f7f77cc58802529.tar.gz online_test-052ac313e9f38e43cf16a3ae1f7f77cc58802529.tar.bz2 online_test-052ac313e9f38e43cf16a3ae1f7f77cc58802529.zip |
Merge pull request #748 from adityacp/multiple_fixes
Multiple changes
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 53981b5..2fe93ea 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -821,7 +821,7 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None, previous_question=current_question) else: user_answer = request.POST.get('answer') - if not user_answer: + if not str(user_answer): msg = "Please submit a valid answer." return show_question( request, current_question, paper, notification=msg, @@ -1491,6 +1491,12 @@ def design_questionpaper(request, course_id, quiz_id, questionpaper_id=None): random_set.questions.add(*random_ques) question_paper.random_questions.add(random_set) messages.success(request, "Questions removed successfully") + return redirect( + 'yaksh:designquestionpaper', + course_id=course_id, + quiz_id=quiz_id, + questionpaper_id=questionpaper_id + ) else: messages.warning(request, "Please select atleast one question") @@ -1499,6 +1505,12 @@ def design_questionpaper(request, course_id, quiz_id, questionpaper_id=None): if random_set_ids: question_paper.random_questions.remove(*random_set_ids) messages.success(request, "Questions removed successfully") + return redirect( + 'yaksh:designquestionpaper', + course_id=course_id, + quiz_id=quiz_id, + questionpaper_id=questionpaper_id + ) else: messages.warning(request, "Please select question set") |