diff options
author | adityacp | 2017-03-15 17:55:34 +0530 |
---|---|---|
committer | adityacp | 2017-03-15 17:55:34 +0530 |
commit | 5e500f3344a13d375d018312936280d88d47c93c (patch) | |
tree | 3a0375d11eafdd25e70e96914c518bd54e532b4e /yaksh/hook_evaluator.py | |
parent | f1eb06d3740eb21558576e5f5489972e45cab038 (diff) | |
download | online_test-5e500f3344a13d375d018312936280d88d47c93c.tar.gz online_test-5e500f3344a13d375d018312936280d88d47c93c.tar.bz2 online_test-5e500f3344a13d375d018312936280d88d47c93c.zip |
Change templates and js
- Support multiple files uploading in assignment
- Create new check field to grade assignement based question
- Add js changes
Diffstat (limited to 'yaksh/hook_evaluator.py')
-rw-r--r-- | yaksh/hook_evaluator.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/yaksh/hook_evaluator.py b/yaksh/hook_evaluator.py index 2cc4578..052d220 100644 --- a/yaksh/hook_evaluator.py +++ b/yaksh/hook_evaluator.py @@ -17,6 +17,7 @@ class HookEvaluator(BaseEvaluator): 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 +27,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 +50,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: |