summaryrefslogtreecommitdiff
path: root/yaksh/code_evaluator.py
diff options
context:
space:
mode:
authorankitjavalkar2016-04-18 15:22:25 +0530
committerankitjavalkar2016-05-05 19:16:26 +0530
commit2c7f278382f4fe8071508b0a880aae34f8edfd5e (patch)
tree3268bd3b29bf7e0148ca818c25c128bd0d38a944 /yaksh/code_evaluator.py
parentd3241512c71d61b355358a691d18e4ff8a8df34c (diff)
downloadonline_test-2c7f278382f4fe8071508b0a880aae34f8edfd5e.tar.gz
online_test-2c7f278382f4fe8071508b0a880aae34f8edfd5e.tar.bz2
online_test-2c7f278382f4fe8071508b0a880aae34f8edfd5e.zip
add compile_code function to compile before checking
Diffstat (limited to 'yaksh/code_evaluator.py')
-rw-r--r--yaksh/code_evaluator.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py
index 39f0d48..180d719 100644
--- a/yaksh/code_evaluator.py
+++ b/yaksh/code_evaluator.py
@@ -127,6 +127,7 @@ class CodeEvaluator(object):
# success, err = self.check_code(*args)
# success, err = self.check_code(**kwargs) #@@@v2
for test_case in test_case_data:
+ self.compile_user_answer(user_answer, **test_case)
success, err = self.check_code(user_answer, **test_case)
if not success:
break
@@ -149,14 +150,8 @@ class CodeEvaluator(object):
def check_code(self):
raise NotImplementedError("check_code method not implemented")
- # def create_submit_code_file(self, file_name):
- # """ Write the code (`answer`) to a file and set the file path"""
- # submit_f = open(file_name, 'w')
- # submit_f.write(self.user_answer.lstrip())
- # submit_f.close()
- # submit_path = abspath(submit_f.name)
-
- # return submit_path
+ def compile_user_answer(self, user_answer, **kwargs):
+ pass
def create_submit_code_file(self, file_name):
""" Set the file path for code (`answer`)"""