Ejemplo n.º 1
0
def add_grade():
    print("请填写班级信息:")
    grade_name = input("名称:")

    print("选择学校:")
    data.print_schools()
    school_name = input("学校名:")
    school = data.get_school(school_name)
    if school == None:
        print("学校选择错误")
        return

    print("选择老师:")
    data.print_teachers()
    teacher_name = input("老师名:")
    teacher = data.get_teacher(teacher_name)
    if teacher == None:
        print("老师选择错误")
        return

    print("选择课程:")
    data.print_courses()
    course_name = input("课程名:")
    course = data.get_course(course_name)
    if course == None:
        print("课程选择错误")
        return

    grade = school.create_grade(grade_name, teacher, course)
    data.update_grade(grade)
    data.update_school(school)
Ejemplo n.º 2
0
def modify_score():
    print("选择老师:")
    data.print_teachers()
    teacher_name = input("老师名:")
    teacher = data.get_teacher(teacher_name)
    if teacher == None:
        print("老师选择错误")
        return

    print("选择学生:")
    teacher.show_students()
    student_name = input("学生名:")
    student = data.get_student(student_name)
    if student == None:
        print("学生选择错误")
        return

    score = input("请输入分数:")
    if not score.isdigit() or 0 > int(score) or int(score) > 100:
        print("输入分数不正确")
        return

    teacher.modify_score(student, score)
    data.update_teacher(teacher)
    data.update_student(student)
    data.update_grade(teacher.grade)
    print("%s 的成绩修改为: %s" %
          (student.name, data.get_student(student_name).score))
Ejemplo n.º 3
0
def show_teacher():
    print("选择老师:")
    data.print_teachers()
    teacher_name = input("老师名:")
    teacher = data.get_teacher(teacher_name)
    if teacher == None:
        print("老师选择错误")
        return

    teacher.show_info()
Ejemplo n.º 4
0
def choose_grade():
    print("选择老师:")
    data.print_teachers()
    teacher_name = input("老师名:")
    teacher = data.get_teacher(teacher_name)
    if teacher == None:
        print("老师选择错误")
        return

    print("选择班级:")
    data.print_grades()
    grade_name = input("班级名:")
    grade = data.get_grade(grade_name)
    if grade == None:
        print("班级选择错误")
        return

    teacher.choose_grade(grade)
    data.update_teacher(teacher)