summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2016-06-20 14:56:20 +0530
committeradityacp2016-07-28 15:56:06 +0530
commit98cda0357f238cd230c26eebbf75e1d90bc3588e (patch)
tree288a1b384b31ccce410b72e6294d8a8e6692db5a
parentfd97b0391b7364927061487604b187541dab6510 (diff)
downloadonline_test-98cda0357f238cd230c26eebbf75e1d90bc3588e.tar.gz
online_test-98cda0357f238cd230c26eebbf75e1d90bc3588e.tar.bz2
online_test-98cda0357f238cd230c26eebbf75e1d90bc3588e.zip
added parameter in safe_evaluate to take file paths list
-rw-r--r--yaksh/code_evaluator.py9
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')