summaryrefslogtreecommitdiff
path: root/yaksh/grader.py
diff options
context:
space:
mode:
authorankitjavalkar2016-12-22 15:55:54 +0530
committerankitjavalkar2016-12-22 16:51:26 +0530
commit42ed7c142e2c4ff4dccdaec2365e22d30bc276dd (patch)
treed1eb3c0039478294f4169d6e761ed42dd78a6327 /yaksh/grader.py
parenta88197040b69a556f9c7b0432350b9d1d4aad06f (diff)
downloadonline_test-42ed7c142e2c4ff4dccdaec2365e22d30bc276dd.tar.gz
online_test-42ed7c142e2c4ff4dccdaec2365e22d30bc276dd.tar.bz2
online_test-42ed7c142e2c4ff4dccdaec2365e22d30bc276dd.zip
Refactor check method for cleaner code and fixing multiple issues
- Question should skip to new question with new error rendering - Fix test cases Fix change_dir context manager in grader
Diffstat (limited to 'yaksh/grader.py')
-rw-r--r--yaksh/grader.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/yaksh/grader.py b/yaksh/grader.py
index 41b3ac1..0c057c2 100644
--- a/yaksh/grader.py
+++ b/yaksh/grader.py
@@ -24,7 +24,6 @@ from .language_registry import create_evaluator_instance
MY_DIR = abspath(dirname(__file__))
-
registry = None
# Raised when the code times-out.
@@ -34,7 +33,7 @@ class TimeoutException(Exception):
@contextlib.contextmanager
def change_dir(path):
- cur_dir = os.getcwd()
+ cur_dir = abspath(dirname(MY_DIR))
os.chdir(path)
try:
yield
@@ -77,7 +76,7 @@ class Grader(object):
self.in_dir = in_dir if in_dir else MY_DIR
- def evaluate(self, kwargs): #language, test_case_type,
+ def evaluate(self, kwargs):
"""Evaluates given code with the test cases based on
given arguments in test_case_data.
@@ -98,7 +97,6 @@ class Grader(object):
A tuple: (success, error, weight).
"""
-
self.setup()
test_case_instances = self.get_evaluator_objects(kwargs)
with change_dir(self.in_dir):