summaryrefslogtreecommitdiff
path: root/yaksh/code_evaluator.py
diff options
context:
space:
mode:
authorankitjavalkar2016-04-06 11:26:52 +0530
committerankitjavalkar2016-05-05 19:16:26 +0530
commitd3241512c71d61b355358a691d18e4ff8a8df34c (patch)
tree0d1810fab8a10b7671400dab64a8b877b334a676 /yaksh/code_evaluator.py
parentf120f5763904589d3c18b6cc0f4e227bcaef9a0a (diff)
downloadonline_test-d3241512c71d61b355358a691d18e4ff8a8df34c.tar.gz
online_test-d3241512c71d61b355358a691d18e4ff8a8df34c.tar.bz2
online_test-d3241512c71d61b355358a691d18e4ff8a8df34c.zip
Multiple test cases passed as dicts, check_code() is iterated based on no. of test cases
Diffstat (limited to 'yaksh/code_evaluator.py')
-rw-r--r--yaksh/code_evaluator.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py
index b777b67..39f0d48 100644
--- a/yaksh/code_evaluator.py
+++ b/yaksh/code_evaluator.py
@@ -115,7 +115,8 @@ class CodeEvaluator(object):
self._change_dir(self.in_dir)
# def safe_evaluate(self, args):
- def safe_evaluate(self, **kwargs):
+ # def safe_evaluate(self, **kwargs): #@@@v2
+ def safe_evaluate(self, user_answer, test_case_data):
# Add a new signal handler for the execution of this code.
prev_handler = create_signal_handler()
success = False
@@ -124,7 +125,11 @@ class CodeEvaluator(object):
# Do whatever testing needed.
try:
# success, err = self.check_code(*args)
- success, err = self.check_code(**kwargs)
+ # success, err = self.check_code(**kwargs) #@@@v2
+ for test_case in test_case_data:
+ success, err = self.check_code(user_answer, **test_case)
+ if not success:
+ break
except TimeoutException:
err = self.timeout_msg