Exemple #1
0
 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')
Exemple #2
0
 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')
Exemple #3
0
 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))
Exemple #4
0
 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()
Exemple #5
0
 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})
Exemple #6
0
 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})
Exemple #7
0
 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)
Exemple #8
0
 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))
Exemple #9
0
 def POST(self):
     i = web.input()
     attempt_id = i.attempt_id
     if i.finished == '1':
         model.save_attempt(attempt_id)
     raise web.seeother('../dashboard')
Exemple #10
0
 def GET(self):
     raise web.seeother('/')
Exemple #11
0
	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))
Exemple #12
0
	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))
Exemple #13
0
	def POST(self):
		i = web.input()
		attempt_id = i.attempt_id
		if i.finished == '1':
			model.save_attempt(attempt_id)
		raise web.seeother('../dashboard')
Exemple #14
0
	def GET(self): raise web.seeother('/')

class Test: