summaryrefslogtreecommitdiff
path: root/testapp/exam/forms.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2014-06-05 17:56:34 +0530
committerPrabhu Ramachandran2014-06-05 17:56:34 +0530
commit69c114dde3df17a8fd688809beee262f9c274a8d (patch)
tree8f385a3e36fc86b9237107f67122362c49220082 /testapp/exam/forms.py
parent3d0b69caf6b94a1afe95fef2787929c14afdb485 (diff)
parent18cd0fa1def34bb320f38062596789f745bee530 (diff)
downloadonline_test-69c114dde3df17a8fd688809beee262f9c274a8d.tar.gz
online_test-69c114dde3df17a8fd688809beee262f9c274a8d.tar.bz2
online_test-69c114dde3df17a8fd688809beee262f9c274a8d.zip
Merge pull request #16 from prathamesh920/deploy_server
Deploy server
Diffstat (limited to 'testapp/exam/forms.py')
-rw-r--r--testapp/exam/forms.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py
index 8506de2..d711f6a 100644
--- a/testapp/exam/forms.py
+++ b/testapp/exam/forms.py
@@ -13,12 +13,12 @@ from string import letters, punctuation, digits
import datetime
QUESTION_TYPE_CHOICES = (
- ("python", "Python"),
- ("bash", "Bash"),
- ("mcq", "MCQ"),
- ("C", "C Language"),
- ("C++", "C++ Language"),
- ("java", "Java Language"),
+ ("python", "Python"),
+ ("bash", "Bash"),
+ ("mcq", "MCQ"),
+ ("C", "C Language"),
+ ("C++", "C++ Language"),
+ ("java", "Java Language"),
)
UNAME_CHARS = letters + "._" + digits
@@ -30,8 +30,7 @@ class UserRegisterForm(forms.Form):
It has the various fields and functions required to register
a new user to the system"""
- username = forms.CharField\
- (max_length=30, help_text='Letters, digits,\
+ username = forms.CharField(max_length=30, help_text='Letters, digits,\
period and underscores only.')
email = forms.EmailField()
password = forms.CharField(max_length=30, widget=forms.PasswordInput())
@@ -167,6 +166,7 @@ class QuestionForm(forms.Form):
options = self.cleaned_data['options']
type = self.cleaned_data["type"]
active = self.cleaned_data["active"]
+ snippet = self.cleaned_data["snippet"]
new_question = Question()
new_question.summary = summary
@@ -176,4 +176,5 @@ class QuestionForm(forms.Form):
new_question.options = options
new_question.type = type
new_question.active = active
+ new_question.snippet = snippet
new_question.save()