diff options
author | Timotej Lazar <timotej.lazar@araneo.org> | 2015-09-22 12:05:20 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@araneo.org> | 2015-09-22 12:05:20 +0200 |
commit | 0cc91946829c64e894034bdc5cabdd80f983d5be (patch) | |
tree | 75a75426f7a712a0e692aafe33dde5a9e8ad40af /server/python_session.py | |
parent | 15f35dc1c2eb50a8140f1a0abf45d5aa25fdf66b (diff) |
Create the hint-list in individual test functions
This will allow us to add more hints, for example "did you know?"-type
information when the program is correct.
Diffstat (limited to 'server/python_session.py')
-rw-r--r-- | server/python_session.py | 5 |
1 files changed, 2 insertions, 3 deletions
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 |