summaryrefslogtreecommitdiff
path: root/server/user_session.py
diff options
context:
space:
mode:
Diffstat (limited to 'server/user_session.py')
-rw-r--r--server/user_session.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/user_session.py b/server/user_session.py
index 63d3459..af28046 100644
--- a/server/user_session.py
+++ b/server/user_session.py
@@ -433,6 +433,13 @@ class UserSession(object):
results.extend(group_results)
return results
+ def get_solutions(self, problem_ids):
+ uid = self.get_uid()
+ solutions = {s.problem_id: s.content for s in Solution.filter(codeq_user_id=uid)
+ if s.problem_id in problem_ids}
+ # return solutions in the same order as in [problem_pids]
+ return [solutions[pid] for pid in problem_ids if pid in solutions]
+
def send(self, json_obj):
"""Sends a message to the user.