def leaderboard(phone_num): well = 'Anushree' poorly = 'Anita' send_sms( phone_num, 'Today in your community, %s is doing really well with %d courses completed. If you see her around, tell her congratulations! If you see %s around, make sure to encourage her to continue working with teachHer!' % (well, 10, poorly))
def ans_verify(phone_num, message): # TODO: set taking_quiz = False # TODO: query the answers if ans.lower() != message.lower(): send_sms(phone_num, 'Sorry the answer was incorrect') else: send_sms(phone_num, 'Congratulations! You have entered the correct answer :)')
def prize(phone_num): send_sms( phone_num, 'Congratulations! You received a 10 SDG reward for all of your hard work. Please visit Parker, your community member for your confirmation code and enter it!' ) send_sms( '+16177101266', 'Hi Parker! A member of your community, %s has earned a reward through teachHer. Please give her the code %d when you see her so she can redeem her prize! Thanks for your help.' % (users[phone_num][0], conf_code))
def ans_verify(phone_num, message): # set taking_quiz = False users[phone_num][3] = False # query the answers if ans[course_num][class_num + 1] != [x.upper() for x in message.split(",")]: send_sms(phone_num, 'Sorry the answer was incorrect') else: send_sms( phone_num, 'Congratulations! You have entered the correct answer. You are learning so much!' ) # update the status of the phone number in db users[phone_num][2] += 1 print(users[phone_num][2]) to_send = lessons[users[phone_num][1]][ users[phone_num][2] + 1] # TODO: query the class information send_sms(phone_num, to_send)
def quiz(phone_num): to_send = query_quiz_content(course_num + 1, class_num + 1) # send_sms(phone_num, to_send)
def resume(phone_num): to_send = query_class_content(course_num + 1, class_num + 1) # TODO: query the class information send_sms(phone_num, to_send)
def help(phone_num): assist = '+16177101267' send_sms(phone_num, 'Please contact this number for furthuer assistance: %s' % assist)
def progress(phone_num): send_sms( phone_num, 'Current progress is at %s class number %s' % (courses[course_num], class_num))
def in_db(phone_num): send_sms( phone_num, 'Hi! Welcome to Education.Go, an on-the-go education system. To see all the courses that are available, type "C". If you need help, type "HELP". To return to the home text, type HOME.' )
def not_in_db(phone_num): send_sms( phone_num, 'Sorry this phone number is currently not registered in our database. Please contact a local refugee camp manager to sign up :)' )
def put_money(phone_num): send_sms( phone_num, 'We have deposited the 10 SDG reward in your parents account through MPesa. Keep up all the hard work!' )
def quiz(phone_num): to_send = quiz_content[course_num][class_num + 1] send_sms(phone_num, to_send)
def welcome_arabic(phone_num): send_sms( phone_num, 'مرحبا! مرحبا بكم في تيتشير، وهو نظام التعليم على الحركة والتنقل مصممة للنساء. شكرا للتسجيل في دورات اللغة الإنجليزية. لمشاهدة جميع الدورات المتوفرة، اكتب "C". إذا كنت بحاجة إلى مساعدة، اكتب "هيلب". للعودة إلى النص الرئيسي، اكتب هوم.' )
def welcome_english(phone_num): send_sms( phone_num, 'Hi! Welcome to teachHer, an on-the-go education system designed for women. Thanks for registering for courses in English. To see all the courses that are available, type "C". If you need help, type "HELP". To return to the home text, type HOME.' )
def resume(phone_num): to_send = lessons[course_num][class_num + 1] send_sms(phone_num, to_send)