summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authormaheshgudi2016-06-02 16:00:27 +0530
committeradityacp2016-07-27 22:52:23 +0530
commitbb76e0a25b113b0f40b47f19eaa2c053e0b4e423 (patch)
treed3902ff71b3053d8f9f1be09cdea052570ec96a6 /yaksh
parentf5ea9ecf903360c2860293639d1c6ba7a78b2339 (diff)
downloadonline_test-bb76e0a25b113b0f40b47f19eaa2c053e0b4e423.tar.gz
online_test-bb76e0a25b113b0f40b47f19eaa2c053e0b4e423.tar.bz2
online_test-bb76e0a25b113b0f40b47f19eaa2c053e0b4e423.zip
changed model class name Stdout to Stdio
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/admin.py4
-rw-r--r--yaksh/evaluator_tests/test_java_evaluation.py4
-rw-r--r--yaksh/forms.py6
-rw-r--r--yaksh/models.py4
-rw-r--r--yaksh/settings.py12
-rw-r--r--yaksh/tests.py6
6 files changed, 19 insertions, 17 deletions
diff --git a/yaksh/admin.py b/yaksh/admin.py
index c31b99b..ddd5e62 100644
--- a/yaksh/admin.py
+++ b/yaksh/admin.py
@@ -1,9 +1,9 @@
from yaksh.models import Question, Quiz
-from yaksh.models import TestCase, StandardTestCase, StdoutBasedTestCase
+from yaksh.models import TestCase, StandardTestCase, StdioBasedTestCase
from django.contrib import admin
admin.site.register(Question)
admin.site.register(TestCase)
admin.site.register(StandardTestCase)
-admin.site.register(StdoutBasedTestCase)
+admin.site.register(StdioBasedTestCase)
admin.site.register(Quiz)
diff --git a/yaksh/evaluator_tests/test_java_evaluation.py b/yaksh/evaluator_tests/test_java_evaluation.py
index 8cfccb9..fa8d68c 100644
--- a/yaksh/evaluator_tests/test_java_evaluation.py
+++ b/yaksh/evaluator_tests/test_java_evaluation.py
@@ -68,13 +68,13 @@ class JavaStdioEvaluationTestCases(unittest.TestCase):
def setUp(self):
self.test_case_data = [{'expected_output': '11',
'expected_input': '5\n6'}]
- evaluator.SERVER_TIMEOUT = 9
+ evaluator.SERVER_TIMEOUT = 4
self.timeout_msg = ("Code took more than {0} seconds to run. "
"You probably have an infinite loop in"
" your code.").format(evaluator.SERVER_TIMEOUT)
def teardown(self):
- evaluator.SERVER_TIMEOUT = 2
+ evaluator.SERVER_TIMEOUT = 4
def test_correct_answer(self):
user_answer = dedent("""
diff --git a/yaksh/forms.py b/yaksh/forms.py
index a443e34..6bea0c8 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -1,9 +1,9 @@
from django import forms
-from yaksh.models import get_model_class, Profile, Quiz, Question, TestCase, Course, StandardTestCase, StdoutBasedTestCase
+from yaksh.models import get_model_class, Profile, Quiz, Question, TestCase, Course, StandardTestCase, StdioBasedTestCase
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
-from django.contrib.contenttypes.models import ContentType
+from django.contrib.contenttypes.models import ContentType
from taggit.managers import TaggableManager
from taggit.forms import TagField
@@ -33,7 +33,7 @@ question_types = (
test_case_types = (
("standardtestcase", "Standard Testcase"),
- ("stdoutbasedtestcase", "Stdout Based Testcase"),
+ ("stdiobasedtestcase", "Stdio Based Testcase"),
("mcqtestcase", "MCQ Testcase"),
)
diff --git a/yaksh/models.py b/yaksh/models.py
index e7ae52f..3fd7508 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -888,9 +888,9 @@ class StandardTestCase(TestCase):
)
-class StdIOBasedTestCase(TestCase):
+class StdioBasedTestCase(TestCase):
expected_input = models.TextField(blank=True)
- expected_output = models.TextField(blank=True)
+ expected_output = models.TextField()
def get_field_value(self):
return {"expected_output": self.expected_output,
diff --git a/yaksh/settings.py b/yaksh/settings.py
index 13860b6..f4122b6 100644
--- a/yaksh/settings.py
+++ b/yaksh/settings.py
@@ -21,14 +21,16 @@ URL_ROOT = ''
code_evaluators = {
"python": {"standardtestcase": "python_assertion_evaluator.PythonAssertionEvaluator",
- "stdoutbasedtestcase": "python_stdout_evaluator.PythonStdoutEvaluator"
- },
+ "stdiobasedtestcase": "python_stdio_evaluator.PythonStdioEvaluator"
+ },
"c": {"standardtestcase": "cpp_code_evaluator.CppCodeEvaluator",
- "stdiobasedtestcase": "cpp_stdio_evaluator.CppStdioEvaluator"},
+ "stdiobasedtestcase": "cpp_stdio_evaluator.CppStdioEvaluator"
+ },
"cpp": {"standardtestcase": "cpp_code_evaluator.CppCodeEvaluator",
- "stdiobasedtestcase": "cpp_stdio_evaluator.CppStdioEvaluator"},
+ "stdiobasedtestcase": "cpp_stdio_evaluator.CppStdioEvaluator"
+ },
"java": {"standardtestcase": "java_code_evaluator.JavaCodeEvaluator",
- "stdiobasedtestcase": "java_stdio_evaluator.JavaStdioEvaluator"},
+ "stdiobasedtestcase": "java_stdio_evaluator.JavaStdioEvaluator"},
"bash": {"standardtestcase": "bash_code_evaluator.BashCodeEvaluator"},
"scilab": {"standardtestcase": "scilab_code_evaluator.ScilabCodeEvaluator"},
}
diff --git a/yaksh/tests.py b/yaksh/tests.py
index 8bd2dda..5b87fc1 100644
--- a/yaksh/tests.py
+++ b/yaksh/tests.py
@@ -1,7 +1,7 @@
import unittest
from yaksh.models import User, Profile, Question, Quiz, QuestionPaper,\
QuestionSet, AnswerPaper, Answer, Course, StandardTestCase,\
- StdoutBasedTestCase
+ StdioBasedTestCase
import json
from datetime import datetime, timedelta
from django.utils import timezone
@@ -632,7 +632,7 @@ class TestCaseTestCases(unittest.TestCase):
active=True,
description='Write to standard output',
points=1.0,
- test_case_type="stdoutbasedtestcase",
+ test_case_type="stdiobasedtestcase",
user=self.user,
snippet='def myfunc()'
)
@@ -642,7 +642,7 @@ class TestCaseTestCases(unittest.TestCase):
question=self.question1,
test_case='assert myfunc(12, 13) == 15'
)
- self.stdout_based_testcase = StdoutBasedTestCase(
+ self.stdout_based_testcase = StdioBasedTestCase(
question=self.question2,
expected_output='Hello World'
)