summaryrefslogtreecommitdiff
path: root/yaksh/python_stdio_evaluator.py
diff options
context:
space:
mode:
authormahesh2017-05-22 14:32:47 +0530
committermahesh2017-05-22 14:32:47 +0530
commit77f05d3df90a70ff97285deb5bda2d91d99e65d5 (patch)
treecf292b268f8f8dc322ea8bd50d2bbd65abef39e7 /yaksh/python_stdio_evaluator.py
parent153f738c3c43b26339fb625aba8336b3f8265991 (diff)
downloadonline_test-77f05d3df90a70ff97285deb5bda2d91d99e65d5.tar.gz
online_test-77f05d3df90a70ff97285deb5bda2d91d99e65d5.tar.bz2
online_test-77f05d3df90a70ff97285deb5bda2d91d99e65d5.zip
changes variable and dict key names along with other minor changes in answerpaper.
Diffstat (limited to 'yaksh/python_stdio_evaluator.py')
-rw-r--r--yaksh/python_stdio_evaluator.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/yaksh/python_stdio_evaluator.py b/yaksh/python_stdio_evaluator.py
index d6201f9..2b443a7 100644
--- a/yaksh/python_stdio_evaluator.py
+++ b/yaksh/python_stdio_evaluator.py
@@ -9,7 +9,7 @@ except ImportError:
# Local imports
from .file_utils import copy_files, delete_files
from .base_evaluator import BaseEvaluator
-from .compare_stdio import CompareOutputs
+from .compare_stdio import compare_outputs
@contextmanager
@@ -46,6 +46,7 @@ class PythonStdIOEvaluator(BaseEvaluator):
self.files = copy_files(self.file_paths)
submitted = compile(self.user_answer, '<string>', mode='exec')
if self.expected_input:
+ self.expected_input = self.expected_input.replace('\r', '')
input_buffer = StringIO()
input_buffer.write(self.expected_input)
input_buffer.seek(0)
@@ -58,9 +59,8 @@ class PythonStdIOEvaluator(BaseEvaluator):
def check_code(self):
mark_fraction = self.weight
- compare = CompareOutputs()
- success, err = compare.compare_outputs(self.expected_output,
- self.output_value,
- self.expected_input
- )
+ success, err = compare_outputs(self.expected_output,
+ self.output_value,
+ self.expected_input
+ )
return success, err, mark_fraction