diff options
author | ankitjavalkar | 2015-05-13 18:20:26 +0530 |
---|---|---|
committer | ankitjavalkar | 2015-05-20 14:58:05 +0530 |
commit | 92150265c82f3d1f6e4eb382447ae8e448cd406f (patch) | |
tree | f14a18f7e821d87b098a93610ece8772d568563b /testapp/exam/java_code_evaluator.py | |
parent | 13317f56278969cb6568026d099e15166bfc5d6c (diff) | |
download | online_test-92150265c82f3d1f6e4eb382447ae8e448cd406f.tar.gz online_test-92150265c82f3d1f6e4eb382447ae8e448cd406f.tar.bz2 online_test-92150265c82f3d1f6e4eb382447ae8e448cd406f.zip |
Fix import paths, formatting, views and minor errors
- Submitted file path should be set after changing directory
- Change timeout duration in java test case
- Set shell=True in _compile_command
- Fix errors in code as per tests
Diffstat (limited to 'testapp/exam/java_code_evaluator.py')
-rw-r--r-- | testapp/exam/java_code_evaluator.py | 9 |
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" |