Example #1
0
def results():
    if request.method == "GET":
        answers = []
        tmp = db.get_recipient_answers(session['username'])
        print tmp
        for i in tmp:
            answers.append(str(i[0]))
        questions = db.get_recipient_questions(session['username'])
        return render_template("results.html",
                               questions = questions,
                               answers = answers)

    else:
        return redirect(url_for('profile_page'))
Example #2
0
db.add_form("How do you do?","Text", ['good'] , False )
db.add_form("How do you do?","mc",['hood'], False)
db.add_form("How is the weather?","mc",['good','great'], True)


id = db.get_question_id("How do you do?")
q = db.get_question(id)



#db.send_question("This should not exsist",["allo","*****@*****.**"])
db.send_question("How is the weather?",["*****@*****.**","Patrick"])
#db.send_question("What?",['*****@*****.**'])
#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?")