summaryrefslogtreecommitdiff
path: root/yaksh/code_server.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2016-12-20 16:53:17 +0530
committerGitHub2016-12-20 16:53:17 +0530
commit77e8a6c1cde9190daf9075d71caf6017dc1380e7 (patch)
treec0d4a002bba428269c2f7ba62eb68d24b8cbec5f /yaksh/code_server.py
parent1400eeb1d5af1cd1d69e015a19a319ab35d357c4 (diff)
parentbf5b4e7607bae0b81ceeb99e8bf5d750433e92e8 (diff)
downloadonline_test-77e8a6c1cde9190daf9075d71caf6017dc1380e7.tar.gz
online_test-77e8a6c1cde9190daf9075d71caf6017dc1380e7.tar.bz2
online_test-77e8a6c1cde9190daf9075d71caf6017dc1380e7.zip
Merge pull request #163 from ankitjavalkar/code-server-refactor2016-form
Code Evaluator refactoring
Diffstat (limited to 'yaksh/code_server.py')
-rw-r--r--[-rwxr-xr-x]yaksh/code_server.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/yaksh/code_server.py b/yaksh/code_server.py
index b3c9c30..4db5810 100755..100644
--- a/yaksh/code_server.py
+++ b/yaksh/code_server.py
@@ -53,7 +53,8 @@ from tornado.web import Application, RequestHandler
# Local imports
from .settings import SERVER_PORTS, SERVER_POOL_PORT
-from .language_registry import create_evaluator_instance, unpack_json
+from .language_registry import create_evaluator_instance
+from .grader import Grader
MY_DIR = abspath(dirname(__file__))
@@ -84,13 +85,9 @@ class CodeServer(object):
"""Calls relevant EvaluateCode class based on language to check the
answer code
"""
- code_evaluator = create_evaluator_instance(language,
- test_case_type,
- json_data,
- in_dir
- )
- data = unpack_json(json_data)
- result = code_evaluator.evaluate(**data)
+ data = json.loads(json_data)
+ grader = Grader(in_dir)
+ result = grader.evaluate(data)
# Put us back into the server pool queue since we are free now.
self.queue.put(self.port)