summaryrefslogtreecommitdiff
path: root/testapp/exam
diff options
context:
space:
mode:
Diffstat (limited to 'testapp/exam')
-rw-r--r--testapp/exam/forms.py12
-rw-r--r--testapp/exam/views.py4
2 files changed, 8 insertions, 8 deletions
diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py
index 272a3d4..2a1ae6d 100644
--- a/testapp/exam/forms.py
+++ b/testapp/exam/forms.py
@@ -11,7 +11,7 @@ import datetime
QUESTION_TYPE_CHOICES = (
("python", "Python"),
("bash", "Bash"),
- ("mcq", "MultipleChoice"),
+ ("mcq", "MCQ"),
)
UNAME_CHARS = letters + "._" + digits
@@ -131,12 +131,12 @@ class QuizForm(forms.Form):
class QuestionForm(forms.Form):
"""Creates a form to add or edit a Question. It has the related fields and functions required."""
- summary = forms.CharField(max_length = 128)
- description = forms.CharField(widget = forms.Textarea(attrs={'cols': 20, 'rows': 3}))
+ summary = forms.CharField(widget = forms.Textarea(attrs={'cols': 40, 'rows': 1}))
+ description = forms.CharField(widget = forms.Textarea(attrs={'cols': 40, 'rows': 1}))
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))
+ test = forms.CharField(widget = forms.Textarea(attrs={'cols': 40, 'rows': 1}))
+ options = forms.CharField(widget = forms.Textarea(attrs={'cols': 40, 'rows': 1}),required=False)
+ type = forms.CharField(max_length=8, widget=forms.Select(choices=QUESTION_TYPE_CHOICES))
active = forms.BooleanField(required=False)
def save(self):
diff --git a/testapp/exam/views.py b/testapp/exam/views.py
index ffb1b1e..d0e3ddc 100644
--- a/testapp/exam/views.py
+++ b/testapp/exam/views.py
@@ -129,8 +129,8 @@ def edit_question(request):
type = request.POST.getlist('type')
active = request.POST.getlist('active')
j = 0
- for i in editquestionlist:
- question = Question.objects.get(id=i)
+ for id_list in editquestionlist:
+ question = Question.objects.get(id=id_list)
question.summary = summary[j]
question.description = description[j]
question.points = points[j]