示例#1
0
def main():
    print('Welcome!')
    entry=None
    while entry!='2':
        entry = input('\n1. Current Student\n2. New Student\n3. Quit\nPlease, enter 1, 2 or 3: ')

        if entry=='1':
            student_dashboard = Dashboard.StudentDashboard()
            email = input('\nEnter Your Email: ')
            pw = input('Enter Your Password: '******'\nWhat Would You Like To Do?')

                while entry!='2':
                    entry = input('\n1. Register To Course\n2. Logout\nPlease, enter 1 or 2: ')

                    if entry=='1':
                        show_all_courses(course_list)
                        course_id = input('\nSelect Course By ID Number: ')
                        print("\nAttempting to Register...")
                        if attending_dashboard.register_student_to_course(email, course_id, course_list):
                            show_my_courses(student, course_list)
                    elif entry=='2':
                        print('\nYou Have Been Logged Out.')
                    else:
                        print('\nInvalid Option...')


            else:
                print('\nWrong Credentials!')
        elif entry=='2':
            print("Welcome to the school!")
            student_dashboard = Dashboard.StudentDashboard()
            email = input('Please provide your email : ')
            if not student_dashboard.get_student_by_email(email):
                name     = input("What is your full name? : ")
                password = input("What would you like your password to be? : ")
                student_dashboard.add_new_student(email, name, password)
                entry = '-1'
                continue;
            else:
                print("That email is already taken")

        elif entry=='3':
            print("Programming is closing, ")
            break;
        else:
            print('Invalid Option...')
    print('\nClosing Program. Goodbye.')