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/bash_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/bash_code_evaluator.py')
-rw-r--r-- | testapp/exam/bash_code_evaluator.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/testapp/exam/bash_code_evaluator.py b/testapp/exam/bash_code_evaluator.py index 23c0ae5..a468fd7 100644 --- a/testapp/exam/bash_code_evaluator.py +++ b/testapp/exam/bash_code_evaluator.py @@ -16,13 +16,13 @@ class BashCodeEvaluator(CodeEvaluator): ref_code_path=None, in_dir=None): super(BashCodeEvaluator, self).__init__(test_case_data, test, language, user_answer, ref_code_path, in_dir) - self.submit_path = self.create_submit_code_file('submit.sh') self.test_case_args = self._setup() # Private Protocol ########## def _setup(self): super(BashCodeEvaluator, self)._setup() + self.submit_path = self.create_submit_code_file('submit.sh') self._set_file_as_executable(self.submit_path) get_ref_path, get_test_case_path = self.ref_code_path.strip().split(',') get_ref_path = get_ref_path.strip() @@ -73,11 +73,11 @@ class BashCodeEvaluator(CodeEvaluator): success = False if test_case_path is None or "": - ret = self.run_command(ref_path, stdin=None, + ret = self._run_command(ref_path, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc, inst_stdout, inst_stderr = ret - ret = self.run_command(submit_path, stdin=None, + ret = self._run_command(submit_path, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc, stdnt_stdout, stdnt_stderr = ret @@ -103,12 +103,12 @@ class BashCodeEvaluator(CodeEvaluator): loop_count += 1 if valid_answer: args = [ref_path] + [x for x in test_case.split()] - ret = self.run_command(args, stdin=None, + ret = self._run_command(args, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc, inst_stdout, inst_stderr = ret args = [submit_path]+[x for x in test_case.split()] - ret = self.run_command(args, stdin=None, + ret = self._run_command(args, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc, stdnt_stdout, stdnt_stderr = ret |