summaryrefslogtreecommitdiff
path: root/yaksh/scilab_code_evaluator.py
diff options
context:
space:
mode:
authorKing2016-07-28 17:39:44 +0530
committerGitHub2016-07-28 17:39:44 +0530
commit2b03aeb36fa333ea1644a248c742cf0c1df12a5f (patch)
tree4c753ba9a1fbccf3e06d1ed1d998137c88a73b88 /yaksh/scilab_code_evaluator.py
parent344e1e804cee214c0d0f5c41ca16d871e786d4c3 (diff)
parent83bee9d89e163e98504c8aa210ce60200bd1cd1d (diff)
downloadonline_test-2b03aeb36fa333ea1644a248c742cf0c1df12a5f.tar.gz
online_test-2b03aeb36fa333ea1644a248c742cf0c1df12a5f.tar.bz2
online_test-2b03aeb36fa333ea1644a248c742cf0c1df12a5f.zip
Merge pull request #113 from adityacp/file_based_questions
File based questions
Diffstat (limited to 'yaksh/scilab_code_evaluator.py')
-rw-r--r--yaksh/scilab_code_evaluator.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/yaksh/scilab_code_evaluator.py b/yaksh/scilab_code_evaluator.py
index 91b4cb3..53fa343 100644
--- a/yaksh/scilab_code_evaluator.py
+++ b/yaksh/scilab_code_evaluator.py
@@ -8,6 +8,7 @@ import importlib
# local imports
from code_evaluator import CodeEvaluator
+from file_utils import copy_files, delete_files
class ScilabCodeEvaluator(CodeEvaluator):
@@ -21,8 +22,13 @@ class ScilabCodeEvaluator(CodeEvaluator):
super(ScilabCodeEvaluator, self).teardown()
# Delete the created file.
os.remove(self.submit_code_path)
+ if self.files:
+ delete_files(self.files)
- def check_code(self, user_answer, test_case):
+ def check_code(self, user_answer, file_paths, test_case):
+ self.files = []
+ if file_paths:
+ self.files = copy_files(file_paths)
ref_code_path = test_case
clean_ref_path, clean_test_case_path = \
self._set_test_code_file_path(ref_code_path)
@@ -60,7 +66,6 @@ class ScilabCodeEvaluator(CodeEvaluator):
err = add_err + stdout
else:
err = add_err + stderr
-
return success, err
def _remove_scilab_exit(self, string):