diff options
author | Prabhu Ramachandran | 2016-10-11 01:12:46 +0530 |
---|---|---|
committer | GitHub | 2016-10-11 01:12:46 +0530 |
commit | 9b60cc7b8f000f96d5f818f759a6c63d5a26f239 (patch) | |
tree | baa04b7a091bcb46750076dcfd7ffe5a6ff29c03 /yaksh/forms.py | |
parent | 91dd42214ba5ad88c5158b50a7746caa3841a883 (diff) | |
parent | 2ee45f6f04711c745e533abeef6b5ca55d7b4ec3 (diff) | |
download | online_test-9b60cc7b8f000f96d5f818f759a6c63d5a26f239.tar.gz online_test-9b60cc7b8f000f96d5f818f759a6c63d5a26f239.tar.bz2 online_test-9b60cc7b8f000f96d5f818f759a6c63d5a26f239.zip |
Merge pull request #146 from prathamesh920/edit_questionpaper
Edit questionpaper
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r-- | yaksh/forms.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py index a12ce9a..bc9b4c0 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -1,6 +1,6 @@ from django import forms -from yaksh.models import get_model_class, Profile, Quiz, Question, TestCase, Course, StandardTestCase, StdioBasedTestCase - +from yaksh.models import get_model_class, Profile, Quiz, Question, TestCase, Course,\ + QuestionPaper, StandardTestCase, StdioBasedTestCase from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType @@ -199,7 +199,7 @@ class QuestionFilterForm(forms.Form): super(QuestionFilterForm, self).__init__(*args, **kwargs) questions = Question.objects.filter(user_id=user.id) points_list = questions.values_list('points', flat=True).distinct() - points_options = [('select', 'Select Marks')] + points_options = [(None, 'Select Marks')] points_options.extend([(point, point) for point in points_list]) self.fields['marks'] = forms.FloatField(widget=forms.Select\ (choices=points_options)) @@ -215,6 +215,7 @@ class CourseForm(forms.ModelForm): model = Course fields = ['name', 'active', 'enrollment'] + class ProfileForm(forms.ModelForm): """ profile form for students and moderators """ @@ -236,3 +237,9 @@ class ProfileForm(forms.ModelForm): class UploadFileForm(forms.Form): file = forms.FileField() + + +class QuestionPaperForm(forms.ModelForm): + class Meta: + model = QuestionPaper + fields = ['shuffle_questions'] |