Example #1
0
def send_forms():
    if request.method == "GET":
        return render_template("director.html",
                               students = util.get_emails(),
                               forms = db.get_forms())

    else:
        #get all the checked names from send page
        tmp = request.form.getlist('student')

        students = []
        for i in tmp:
            students.append(str(i))
        print students
        
        try:
            db.send_question(str(request.form['question']),
                             students)
        except:
            print "errrrror"


        return redirect(url_for('director'))
Example #2
0
db.drop_collection2()
db.drop_collection1()

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("*****@*****.**")