Exemplo n.º 1
0
def displayMenu(stu, db):
    role = StudentRole(stu, db)

    menu = ''
    menu += '[1]上课签到'.ljust(menu_width)
    menu += '[2]提交作业'.ljust(menu_width)
    menu += '[3]查看个人成绩'.ljust(menu_width) + os.linesep
    menu += '[4]查看成绩排名'.ljust(menu_width)
    # menu += '[88]修改密码'.ljust(menu_width)
    menu += '[99]退出'.ljust(menu_width)
    while True:

        common.menuDisplay(menu)
        choice = input('请录入菜单代码:')
        if choice == '99':
            break
        elif choice == '1':
            checkIn(role)
        elif choice == '2':
            push_job(role)
        elif choice == '3':
            queryScore(role)
        elif choice == '4':
            queryScoreList(role)
        elif choice == '5':
            cur_pwd = input('请录入旧密码:')
            new_pwd = input('请录入新密码:')
            User.Change_Password(stu.login_user, cur_pwd, new_pwd)
        else:
            pass
Exemplo n.º 2
0
def displayMenu(teacher, db):
    role = TeacherRole(teacher, db)

    menu = ''
    menu += '[1]新增班级'.ljust(menu_width)
    menu += '[2]添加学员'.ljust(menu_width)
    menu += '[3]上课安排'.ljust(menu_width) + os.linesep
    menu += '[4]记录成绩'.ljust(menu_width)
    menu += '[5]查看班级成员'.ljust(menu_width)
    # menu += '[88]修改密码'.ljust(menu_width)+os.linesep
    menu += '[99]退出'.ljust(menu_width)

    while True:
        # print('负责的课程'.center(center_width,'-'))
        # for cls in role.tec.classes_list:
        # 	print(cls)
        common.menuDisplay(menu)
        choice = input('请录入菜单代码:')
        if choice == '99':
            break
        elif choice == '1':
            classesManage(role)
        elif choice == '2':
            addStu(role)
        elif choice == '3':
            sessionArrange(role)
        elif choice == '4':
            ChangeScore(role)
        elif choice == '5':
            queryStudent(role)
        elif choice == '88':
            cur_pwd = input('请录入旧密码:')
            new_pwd = input('请录入新密码:')
            User.Change_Password(teacher.login_user, cur_pwd, new_pwd, 2)
        else:
            pass


# # unit test
# tec = model.Teacher('1', 'oldboy', 'oldboy', '','8001')
# role = TeacherRole(tec)
# displayMenu(tec)
# sessionArrange(role)