From 98cda0357f238cd230c26eebbf75e1d90bc3588e Mon Sep 17 00:00:00 2001 From: adityacp Date: Mon, 20 Jun 2016 14:56:20 +0530 Subject: added parameter in safe_evaluate to take file paths list --- yaksh/code_evaluator.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'yaksh') 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') -- cgit