summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/prolog_session.py5
-rw-r--r--server/python_session.py5
2 files changed, 4 insertions, 6 deletions
diff --git a/server/prolog_session.py b/server/prolog_session.py
index 8d9926d..ccfb91c 100644
--- a/server/prolog_session.py
+++ b/server/prolog_session.py
@@ -118,10 +118,9 @@ class PrologSession(object):
solved_problems = [p for p in CodeqUser.solved_problems(session.get_uid(), language)
if p != (problem_group, problem)]
try:
- n_correct, n_all = problem_module.test(program, solved_problems)
- hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': n_all}}]
+ passed, hints = problem_module.test(self.run, program)
except AttributeError as ex:
- hints = [{'id': 'test_results', 'args': {'passed': 0, 'total': 0}}]
+ hints = [{'id': 'system_error', 'args': {'message': 'test function does not exist'}}]
self._instantiate_and_save_hints(language_module, problem_module, hints)
return hints
diff --git a/server/python_session.py b/server/python_session.py
index 6f2c999..975af7f 100644
--- a/server/python_session.py
+++ b/server/python_session.py
@@ -93,10 +93,9 @@ class PythonSession(object):
problem_module = problems.load_problem(language, problem_group, problem, 'common')
try:
- n_correct, n_all = problem_module.test(self.run, program)
- hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': n_all}}]
+ passed, hints = problem_module.test(self.run, program)
except AttributeError as ex:
- hints = [{'id': 'test_results', 'args': {'passed': 0, 'total': 0}}]
+ hints = [{'id': 'system_error', 'args': {'message': 'test function does not exist'}}]
self._instantiate_and_save_hints(language_module, problem_module, hints)
return hints