diff options
author | prathamesh | 2016-10-04 17:22:20 +0530 |
---|---|---|
committer | prathamesh | 2016-10-04 17:22:20 +0530 |
commit | 9c14e2b2026074234d9c977ca17b0c96b0789f6b (patch) | |
tree | 8b6c8e2438563e56631c2adf986e7cb16c33afb4 /yaksh/java_stdio_evaluator.py | |
parent | c5ae3d4589a71c3f3b9f622c7b67a04277269cde (diff) | |
parent | 91dd42214ba5ad88c5158b50a7746caa3841a883 (diff) | |
download | online_test-9c14e2b2026074234d9c977ca17b0c96b0789f6b.tar.gz online_test-9c14e2b2026074234d9c977ca17b0c96b0789f6b.tar.bz2 online_test-9c14e2b2026074234d9c977ca17b0c96b0789f6b.zip |
Merge branch 'master' of https://github.com/FOSSEE/online_test into edit_questionpaper
Resolved
Conflicts:
yaksh/views.py
Diffstat (limited to 'yaksh/java_stdio_evaluator.py')
-rw-r--r-- | yaksh/java_stdio_evaluator.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/yaksh/java_stdio_evaluator.py b/yaksh/java_stdio_evaluator.py index 27dd4a9..bc9cf80 100644 --- a/yaksh/java_stdio_evaluator.py +++ b/yaksh/java_stdio_evaluator.py @@ -1,15 +1,15 @@ #!/usr/bin/env python +from __future__ import unicode_literals import subprocess import os from os.path import isfile -#local imports -from code_evaluator import CodeEvaluator -from stdio_evaluator import Evaluator -from file_utils import copy_files, delete_files +#Local imports +from .stdio_evaluator import StdIOEvaluator +from .file_utils import copy_files, delete_files -class JavaStdioEvaluator(CodeEvaluator): +class JavaStdioEvaluator(StdIOEvaluator): """Evaluates Java StdIO based code""" def setup(self): @@ -17,10 +17,10 @@ class JavaStdioEvaluator(CodeEvaluator): self.submit_code_path = self.create_submit_code_file('Test.java') def teardown(self): - super(JavaStdioEvaluator, self).teardown() os.remove(self.submit_code_path) if self.files: delete_files(self.files) + super(JavaStdioEvaluator, self).teardown() def set_file_paths(self, directory, file_name): output_path = "{0}{1}.class".format(directory, file_name) @@ -61,11 +61,10 @@ class JavaStdioEvaluator(CodeEvaluator): stdout=subprocess.PIPE, stderr=subprocess.PIPE ) - evaluator = Evaluator() - success, err = evaluator.evaluate(user_answer, proc, - expected_input, - expected_output - ) + success, err = self.evaluate_stdio(user_answer, proc, + expected_input, + expected_output + ) os.remove(self.user_output_path) else: err = "Compilation Error:" |