def POST(self): i = web.input() firstname = i.firstname lastname = i.lastname student_id = model.get_student(firstname, lastname)['id'] session.student_id = student_id web.seeother('/dashboard')
def GET(self): i = web.input() test_id = i.test_id student_id = web.ctx.session['student_id'] attempt_id = model.start_new_attempt(test_id, student_id) raise web.seeother('/test?attempt_id=%s&test_id=%s' % (attempt_id, test_id))
def POST(self): i = web.input() password = i.password if password == "HardTaught": web.ctx.session["admin_logged_in"] = True raise web.seeother("/") else: return render.admin()
def GET(self): i = web.input() question_id = i["question_id"] print "question id is", question_id question = model.get_question(question_id) print "Question is", question topic_id = question["topic_id"] action = i.action if action == "delete": model.delete_question(question_id) raise web.seeother("questions?topic_id=%(id)s" % {"id": topic_id})
def POST(self): i = web.input() questions = i["file"] topic_id = i["topic_id"] model.upload_questions(topic_id, questions) raise web.seeother("/questions?topic_id=%(id)s" % {"id": topic_id})
def GET(self): if not web.ctx.session.get("admin_logged_in"): raise web.seeother("/login") topics = model.get_topics() return render.admin_dashboard(topics)
def GET(self): i = web.input() attempt_id = i.attempt_id test_id = i.test_id raise web.seeother('/test?attempt_id=%s&test_id=%s' % (attempt_id, test_id))
def POST(self): i = web.input() attempt_id = i.attempt_id if i.finished == '1': model.save_attempt(attempt_id) raise web.seeother('../dashboard')
def GET(self): raise web.seeother('/')
def GET(self): i = web.input() attempt_id = i.attempt_id test_id = i.test_id raise web.seeother('/test?attempt_id=%s&test_id=%s'%(attempt_id, test_id))
def GET(self): i = web.input() test_id = i.test_id student_id = web.ctx.session['student_id'] attempt_id = model.start_new_attempt(test_id, student_id) raise web.seeother('/test?attempt_id=%s&test_id=%s'%(attempt_id, test_id))
def GET(self): raise web.seeother('/') class Test: