summaryrefslogtreecommitdiff
path: root/yaksh/code_server.py
diff options
context:
space:
mode:
authorankitjavalkar2016-12-20 12:42:44 +0530
committerankitjavalkar2016-12-20 15:31:22 +0530
commitbf5b4e7607bae0b81ceeb99e8bf5d750433e92e8 (patch)
treec0d4a002bba428269c2f7ba62eb68d24b8cbec5f /yaksh/code_server.py
parent798d36aa12e22928e884668ae5c80a25d48393ea (diff)
downloadonline_test-bf5b4e7607bae0b81ceeb99e8bf5d750433e92e8.tar.gz
online_test-bf5b4e7607bae0b81ceeb99e8bf5d750433e92e8.tar.bz2
online_test-bf5b4e7607bae0b81ceeb99e8bf5d750433e92e8.zip
Fix errors and rename resources
- code_evaluator module and class renamed to grader - Test cases fixed - Comments removed - weight variable renamed to mark
Diffstat (limited to 'yaksh/code_server.py')
-rw-r--r--yaksh/code_server.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/yaksh/code_server.py b/yaksh/code_server.py
index 815eb55..4db5810 100644
--- a/yaksh/code_server.py
+++ b/yaksh/code_server.py
@@ -54,7 +54,7 @@ from tornado.web import Application, RequestHandler
# Local imports
from .settings import SERVER_PORTS, SERVER_POOL_PORT
from .language_registry import create_evaluator_instance
-from .code_evaluator import CodeEvaluator
+from .grader import Grader
MY_DIR = abspath(dirname(__file__))
@@ -85,19 +85,15 @@ class CodeServer(object):
"""Calls relevant EvaluateCode class based on language to check the
answer code
"""
- data = self.unpack_json_to_python_obj(json_data)
- code_eval_instance = CodeEvaluator(in_dir)
- result = code_eval_instance.evaluate(data) #language, test_case_type,
+ 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)
return json.dumps(result)
- def unpack_json_to_python_obj(self, json_data):
- data = json.loads(json_data)
- return data
-
def run(self):
"""Run XMLRPC server, serving our methods."""
server = SimpleXMLRPCServer(("0.0.0.0", self.port))