Permalink
Browse files

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

  • Loading branch information...
2 parents 5842987 + 71badb6 commit df2f9c42693b2e801eda9ff4a0341afd779221a3 @jaseemabid jaseemabid committed Oct 11, 2011
Showing with 4 additions and 3 deletions.
  1. +2 −1 index.py
  2. +2 −2 questiondb.py
View
@@ -32,12 +32,13 @@ def get(self,var):
class contestStop(webapp.RequestHandler):
def get(self):
self.response.out.write(userdb.userPlayStop())
+ self.redirect('/?end=1')
class contestQuestion(webapp.RequestHandler):
def get(self,var):
self.response.headers['Content-Type'] = 'application/json'
- r = questiondb.getQuestion(int(userdb.userPermutation(int(var))))
+ r = questiondb.getQuestion(int(userdb.userPermutation(int(var))),int(var))
self.response.out.write(r)
class contestAnswer(webapp.RequestHandler):
View
@@ -11,12 +11,12 @@ class question(db.Model):
opt4 = db.StringProperty(required=True, multiline=True)
ans = db.StringProperty(required=True)
-def getQuestion(num):
+def getQuestion(num,var):
query = question.all()
q = query.filter('questionNumber =',num).get()
if q:
return ("{"+
- "\"num\" : " + "\""+str(num)+"\""+","+
+ "\"num\" : " + "\""+str(var)+"\""+","+
"\"question\" : "+"\""+q.question.replace('\r\n','<br />')+"\""+","+
"\"image\" : "+"\""+q.qimage+"\""+","+
"\"options\" : " + "["+

0 comments on commit df2f9c4

Please sign in to comment.