summaryrefslogtreecommitdiff
path: root/testapp/exam/java_code_evaluator.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2015-05-27 10:58:44 +0530
committerPrabhu Ramachandran2015-05-27 10:58:44 +0530
commita83b57aee80959f11f96ad6a3a738c9fac906e26 (patch)
treef14a18f7e821d87b098a93610ece8772d568563b /testapp/exam/java_code_evaluator.py
parenta022e0145ec8fb1622d58c2e2281c016b1d45b01 (diff)
parent92150265c82f3d1f6e4eb382447ae8e448cd406f (diff)
downloadonline_test-a83b57aee80959f11f96ad6a3a738c9fac906e26.tar.gz
online_test-a83b57aee80959f11f96ad6a3a738c9fac906e26.tar.bz2
online_test-a83b57aee80959f11f96ad6a3a738c9fac906e26.zip
Merge pull request #48 from ankitjavalkar/add-docs
Re apply docs directory in testapp directory and other changes
Diffstat (limited to 'testapp/exam/java_code_evaluator.py')
-rw-r--r--testapp/exam/java_code_evaluator.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/testapp/exam/java_code_evaluator.py b/testapp/exam/java_code_evaluator.py
index 08ae208..4367259 100644
--- a/testapp/exam/java_code_evaluator.py
+++ b/testapp/exam/java_code_evaluator.py
@@ -17,7 +17,6 @@ class JavaCodeEvaluator(CodeEvaluator):
super(JavaCodeEvaluator, self).__init__(test_case_data, test,
language, user_answer,
ref_code_path, in_dir)
- self.submit_path = self.create_submit_code_file('Test.java')
self.test_case_args = self._setup()
# Private Protocol ##########
@@ -25,6 +24,7 @@ class JavaCodeEvaluator(CodeEvaluator):
super(JavaCodeEvaluator, self)._setup()
ref_path, test_case_path = self._set_test_code_file_path(self.ref_code_path)
+ self.submit_path = self.create_submit_code_file('Test.java')
# Set file paths
java_student_directory = os.getcwd() + '/'
@@ -91,9 +91,10 @@ class JavaCodeEvaluator(CodeEvaluator):
main_err = self._remove_null_substitute_char(main_err)
if main_err == '':
- ret = self._run_command(run_command_args, stdin=None,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ ret = self._run_command(run_command_args, shell=True,
+ stdin=None,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
proc, stdout, stderr = ret
if proc.returncode == 0:
success, err = True, "Correct answer"