diff options
author | maheshgudi | 2016-08-03 15:16:08 +0530 |
---|---|---|
committer | maheshgudi | 2016-08-03 15:16:08 +0530 |
commit | 40fbb5d8f1d4174f7d7e2d4723e9fbfc40040dcb (patch) | |
tree | 7885b674d2deb064137f1f501ed1707bfd54daf8 /yaksh/code_evaluator.py | |
parent | 1b71abc9437d721a41f017db406f312755f5a4c4 (diff) | |
parent | 2b03aeb36fa333ea1644a248c742cf0c1df12a5f (diff) | |
download | online_test-40fbb5d8f1d4174f7d7e2d4723e9fbfc40040dcb.tar.gz online_test-40fbb5d8f1d4174f7d7e2d4723e9fbfc40040dcb.tar.bz2 online_test-40fbb5d8f1d4174f7d7e2d4723e9fbfc40040dcb.zip |
rebase changes with stdio evaluator
Diffstat (limited to 'yaksh/code_evaluator.py')
-rw-r--r-- | yaksh/code_evaluator.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py index aab99eb..2fb429f 100644 --- a/yaksh/code_evaluator.py +++ b/yaksh/code_evaluator.py @@ -88,7 +88,7 @@ class CodeEvaluator(object): def setup(self): self._change_dir(self.in_dir) - def safe_evaluate(self, user_answer, test_case_data): + def safe_evaluate(self, user_answer, test_case_data, file_paths=None): """ Handles code evaluation along with compilation, signal handling and Exception handling @@ -101,8 +101,8 @@ class CodeEvaluator(object): # Do whatever testing needed. try: for test_case in test_case_data: - self.compile_code(user_answer, **test_case) - success, err = self.check_code(user_answer, **test_case) + self.compile_code(user_answer, file_paths, **test_case) + success, err = self.check_code(user_answer, file_paths, **test_case) if not success: break @@ -124,7 +124,7 @@ class CodeEvaluator(object): def check_code(self): raise NotImplementedError("check_code method not implemented") - def compile_code(self, user_answer, **kwargs): + def compile_code(self, user_answer, file_paths, **kwargs): pass def create_submit_code_file(self, file_name): @@ -136,7 +136,6 @@ class CodeEvaluator(object): return submit_path - def write_to_submit_code_file(self, file_path, user_answer): """ Write the code (`answer`) to a file""" submit_f = open(file_path, 'w') |