diff options
-rw-r--r-- | yaksh/hook_evaluator.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/yaksh/hook_evaluator.py b/yaksh/hook_evaluator.py index 891192c..3956da1 100644 --- a/yaksh/hook_evaluator.py +++ b/yaksh/hook_evaluator.py @@ -53,8 +53,10 @@ class HookEvaluator(BaseEvaluator): try: tb = None _tests = compile(self.hook_code, '<string>', mode='exec') - exec(_tests, globals()) - success, err, mark_fraction = check_answer(self.user_answer) + hook_scope = {} + exec(_tests, hook_scope) + check = hook_scope["check_answer"] + success, err, mark_fraction = check(self.user_answer) except TimeoutException: raise except Exception: |