summaryrefslogtreecommitdiff
path: root/testapp/exam/views.py
diff options
context:
space:
mode:
authorjayparikh1112012-03-21 17:11:33 +0530
committerjayparikh1112012-03-21 17:11:33 +0530
commit2f21a4a007ae9b51fadd7832fe90506f19e309e2 (patch)
tree2e81dbcd1e8310b647edb1f7d7a6e09a021ed3f6 /testapp/exam/views.py
parente524bef336df95fd307d045af37c379bccf3ea14 (diff)
downloadonline_test-2f21a4a007ae9b51fadd7832fe90506f19e309e2.tar.gz
online_test-2f21a4a007ae9b51fadd7832fe90506f19e309e2.tar.bz2
online_test-2f21a4a007ae9b51fadd7832fe90506f19e309e2.zip
changes for adding tags in questions
Diffstat (limited to 'testapp/exam/views.py')
-rw-r--r--testapp/exam/views.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/testapp/exam/views.py b/testapp/exam/views.py
index 0504bde..7216f5b 100644
--- a/testapp/exam/views.py
+++ b/testapp/exam/views.py
@@ -153,8 +153,10 @@ def add_question(request,question_id=None):
form = QuestionForm(request.POST)
if form.is_valid():
data = form.cleaned_data
- if question_id == None:
+ if question_id == None:
form.save()
+ question = Question.objects.order_by("-id")[0]
+ question.tags.add(form['tags'].data)
return my_redirect("/exam/manage/questions")
else:
d = Question.objects.get(id=question_id)