Ejemplo n.º 1
0
def choose_school():
    while True:
        print('欢迎来到选择学校界面')

        school_list = common_interface.get_school_list()
        for k, v in enumerate(school_list):
            print(f'{k} {v}')

        school_choice = input('请选择学校,或按q退出>>>').strip()
        if school_choice == 'q':
            break
        if not school_choice.isdigit():
            print('请输入数字')
            continue
        school_choice = int(school_choice)
        if school_choice not in range(len(school_list)):
            print('请输入正确的数字')
            continue
        school_name = school_list[school_choice]
        flag, msg = student_interface.choose_school_interface(
            student_info['user'], school_name)
        if flag:
            print(msg)
            break
        else:
            print(msg)
            break
Ejemplo n.º 2
0
def create_course(): # 创建课程要先选择学校,判断学校的课程列表里面有没有课程
    while True:
        print('欢迎来到创建课程界面')

        school_list = common_interface.get_school_list()
        for k, v in enumerate(school_list):
            print(f'{k} {v}')

        school_choice = input('请选择学校,或q退出>>>').strip()
        if school_choice == 'q':
            break
        if not school_choice.isdigit():
            print('请输入数字')
            continue
        school_choice = int(school_choice)
        if school_choice not in range(len(school_list)):
            print('请输入正确的数字')
            continue
        school_name = school_list[school_choice]
        course_name = input('请输入课程名>>>').strip()
        flag, msg,  = admin_interface.create_course_interface(
            admin_info['user'], course_name,school_name)
        if flag:
            print(msg)
            break
        else:
            print(msg)
            break
Ejemplo n.º 3
0
def create_course():
    """
    创建课程
    """
    while True:
        # 1获取学校列表
        school_list = common_interface.get_school_list()

        if not school_list:
            print("学校不存在")

        # 2打印学校列表
        for inex, school in enumerate(school_list):
            print(inex, school)

        # 3 选择学校
        choise = input("请输入学校编号")
        if choise == 'q':
            break

        if not choise.isdigit():
            print("学校不存在")
            continue

        choise = int(choise)
        if choise not in range(len(school_list)):
            print("学校不存在")
            continue
        # 3 逻辑判断
        school_name = school_list[choise]
        course_name = input("请输入课程名称")

        flag, msg = admin_interface.create_course_interface(
            admin_info.get('user'), school_name, course_name)
        if flag:
            print(msg)
            break
        else:
            print(msg)
            break
Ejemplo n.º 4
0
def choose_school():
    """
    学生选择学校
    """
    while True:
        # 1 获取学校信息列表
        school_list = common_interface.get_school_list()
        if not school_list:
            print("学校不存在")

        # 2 打印课程信息
        for inex, school in enumerate(school_list):
            print(inex, school)

        # 3 选择学校
        choise = input("请输入学校编号")
        if choise == 'q':
            break

        if not choise.isdigit():
            print("学校不存在")
            continue

        choise = int(choise)
        if choise not in range(len(school_list)):
            print("用户不存在")
            continue

        # 3 选择学校
        school_name = school_list[choise]
        flag, msg = student_interface.choose_school_interface(
            student_info.get('user'), school_name)
        if flag:
            print(msg)
            break
        else:
            print(msg)
            break
Ejemplo n.º 5
0
def choice_school():
    print("choice_school...")

    school_list = common_interface.get_school_list()
    if not school_list:
        print("没有学校")
        return

    for i, school in enumerate(school_list):
        print(f"学校编号:{i} {school}")

    index = input("请输入选择的学校编号")

    if index.isdigit() and int(index) in range(len(school_list)):
        index = int(index)

        school_name = school_list[index]
        flag = student_interface.choice_school_interface(user_dic["user"],school_name)
        if flag:
            print(f"选择学校成功 {school_name}")

    else:
        print("输入错误")