summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authoradityacp2017-01-10 14:43:52 +0530
committeradityacp2017-01-10 14:43:52 +0530
commit05b8d1f19bc566e28f2b9bc232389c65f6e4b9bf (patch)
tree896aa651644179a69c0ae1e6c2aaf5053e8be481 /yaksh/models.py
parentd924a36d5c0bfec383d5a07811ca197705fafe1b (diff)
parent7fb288ffd992c912a8e2288aa97d6c6ceeedf1a1 (diff)
downloadonline_test-05b8d1f19bc566e28f2b9bc232389c65f6e4b9bf.tar.gz
online_test-05b8d1f19bc566e28f2b9bc232389c65f6e4b9bf.tar.bz2
online_test-05b8d1f19bc566e28f2b9bc232389c65f6e4b9bf.zip
Merge https://github.com/fossee/online_test into fix_management_commands
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 9b553b0..6ad5eec 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -231,9 +231,6 @@ class Question(models.Model):
# The type of question.
type = models.CharField(max_length=24, choices=question_types)
- # The type of evaluator
- test_case_type = models.CharField(max_length=24, choices=test_case_types)
-
# Is this question active or not. If it is inactive it will not be used
# when creating a QuestionPaper.
active = models.BooleanField(default=True)
@@ -286,7 +283,6 @@ class Question(models.Model):
'description': question.description,
'points': question.points, 'language': question.language,
'type': question.type, 'active': question.active,
- 'test_case_type': question.test_case_type,
'snippet': question.snippet,
'testcase': [case.get_field_value() for case in test_case],
'files': file_names}
@@ -328,7 +324,7 @@ class Question(models.Model):
for tc in self.testcase_set.all():
test_case_type = tc.type
test_case_ctype = ContentType.objects.get(app_label="yaksh",
- model=self.test_case_type
+ model=test_case_type
)
test_case = test_case_ctype.get_object_for_this_type(
question=self,
@@ -1080,8 +1076,7 @@ class AnswerPaper(models.Model):
correct = True
elif question.type == 'code':
user_dir = self.user.profile.get_user_dir()
- json_result = code_server.run_code(question.language,
- question.test_case_type, json_data, user_dir)
+ json_result = code_server.run_code(question.language, json_data, user_dir)
result = json.loads(json_result)
if result.get('success'):
correct = True
@@ -1147,8 +1142,7 @@ class TestCase(models.Model):
class StandardTestCase(TestCase):
test_case = models.TextField()
weight = models.FloatField(default=1.0)
- test_case_args = models.TextField(help_text="<b>Command Line arguments for bash only</b>",
- blank=True)
+ test_case_args = models.TextField(blank=True)
def get_field_value(self):
return {"test_case_type": "standardtestcase",