summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/python_session.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/server/python_session.py b/server/python_session.py
index 87ae60f..4af455f 100644
--- a/server/python_session.py
+++ b/server/python_session.py
@@ -66,16 +66,15 @@ class PythonSession(object):
self._interpreter = None
def hint(self, sid, problem_id, program):
- session = server.user_session.get_session_by_id(sid)
language, problem_group, problem = Problem.get_identifier(problem_id)
language_module = problems.load_language(language, 'common')
problem_module = problems.load_problem(language, problem_group, problem, 'common')
hints = []
if hasattr(language_module, 'hint'):
- hints = language_module.hint(program)
+ hints = language_module.hint(self.run, program)
if not hints and hasattr(problem_module, 'hint'):
- hints = problem_module.hint(session, program)
+ hints = problem_module.hint(self.run, program)
if not hints:
hints = [{'id': 'no_hint'}]
@@ -83,13 +82,12 @@ class PythonSession(object):
return hints
def test(self, sid, problem_id, program):
- session = server.user_session.get_session_by_id(sid)
language, problem_group, problem = Problem.get_identifier(problem_id)
language_module = problems.load_language(language, 'common')
problem_module = problems.load_problem(language, problem_group, problem, 'common')
try:
- n_correct, n_all = problem_module.test(session, program)
+ n_correct, n_all = problem_module.test(self.run, program)
hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': n_all}}]
except AttributeError as ex:
hints = [{'id': 'test_results', 'args': {'passed': 0, 'total': 0}}]