Ejemplo n.º 1
0
def take_survey(question=None):
    print "take_survey"
    #get questions variables here and use them
    if request.method == "GET":
        
            answers = []
            tmp = db.get_answers(question)
            for i in tmp:
                answers.append(str(i))
            
            return render_template("created-form2.html",
                               question=question,
                               qtype=db.get_qtype(question),
                               answers=answers)
    else:

        answer = request.form['response']
        answerid = db.get_answer_id(question,session['username'])
        db.set_answer(answerid,answer)
        flash("Thank You!")
        return redirect(url_for("profile_page"))
Ejemplo n.º 2
0
#x = db.get_results()
#print db.get_recipient(x[0])
print db.get_recipient_questions("*****@*****.**")
print db.get_recipient_questions("Patrick")
#print "answer id"
#print x
#print x[0]
#print "ready"
#db.set_answer(x[0],'3')
#print db.get_answer(x[0])
#print db.get_recipient_questions("*****@*****.**")



forms=db.get_forms()
qtype=db.get_qtype("How do you do?")
answer=db.get_answers("How do you do?")
anon=db.get_anon("How do you do?")





#print forms
#print "How do you do?"
#print qtype
#print answer
#print anon