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 test(): if not loggedin(): return redirect("/") if not "test_id" in request.args: return redirect("/") test_id = request.args["test_id"] test = model.get_test(test_id) student_id = session["student_id"] if "continue" in request.args and "attempt_id" in request.args: attempt_id = request.args.get("attempt_id") else: attempt_id = model.start_new_attempt(test_id, student_id) return redirect("/test?continue=1&test_id=%s&attempt_id=%s" % (test_id, attempt_id)) questions = model.get_questions_for_test(attempt_id) return render_template("test.html", test_name=test["name"], attempt_id=attempt_id, questions=questions)
def test(): if not loggedin(): return redirect('/') if not 'test_id' in request.args: return redirect('/') test_id = request.args['test_id'] test = model.get_test(test_id) student_id = session['student_id'] if 'continue' in request.args and 'attempt_id' in request.args: attempt_id = request.args.get('attempt_id') else: attempt_id = model.start_new_attempt(test_id, student_id) return redirect('/test?continue=1&test_id=%s&attempt_id=%s' % (test_id, attempt_id)) questions = model.get_questions_for_test(attempt_id) return render_template('test.html', test_name=test['name'], attempt_id=attempt_id, questions=questions)
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))