summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorankitjavalkar2015-05-13 14:31:42 +0530
committerankitjavalkar2015-05-14 15:05:54 +0530
commit13317f56278969cb6568026d099e15166bfc5d6c (patch)
tree92255ab0d5ee7fe6ed385a53972ccdc533b943b5
parent781548f53d864a56d313c04553c60b68c60e87c0 (diff)
downloadonline_test-13317f56278969cb6568026d099e15166bfc5d6c.tar.gz
online_test-13317f56278969cb6568026d099e15166bfc5d6c.tar.bz2
online_test-13317f56278969cb6568026d099e15166bfc5d6c.zip
Fix test case fetching for old questions
-rw-r--r--testapp/exam/forms.py4
-rw-r--r--testapp/exam/templates/exam/add_question.html2
-rw-r--r--testapp/exam/views.py1
3 files changed, 4 insertions, 3 deletions
diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py
index 93584a6..74a9b5a 100644
--- a/testapp/exam/forms.py
+++ b/testapp/exam/forms.py
@@ -187,7 +187,7 @@ class QuestionForm(forms.ModelForm):
description = forms.CharField(widget=forms.Textarea\
(attrs={'cols': 40, 'rows': 1}))
points = forms.FloatField()
- solution = forms.CharField(widget=forms.Textarea\
+ test = forms.CharField(widget=forms.Textarea\
(attrs={'cols': 40, 'rows': 1}), required=False)
options = forms.CharField(widget=forms.Textarea\
(attrs={'cols': 40, 'rows': 1}), required=False)
@@ -216,7 +216,7 @@ class QuestionForm(forms.ModelForm):
new_question.summary = summary
new_question.description = description
new_question.points = points
- # new_question.test = test
+ new_question.test = test
new_question.options = options
new_question.language = language
new_question.type = type
diff --git a/testapp/exam/templates/exam/add_question.html b/testapp/exam/templates/exam/add_question.html
index 43f09e1..c744549 100644
--- a/testapp/exam/templates/exam/add_question.html
+++ b/testapp/exam/templates/exam/add_question.html
@@ -30,7 +30,7 @@
<tr><td>Snippet: <td>{{ form.snippet }}{{ form.snippet.errors }}</td></tD></td></tr>
<tr><td>Tags: <td>{{ form.tags }}
<tr><td id='label_option'>Options: <td>{{ form.options }} {{form.options.errors}}
- <tr><td id='label_solution'>Test: <td>{{ form.solution }} {{form.solution.errors}}
+ <tr><td id='label_solution'>Test: <td>{{ form.test }} {{form.test.errors}}
<tr><td id='label_ref_code_path'>Reference Code Path: <td>{{ form.ref_code_path }} {{form.ref_code_path.errors}}
<form method="post" action="">
diff --git a/testapp/exam/views.py b/testapp/exam/views.py
index 5b7baac..621ec94 100644
--- a/testapp/exam/views.py
+++ b/testapp/exam/views.py
@@ -291,6 +291,7 @@ def edit_question(request):
description = request.POST.getlist('description')
points = request.POST.getlist('points')
options = request.POST.getlist('options')
+ test = request.POST.getlist('test')
type = request.POST.getlist('type')
active = request.POST.getlist('active')
language = request.POST.getlist('language')