diff options
author | jayparikh111 | 2012-02-16 13:02:49 +0530 |
---|---|---|
committer | jayparikh111 | 2012-02-16 13:02:49 +0530 |
commit | c20539ed5f879c945cc89323e00daad96047d247 (patch) | |
tree | 928b82fef403682ebc12251865d47441bd57b41c /testapp/exam/forms.py | |
parent | d18df85469fc993520ee397f4a28b422c550408a (diff) | |
download | online_test-c20539ed5f879c945cc89323e00daad96047d247.tar.gz online_test-c20539ed5f879c945cc89323e00daad96047d247.tar.bz2 online_test-c20539ed5f879c945cc89323e00daad96047d247.zip |
Form to add New Question
Diffstat (limited to 'testapp/exam/forms.py')
-rw-r--r-- | testapp/exam/forms.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index a867f5f..6d431e7 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -6,6 +6,13 @@ from django.contrib.auth.models import User from string import letters, punctuation, digits import datetime + +QUESTION_TYPE_CHOICES = ( + ("python", "Python"), + ("bash", "Bash"), + ("mcq", "MultipleChoice"), + ) + UNAME_CHARS = letters + "._" + digits PWD_CHARS = letters + punctuation + digits @@ -96,10 +103,18 @@ class UserLoginForm(forms.Form): return user - - class QuizForm(forms.Form): start_date = forms.DateField(initial=datetime.date.today) duration = forms.IntegerField() active = forms.BooleanField(required = False) description = forms.CharField(max_length=256, widget=forms.Textarea(attrs={'cols':20,'rows':2})) + +class AddQuestionForm(forms.Form): + summary = forms.CharField(max_length = 128) + description = forms.CharField(widget = forms.Textarea(attrs={'cols': 20, 'rows': 3})) + points = forms.FloatField() + test = forms.CharField(widget = forms.Textarea(attrs={'cols': 20, 'rows': 3})) + options = forms.CharField(widget = forms.Textarea(attrs={'cols': 20, 'rows': 3})) + type = forms.CharField(max_length=24, widget=forms.Select(choices=QUESTION_TYPE_CHOICES)) + active = forms.BooleanField(required=False) + |