def add_grade(): print('请填写班级信息') grade_name = input('名称 :') 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 = education.School.create_grade(school, grade_name, course) education.Grade.sign_in_teacher(grade, teacher) data.update_grade(grade) data.update_school(school)
def choose_grade(): print('填写教师信息') 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) education.Grade.sign_in_teacher(grade, teacher) data.update_teacher(teacher) data.update_grade(grade)
def choose_grade(): print("选择学生:") data.print_students() student_name = input("学生名:") student = data.get_student(student_name) if student == None: print("学生选择错误") return print("选择班级:") data.print_grades() grade_name = input("班级名:") grade = data.get_grade(grade_name) if grade == None: print("班级选择错误") return student.choose_grade(grade) data.update_student(student) data.update_grade(grade)
def add_student(): print('填写学生信息') stu_name = input('学生姓名') print('选择学校') data.print_schools() sch_name = input('学校') school = data.get_school(sch_name) if school == None: print("学校选择错误") return print("选择班级:") data.print_grades() grade_name = input("班级名:") grade = data.get_grade(grade_name) if grade == None: print("班级选择错误") return student = education.Student(stu_name, school, grade) data.update_student(student) data.update_school(school) data.update_grade(grade)
def modify_score(): print('选择老师') data.print_teachers() teacher_name = input('姓名:') teacher = data.get_teacher(teacher_name) if teacher == None: print("老师选择错误") return print('选择学生') data.print_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) > 120: print("输入分数不正确") return teacher.modify_score(teacher, 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))