summaryrefslogtreecommitdiff
path: root/server/handlers.py
diff options
context:
space:
mode:
authorMarko Pušnik <marko.pusnik@guru.si>2015-10-12 18:22:10 +0200
committerMarko Pušnik <marko.pusnik@guru.si>2015-10-12 18:22:10 +0200
commit178da7b42b34b7d985d79432f31bf32810eadec2 (patch)
tree27982522eb80d5f90a984634af6c8bb0dfb36143 /server/handlers.py
parent104a1169a275c4cc023b0cc03abed9103d1b9abd (diff)
get basic user statistics
Diffstat (limited to 'server/handlers.py')
-rw-r--r--server/handlers.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/handlers.py b/server/handlers.py
index 0b3dd46..5439d19 100644
--- a/server/handlers.py
+++ b/server/handlers.py
@@ -276,6 +276,13 @@ class EndProblem(CodeqService):
request.end()
+
+class GetUserStat(CodeqService):
+ def process(self, request):
+ stat = request.session.get_stat()
+ request.reply({'code': 0, 'stat': stat})
+
+
# maps actions to their handlers
incoming_handlers = {
'create_session': CreateSession(),
@@ -293,7 +300,8 @@ incoming_handlers = {
'update_settings': UpdateSettings(),
'test': Test(),
'load_problem': LoadProblem(),
- 'end_problem': EndProblem()
+ 'end_problem': EndProblem(),
+ 'user_stat': GetUserStat()
}