Example #1
0
	def GET(self):
		scripts = ['scripts/ace/ace.js',
			'scripts/ace/mode-csharp.js',
			'scripts/ace/mode-java.js',
			'scripts/ace/mode-c_cpp.js',
			'scripts/compiler.js',
			'scripts/jquery.easing.1.3.js',
			'scripts/jqueryFileTree.js']
		styles = ['css/jqueryFileTree.css',]
		return render.layout(view.index(issigned=session.is_signed()), title='Home', scripts=scripts, styles=styles)
Example #2
0
 def GET(self):
     scripts = [
         'scripts/ace/ace.js', 'scripts/ace/mode-csharp.js',
         'scripts/ace/mode-java.js', 'scripts/ace/mode-c_cpp.js',
         'scripts/compiler.js', 'scripts/jquery.easing.1.3.js',
         'scripts/jqueryFileTree.js'
     ]
     styles = [
         'css/jqueryFileTree.css',
     ]
     return render.layout(view.index(issigned=session.is_signed()),
                          title='Home',
                          scripts=scripts,
                          styles=styles)
    def POST(self):
        
        try:
            timeout=bool(web.input()['timeout'])
        except:
            timeout=False
        try:
            name=web.input()['name']
        except:
            name=''
        try:
            answer=web.input()['answer']
        except:
            answer=''
        try:
            bonus=web.input()['bonus']
        except:
            bonus=''

        try:
            current_game=web.localsession.current_game    
        except:
            current_game=None
        
        try:    
            if current_game is None:
                if name!='':
                    current_game=game.Game(name)
                else:
                    return view.index()
            if (answer!='' or timeout or bonus!=''):
                current_game.check_answer(answer,timeout,bonus)
            question=current_game.get_question()
            web.localsession.current_game=current_game
            if current_game.is_over():
                web.localsession.kill()
            return view.quiz(current_game.username,question,current_game.is_over(), \
                             current_game.is_complete(),current_game.is_timed_out(),current_game.question_number, \
                             current_game.level,web.utils.commify(current_game.score),current_game.lifes,current_game.timer,current_game.is_special_question_enabled(),current_game.ranking,current_game.get_bonus_percentage())
        except Exception as e:
            print e
            web.localsession.kill()
            return view.oops()
 def GET(self):
     return view.index()
Example #5
0
 def GET(self, name):
     userid = session.get_user_id()
     user_data = users.get_user_by_id(userid)
     return view.base(view.index(user_data))
Example #6
0
 def GET(self):
     userid = session.get_user_id()
     user_data = users.get_user_by_id(userid)
     # print user_data
     return view.base(view.index(user_data))
Example #7
0
    def GET(self):
        i = web.input(q='')

        return view.layout(view.index(i.q))
Example #8
0
 def GET(self):
     return view.base(view.index(view.sendmail_form(sendmail_form())))