示例#1
0
文件: index.py 项目: orestv/pytester
 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')
示例#2
0
文件: index.py 项目: orestv/pytester
 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')
示例#3
0
文件: test.py 项目: orestv/pytester
 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))
示例#4
0
文件: admin.py 项目: orestv/pytester
 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()
示例#5
0
文件: admin.py 项目: orestv/pytester
 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})
示例#6
0
文件: admin.py 项目: orestv/pytester
 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})
示例#7
0
文件: admin.py 项目: orestv/pytester
 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)
示例#8
0
文件: test.py 项目: orestv/pytester
 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))
示例#9
0
文件: test.py 项目: orestv/pytester
 def POST(self):
     i = web.input()
     attempt_id = i.attempt_id
     if i.finished == '1':
         model.save_attempt(attempt_id)
     raise web.seeother('../dashboard')
示例#10
0
文件: test.py 项目: orestv/pytester
 def GET(self):
     raise web.seeother('/')
示例#11
0
文件: test.py 项目: orestv/pytester
	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))
示例#12
0
文件: test.py 项目: orestv/pytester
	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))
示例#13
0
文件: test.py 项目: orestv/pytester
	def POST(self):
		i = web.input()
		attempt_id = i.attempt_id
		if i.finished == '1':
			model.save_attempt(attempt_id)
		raise web.seeother('../dashboard')
示例#14
0
文件: test.py 项目: orestv/pytester
	def GET(self): raise web.seeother('/')

class Test: