summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-05-22 21:07:01 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-05-22 21:07:01 +0200
commit2f3e46815c1a89cef68bce537f04c2632d9370c8 (patch)
treed9d1ebb20049f5e8e347f6c2eaf14795efb1f08b /server
parent66bec18794c01545c4451b9a43a29caae81e0b0d (diff)
Fix: store current solution when tests pass
Diffstat (limited to 'server')
-rw-r--r--server/prolog_session.py2
-rw-r--r--server/python_session.py2
-rw-r--r--server/robot_session.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/server/prolog_session.py b/server/prolog_session.py
index 5dd848b..ac18400 100644
--- a/server/prolog_session.py
+++ b/server/prolog_session.py
@@ -124,7 +124,7 @@ class PrologSession(server.LanguageSession):
# check if the program is correct
n_correct, n_all, msgs = problem_module.test(program, aux_code=aux_code)
if n_correct == n_all:
- session.update_solution(problem_id, done=True)
+ session.update_solution(problem_id, solution=program, done=True)
else:
hints = []
if not hints and hasattr(language_module, 'check_syntax'):
diff --git a/server/python_session.py b/server/python_session.py
index 9ceda9b..52a54de 100644
--- a/server/python_session.py
+++ b/server/python_session.py
@@ -110,7 +110,7 @@ class PythonSession(server.LanguageSession):
passed, msgs = problem_module.test(self.run, program)
if passed:
session = server.user_session.get_session_by_id(sid)
- session.update_solution(problem_id, done=True)
+ session.update_solution(problem_id, solution=program, done=True)
else:
hints = []
if not hints and hasattr(language_module, 'hint'):
diff --git a/server/robot_session.py b/server/robot_session.py
index 410016b..649159a 100644
--- a/server/robot_session.py
+++ b/server/robot_session.py
@@ -64,7 +64,7 @@ class RobotSession(server.LanguageSession):
passed, hints = problem_module.test(program)
if passed:
session = server.user_session.get_session_by_id(sid)
- session.update_solution(problem_id, done=True)
+ session.update_solution(problem_id, solution=program, done=True)
except AttributeError as ex:
hints = [{'id': 'system_error', 'args': {'message': 'test function does not exist'}}]