summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
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(