summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-08-26 22:55:53 +0200
committerAleš Smodiš <aless@guru.si>2015-08-26 22:55:53 +0200
commit33a1aee5c3c3af524cc56056590643af3b127558 (patch)
treed63ab5d3274a7a9284003743cc742220eb834a9c /server
parent11872a9610b03f80442e0ee3e6d5041dc72c7812 (diff)
Implemented activity service (auto-saving of traces and solutions).
Diffstat (limited to 'server')
-rw-r--r--server/prolog_session.py7
-rw-r--r--server/user_session.py2
2 files changed, 5 insertions, 4 deletions
diff --git a/server/prolog_session.py b/server/prolog_session.py
index 2c2d690..768f820 100644
--- a/server/prolog_session.py
+++ b/server/prolog_session.py
@@ -37,8 +37,7 @@ class PrologSession(object):
No properties are accessible; use getters and setters instead.
Values are passed by value instead of by reference (deep copy!).
"""
- def __init__(self, user_session):
- self._user_session = user_session # the owning session
+ def __init__(self):
self._access_lock = threading.Lock()
self._engine_id = None
self._problem_id = -1
@@ -120,5 +119,7 @@ class PrologSession(object):
more_messages, status, have_more = self.query(query)
messages.extend(more_messages)
self._problem_id = problem_id
-# self._user_session.update_solution(problem_id, [], program) # TODO
return messages, status, have_more
+
+ def get_problem_id(self):
+ return self._problem_id
diff --git a/server/user_session.py b/server/user_session.py
index d8cdf1d..d5aec44 100644
--- a/server/user_session.py
+++ b/server/user_session.py
@@ -50,7 +50,7 @@ class UserSession(object):
def get_prolog(self):
with self._access_lock:
if self.prolog_session is None:
- self.prolog_session = prolog_session.PrologSession(self) # lazy init
+ self.prolog_session = prolog_session.PrologSession() # lazy init
return self.prolog_session
def get_problem_data(self, language, problem_group, problem):