summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authoradityacp2020-08-28 10:52:51 +0530
committeradityacp2020-08-28 10:52:51 +0530
commit620df8d25a82ceb99eb7cd17535c20998e212191 (patch)
tree8202f64768c4589afba97094c6ccf966750d310d /yaksh/views.py
parentebe75b31c225eaa71d6963b8ac493e37a63efb50 (diff)
parent574e92a8586d4fc900be2c0d8f5114c93e826358 (diff)
downloadonline_test-620df8d25a82ceb99eb7cd17535c20998e212191.tar.gz
online_test-620df8d25a82ceb99eb7cd17535c20998e212191.tar.bz2
online_test-620df8d25a82ceb99eb7cd17535c20998e212191.zip
Merge branch 'master' of https://github.com/FOSSEE/online_test into multiple_fixes
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index c1798b5..afa673f 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1446,6 +1446,13 @@ def design_questionpaper(request, course_id, quiz_id, questionpaper_id=None):
question_paper.save()
question_paper.fixed_questions.add(*questions)
messages.success(request, "Questions added 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")
@@ -1464,6 +1471,12 @@ def design_questionpaper(request, course_id, quiz_id, questionpaper_id=None):
question_paper.save()
question_paper.fixed_questions.remove(*question_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 atleast one question")
@@ -2411,8 +2424,10 @@ def _read_user_csv(request, reader, course):
messages.info(request, "{0} -- Missing Values".format(counter))
continue
users = User.objects.filter(username=username)
+ if not users.exists():
+ users = User.objects.filter(email=email)
if users.exists():
- user = users[0]
+ user = users.last()
if remove.strip().lower() == 'true':
_remove_from_course(user, course)
messages.info(request, "{0} -- {1} -- User rejected".format(