コード例 #1
0
ファイル: test.py プロジェクト: orestv/pytester
	def POST(self):
		i = web.input()
		attempt_id = i.attempt_id
		question_id = i.question_id
		answers = i.answers.strip(',').split(',')
		model.update_answers(web.ctx.session['student_id'], attempt_id, question_id, answers)
		pass
コード例 #2
0
ファイル: test.py プロジェクト: orestv/pytester
 def POST(self):
     i = web.input()
     attempt_id = i.attempt_id
     question_id = i.question_id
     answers = i.answers.strip(',').split(',')
     model.update_answers(web.ctx.session['student_id'], attempt_id,
                          question_id, answers)
     pass
コード例 #3
0
ファイル: flaskr.py プロジェクト: orestv/pytester
def update_answers():
    if not (loggedin() and all(key in request.form for key in ["question_id", "attempt_id", "answers"])):
        return ""
    student_id = session["student_id"]
    question_id = request.form["question_id"]
    attempt_id = request.form["attempt_id"]
    answers = request.form["answers"]
    answers = answers.strip(",").split(",")
    model.update_answers(student_id, attempt_id, question_id, answers)
    if request.method == "GET":
        return redirect(url_for("dashboard"))
    return ""
コード例 #4
0
ファイル: flaskr.py プロジェクト: orestv/pytester
def update_answers():
    if not (loggedin() \
            and all(key in request.form for key in \
            ['question_id',\
            'attempt_id',\
            'answers'])):
        return ''
    student_id = session['student_id']
    question_id = request.form['question_id']
    attempt_id = request.form['attempt_id']
    answers = request.form['answers']
    answers = answers.strip(',').split(',')
    model.update_answers(student_id, attempt_id, question_id, answers)
    if request.method == 'GET':
        return redirect(url_for('dashboard'))
    return ''