diff options
author | Timotej Lazar <timotej.lazar@araneo.org> | 2015-08-28 18:28:42 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@araneo.org> | 2015-08-28 18:28:42 +0200 |
commit | fd27a749fa48a9f611850c1e598b3f8e3d379439 (patch) | |
tree | 3428acc945c11b0a06a15323ecfad69f168f9feb /server | |
parent | 29892da19ae7c1b2777f48bce4674262d2a19cef (diff) |
Handle test results as a static hint
Diffstat (limited to 'server')
-rw-r--r-- | server/prolog_session.py | 4 |
1 files changed, 2 insertions, 2 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 |