summaryrefslogtreecommitdiff
path: root/testapp/exam/views.py
diff options
context:
space:
mode:
authorjayparikh1112012-02-16 15:37:20 +0530
committerjayparikh1112012-02-16 15:37:20 +0530
commit467adb5d403e7dd29a83f44d06c80cdca8b4e7a1 (patch)
treede464b59f977a212f233be4d39c9ff5e175631a9 /testapp/exam/views.py
parentc20539ed5f879c945cc89323e00daad96047d247 (diff)
downloadonline_test-467adb5d403e7dd29a83f44d06c80cdca8b4e7a1.tar.gz
online_test-467adb5d403e7dd29a83f44d06c80cdca8b4e7a1.tar.bz2
online_test-467adb5d403e7dd29a83f44d06c80cdca8b4e7a1.zip
Form to add New Quiz
Diffstat (limited to 'testapp/exam/views.py')
-rw-r--r--testapp/exam/views.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/testapp/exam/views.py b/testapp/exam/views.py
index 23534f5..1c5d2e5 100644
--- a/testapp/exam/views.py
+++ b/testapp/exam/views.py
@@ -109,24 +109,20 @@ def add_question(request):
context_instance=RequestContext(request))
def add_quiz(request):
-
if request.method == "POST":
form = QuizForm(request.POST)
if form.is_valid():
data = form.cleaned_data
- u_name, pwd = form.save()
-
- new_user = authenticate(username = u_name, password = pwd)
- login(request, new_user)
- return my_redirect("/exam/manage/add_quiz")
+ form.save()
+ return my_redirect("/exam/manage/addquiz")
else:
- return my_render_to_response('exam/add_quiz.html',
+ return my_render_to_response('exam/addquiz.html',
{'form':form},
context_instance=RequestContext(request))
else:
form = QuizForm()
- return my_render_to_response('exam/add_quiz.html',
+ return my_render_to_response('exam/addquiz.html',
{'form':form},
context_instance=RequestContext(request))