Exemplo n.º 1
0
def create_teacher():
    '''
    创建老师功能
    :return:
    '''
    # 先拿到学校的所有名字
    state, school_obj = common_func.choose_school_obj()
    if state:
        while True:
            teacher_name = input('请输入要创建的老师名(q退出)>>>:').strip()
            if teacher_name == 'q':
                return
            teacher_gender = input('请输入老师性别>>>:').strip()
            teacher_age = input('请输入老师年龄>>>:').strip()
            if teacher_name and teacher_gender and teacher_age:
                state, msg = admin_interface.create_teacher(
                    teacher_name, teacher_gender, teacher_age, school_obj)
                if state:
                    print(msg)
                    return
                else:
                    print(msg)
            else:
                print('输入内容不能为空')
    else:
        print(school_obj)
Exemplo n.º 2
0
def create_teacher():
    print('----------创建老师-------')
    print('请先选择校区')
    campus_list = admin_interface.check_campus()
    if not campus_list:
        return False
    while True:
        campus_id = input('请选择校区(编号):').strip()
        if campus_id == 'q': return False
        if campus_id.isdigit() and int(campus_id) < len(campus_list):
            campus_id = int(campus_id)
            break
    while True:
        name = input('请输入老师登录名:').strip()
        if name == 'q': return False
        pwd = input('请输入老师登录密码:').strip()
        if pwd == 'q': return False

        flag, message = admin_interface.create_teacher(
            login_data['name'],
            campus_list[campus_id],
            name,
            pwd,
        )
        print(message)
        print()
        if flag:
            break
Exemplo n.º 3
0
def create_teacher():
    print('欢迎创建老师')

    while True:
        username = user_info['username']
        teacher_name = input('请输入老师名字>>>').strip()

        flag, msg = admin_interface.create_teacher(username, teacher_name)
        if flag:
            print(msg)
            break
        else:
            print(msg)
Exemplo n.º 4
0
def create_teacher():
    while True:
        name = input('please input teacher name>:').strip()
        password = input('please input password>>:').strip()
        pwd = input('please confirm password>>:').strip()
        if password == pwd:
            flag, msg = admin_interface.create_teacher(name, password,
                                                       user_data['name'])
            if flag:
                print(msg)
                break
            else:
                print(msg)
        else:
            print('password confirm faliure')
Exemplo n.º 5
0
def creat_teacher():
    '''创建老师:输入教师姓名,列出校区列表,选择一个校区,得到校区名字,将名字和校区名给接口'''
    while True:
        name = input('请输入教师的姓名: ').strip()
        if name == 'q': return
        if name is None:
            print('姓名不能为空!')
            continue
        scName = common.select_school()
        obj = admin_interface.create_teacher(name, scName, '123')
        if obj:
            print('创建成功')
            break
        else:
            print('教师已经存在')
Exemplo n.º 6
0
def admin_create_teacher():
    # 老师  姓名  密码   教授的课程
    teacher_name = input("请输入老师的名称:").strip()
    teacher_password = input("请输入老师的密码:").strip()
    teacher_school = input("请输入老师所在的学校:").strip()

    res, msg = admin_interface.create_teacher(teacher_name,
                                              teacher_password,
                                              teacher_school,
                                              admin_dic=login_admin_dic)

    if res:
        print(msg)
        return
    else:
        print(msg)
Exemplo n.º 7
0
def create_teacher():
    while True:
        tch_input = input('请输入教师名:').strip()
        if tch_input == '':
            print('教师名不能为空。')
        else:
            break
    while True:
        pw_input = input('请输入密码:').strip()
        if pw_input == '':
            print('密码不能为空。')
            continue
        pw_re_input = input('请再次输入密码:').strip()
        if pw_input != pw_re_input:
            print('两次输入的密码不一致。')
        else:
            break
    flg, msg = admin_interface.create_teacher(user_logged, tch_input, pw_input)
    print(msg)