diff options
author | mahesh | 2017-03-21 16:38:31 +0530 |
---|---|---|
committer | mahesh | 2017-03-21 16:38:31 +0530 |
commit | 72061d5f4ceae8e848a1fb12ab245be93db75435 (patch) | |
tree | 0cee9facaa3cd8d7701eff36de044ceac960acfe /yaksh/hook_evaluator.py | |
parent | 977399542df00349cc87917191af343226c44596 (diff) | |
parent | 49a4cbac480f8a9e3fafcd50e6ce2fa41a5d8699 (diff) | |
download | online_test-72061d5f4ceae8e848a1fb12ab245be93db75435.tar.gz online_test-72061d5f4ceae8e848a1fb12ab245be93db75435.tar.bz2 online_test-72061d5f4ceae8e848a1fb12ab245be93db75435.zip |
rebase changes for simple question types
Diffstat (limited to 'yaksh/hook_evaluator.py')
-rw-r--r-- | yaksh/hook_evaluator.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/yaksh/hook_evaluator.py b/yaksh/hook_evaluator.py index 2cc4578..0819ec9 100644 --- a/yaksh/hook_evaluator.py +++ b/yaksh/hook_evaluator.py @@ -12,11 +12,13 @@ from .grader import TimeoutException class HookEvaluator(BaseEvaluator): def __init__(self, metadata, test_case_data): self.files = [] + self.assign_files = [] # Set metadata values self.user_answer = metadata.get('user_answer') self.file_paths = metadata.get('file_paths') self.partial_grading = metadata.get('partial_grading') + self.assignment_files = metadata.get('assign_files') # Set test case data values self.hook_code = test_case_data.get('hook_code') @@ -26,6 +28,8 @@ class HookEvaluator(BaseEvaluator): # Delete the created file. if self.files: delete_files(self.files) + if self.assign_files: + delete_files(self.assign_files) def check_code(self): """ Function evaluates user answer by running a python based hook code @@ -47,6 +51,10 @@ class HookEvaluator(BaseEvaluator): Returns (False, error_msg, 0.0): If mandatory arguments are not files or if the required permissions are not given to the file(s). """ + if self.file_paths: + self.files = copy_files(self.file_paths) + if self.assignment_files: + self.assign_files = copy_files(self.assignment_files) success = False mark_fraction = 0.0 try: |