diff options
-rw-r--r-- | server/prolog_session.py | 4 | ||||
-rw-r--r-- | wsgi_server.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/server/prolog_session.py b/server/prolog_session.py index d83d62d..798c086 100644 --- a/server/prolog_session.py +++ b/server/prolog_session.py @@ -120,9 +120,9 @@ class PrologSession(object): try: n_correct, n_all = problem_module.test(code) - return ['Passed {} / {} tests.'.format(n_correct, n_all)] + return [{'id': 'test_results', 'args': {'passed': n_correct, 'total': n_all}}] except AttributeError as ex: - return ['No test is defined for this problem'] + return [{'id': 'test_results', 'args': {'passed': 0, 'total': 0}}] def run_for_user(self, user_id, problem_id, program, query): """A "shorthand" method to start a Prolog session, load correct solutions of all user's solved diff --git a/wsgi_server.py b/wsgi_server.py index 50676b4..4acb76d 100644 --- a/wsgi_server.py +++ b/wsgi_server.py @@ -171,7 +171,7 @@ class Test(CodeqService): prolog = session.get_prolog() messages = prolog.test(session.get_uid(), problem_id, program) - return {'code': 0, 'message': 'ok', 'terminal': {'messages': messages}} + return {'code': 0, 'message': 'ok', 'hints': messages} class GetProblem(CodeqService): def process(self, js, session): |