Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of https://github.com/nitcalicut/tuxofwar

  • Loading branch information...
commit d1af882f91dc4a2a6160542965fd2a4e098f54f9 2 parents 584f8ba + ad87b9c
@jaseemabid jaseemabid authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 index.py
View
11 index.py
@@ -46,6 +46,16 @@ def get(self):
int(userdb.userPermutation(int(self.request.get('question')))),
self.request.get('answer')))
+class contestActiveuser(webapp.RequestHandler):
+ def get(self):
+ self.response.headers['Content-Type'] = 'application/json'
+ user = users.get_current_user()
+ if user:
+ self.response.out.write("{ \"name\" : \""+user.nickname()+"\" }")
+ else:
+ self.response.out.write("{ \"name\" : \"NULL\" }")
+
+
class adminQuestionsAdd(webapp.RequestHandler):
def get(self):
if users.get_current_user():
@@ -131,6 +141,7 @@ def get(self):
('/contest/stop/',contestStop),
('/contest/question/(\d*)|/', contestQuestion),
('/contest/answer/', contestAnswer),
+ ('/contest/activeuser/', contestActiveuser),
('/admin/questions/add/', adminQuestionsAdd),
('/admin/questions/submit/', adminQuestionsSubmit),
('/admin/questions/list/',adminQuestionsList),
Please sign in to comment.
Something went wrong with that request. Please try again.