summaryrefslogtreecommitdiff
path: root/testapp/exam/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'testapp/exam/forms.py')
-rw-r--r--testapp/exam/forms.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py
index a8e3ae7..a43ba2c 100644
--- a/testapp/exam/forms.py
+++ b/testapp/exam/forms.py
@@ -128,12 +128,11 @@ class QuizForm(forms.Form):
def __init__(self, *args, **kwargs):
super(QuizForm, self).__init__(*args, **kwargs)
- self.QUIZZES = [('', 'Select a prerequisite quiz')]
- self.QUIZZES = self.QUIZZES + \
+ QUIZZES = [('', 'Select a prerequisite quiz')]
+ QUIZZES = QUIZZES + \
list(Quiz.objects.values_list('id','description'))
self.fields['prerequisite'] = forms.CharField(required=False,
- widget=forms.Select(choices=self.QUIZZES))
-
+ widget=forms.Select(choices=QUIZZES))
start_date = forms.DateField(initial=datetime.date.today)
duration = forms.IntegerField(help_text='Will be taken in minutes')
@@ -144,7 +143,6 @@ class QuizForm(forms.Form):
help_text='Will be taken as percentage')
language = forms.CharField(widget=forms.Select(choices=LANGUAGES))
-
def save(self):
start_date = self.cleaned_data["start_date"]
duration = self.cleaned_data["duration"]