Beispiel #1
0
def amend_student_score():
    """
	修改学生成绩
	:return:
	"""
    course_list = common_interface.check_all_file('course')
    if not course_list:
        print('请联系管理员创建课程')
        return
    while True:
        for k, course in enumerate(course_list):
            print('%s: %s' % (k, course))
        auth = input('请选择课程或者q退出:').strip()
        if auth == 'q': break
        if auth.strip().isdigit():
            auth = int(auth)
            if auth < len(course_list):
                student_list = common_interface.check_all_file('student')
                if not student_list:
                    print('请联系管理员招聘学生')
                    return
                while True:
                    for k, student in enumerate(student_list):
                        print('%s: %s' % (k, student))
                    choice = input('请选择要修改的学生序号或者输入q退出:').strip()
                    if choice == 'q': break
                    if choice.strip().isdigit():
                        choice = int(choice)
                        if choice < len(student_list):
                            sum = input('请输入你要打的分数:').strip()
                            if not sum.isalnum():
                                print('必须是数字')
                                continue
                            flag, msg = teacher_interface.amend_student_score_interface(
                                teacher_name['name'], course_list[auth],
                                student_list[choice], sum)
                            if flag:
                                print(msg)
                                break
                            else:
                                print(msg)

                        else:
                            print('输入非法')
                    else:
                        print('请输入序列号')
            else:
                print('输入非法')
        else:
            print('请输入序列号')
Beispiel #2
0
def choose_school():
    """
	选择学校
	:return:
	"""
    school_list = common_interface.check_all_file('school')
    if not school_list:
        print('请联系管理员创建学校')
        return
    while True:
        for k, school in enumerate(school_list):
            print('%s: %s' % (k, school))
        choice = input('请选择学校序列号或者输入q退出:').strip()
        if choice == 'q': break
        if choice.strip().isalnum():
            choice = int(choice)
            if choice < len(school_list):
                flag, msg = student_interface.choose_school_interface(
                    student_name['name'], school_list[choice])
                if flag:
                    print(msg)
                    break
                else:
                    print(msg)

            else:
                print('输入非法')
        else:
            print('请输入数字')
Beispiel #3
0
def check_scores():
    """
	查看成绩
	:return:
	"""
    course_list = common_interface.check_all_file('course')
    if not course_list:
        print('没有课程,请联系管理员')
        return
    while True:
        for k, course in enumerate(course_list):
            print('%s : %s' % (k, course))
        choice = input("请选择课程或者输入q退出:").strip()
        if choice == 'q': break
        if choice.strip().isalnum():
            choice = int(choice)
            if choice < len(course_list):
                msg = student_interface.check_scores_interface(
                    student_name['name'], course_list[choice])
                print(msg)
                break
            else:
                print('输入非法')
        else:
            print('请输入序列号')
Beispiel #4
0
def create_course():
    print("欢迎来到创建课程界面!".center(30, '*'))
    while True:
        school_list = common_interface.check_all_file('school')
        if not school_list:
            print("还未创建学校!")
            break
        print('=' * 30)
        for index, school in enumerate(school_list):
            print("编号:%s  学校:%s" % (index, school))
        print('=' * 30)
        choice = input("请输入学校编号:")
        if not choice.isdigit():
            print("请输入数字!")
            continue
        choice = int(choice)
        if not (choice >= 0 and choice < len(school_list)):
            print("请输入合法编号!")
        school_name = school_list[choice]
        course_name = input("请输入要创建的课程名:")
        flag, msg = admin_interface.create_course_interface(
            admin_info['name'], school_name, course_name)
        if flag:
            print(msg)
            break
        else:
            print(msg)
Beispiel #5
0
def create_course():
    """
	创建课程
	:return:
	"""
    school_list = common_interface.check_all_file('school')
    if not school_list:
        print('请联系管理员创建学校')
        return
    while True:
        for k, school in enumerate(school_list):
            print('%s:%s' % (k, school))
        choice = input("请选择学校或者q退出:").strip()
        if choice == 'q': break
        if choice.isdigit():
            choice = int(choice)
            if choice < len(school_list):
                course_name = input('请输入需要创建的课程:').strip()
                if not course_name: continue
                flag, msg = admin_interface.create_course_interface(
                    admin_name['name'], school_list[choice], course_name)
                if flag:
                    print(msg)
                    break
                else:
                    print(msg)
            else:
                print('输入非法')

        else:
            print('请输入数字')
Beispiel #6
0
def check_course_student():
    """
	查看课程下的学生
	:return:
	"""
    course_list = common_interface.check_all_file('course')
    if not course_list:
        print('请联系管理员创建课程')
        return
    while True:
        for k, course in enumerate(course_list):
            print('%s: %s' % (k, course))
        chioce = input('请选择课程或者q退出:').strip()
        if chioce == 'q': break
        if chioce.strip().isdigit():
            chioce = int(chioce)
            if chioce < len(course_list):
                msg = teacher_interface.check_course_student_interface(
                    course_list[chioce])
                print(msg)
                return
            else:
                print('输入非法')
        else:
            print('请输入序列号')
Beispiel #7
0
def choose_course():
    """
	选择教授的课程
	:return:
	"""
    course_list = common_interface.check_all_file('course')
    if not course_list:
        print('请联系管理员创建课程')
        return
    while True:
        for k, course in enumerate(course_list):
            print('%s: %s' % (k, course))
        chioce = input('请选择课程或者q退出:').strip()
        if chioce == 'q': break
        if chioce.strip().isdigit():
            chioce = int(chioce)
            if chioce < len(course_list):
                flag, msg = teacher_interface.choose_course_interface(
                    teacher_name['name'], course_list[chioce])
                if flag:
                    print(msg)
                    break
                else:
                    print(msg)

            else:
                print('输入非法')
        else:
            print('请输入序列号')
Beispiel #8
0
def choose_course():
    """
	选择课程
	:return:
	"""
    school_list = common_interface.check_all_file('school')
    if not school_list:
        print('请联系管理员创建学校')
        return
    while True:
        for k, school in enumerate(school_list):
            print('%s: %s' % (k, school))
        auth = input('请选择学校序列号或者输入q退出:').strip()
        if auth == 'q': break
        if auth.strip().isalnum():
            auth = int(auth)
            if auth < len(school_list):
                course_list = common_interface.check_all_file('course')
                if not course_list:
                    print('没有课程,请联系管理员')
                    return
                while True:
                    for k, course in enumerate(course_list):
                        print('%s : %s' % (k, course))
                    choice = input("请选择课程或者输入q退出:").strip()
                    if choice == 'q': break
                    if choice.strip().isalnum():
                        choice = int(choice)
                        if choice < len(course_list):
                            flag, msg = student_interface.choose_course_interface(
                                school_list[auth], student_name['name'],
                                course_list[choice])
                            if flag:
                                print(msg)
                                break
                            else:
                                print(msg)
                        else:
                            print('输入非法')
                    else:
                        print('请输入序列号')
            else:
                print('输入非法')
        else:
            print('请输入序列号')
Beispiel #9
0
def check_all_course():
    """
	查看所有课程
	:return:
	"""

    course_list = common_interface.check_all_file('course')
    if not course_list:
        print('请联系管理员创建课程')
        return
    for k in course_list:
        print(k)
def get_all_course(course):
    course_list = common_interface.check_all_file(course)
    if not course_list:
        return False
    return course_list