summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authorprathamesh2016-11-01 09:30:53 +0530
committerprathamesh2016-11-01 09:30:53 +0530
commit6f9d5d2779e64212988c0d164fa05ce2d05e696a (patch)
treee7a1c316b97df44ec701384feea421ca66e3aa9c /yaksh/forms.py
parent3b66e5fb8af12ce756f34966bb684373062551dd (diff)
parentf563640af941a50642dc5eb6e63b1d63a1685046 (diff)
downloadonline_test-6f9d5d2779e64212988c0d164fa05ce2d05e696a.tar.gz
online_test-6f9d5d2779e64212988c0d164fa05ce2d05e696a.tar.bz2
online_test-6f9d5d2779e64212988c0d164fa05ce2d05e696a.zip
Merge branch 'master' of https://github.com/FOSSEE/online_test into UI-modifications
Resolved Conflicts: yaksh/templates/manage.html yaksh/templates/yaksh/design_questionpaper.html
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index a12ce9a..1931fad 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
@@ -177,7 +177,7 @@ class QuestionForm(forms.ModelForm):
class Meta:
model = Question
- exclude = ['user']
+ exclude = ['user', 'active']
class FileForm(forms.Form):
@@ -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']