Beispiel #1
0
def select_user_in_end_course(courseIndex):
    tempQuery = dao.query(TestingUser).\
                filter(TestingUser.testIndex == courseIndex).subquery()

    return dao.query(User.name, tempQuery.firstLogin, tempQuery.lastLogin, tempQuery.lastLogout, tempQuery.individualInfomation).\
                join(User,
                     User.index == tempQuery.userIndex).all()
Beispiel #2
0
def select_allow_site_in_test():
    return dao.query(AllowSite.siteURL,
                     AllowSite.siteName).\
                join(AllowList,
                     AllowList.webIndex == AllowSite.index).\
                join(TestInfo,
                     TestInfo.index == AllowList.testIndex).all()
Beispiel #3
0
def select_unfinished_test_course_for_master(masterIndex):
    return dao.query(TestInfo.index,
                     TestInfo.testName,
                     TestInfo.startDate,
                     TestInfo.endDate).\
                join(Master,
                     Master.index == masterIndex).\
                filter(TestInfo.endDate > datetime.now()).all()
Beispiel #4
0
def select_ban_program_in_test():
    return dao.query(BanProgram.processName,
                     BanProgram.processPath1,
                     BanProgram.processPath2,
                     BanProgram.processPort).\
                join(BanList,
                     BanList.banIndex == BanProgram.index).\
                join(TestInfo,
                     TestInfo.index == BanList.testIndex).all()
Beispiel #5
0
def select_unfinished_test_course_for_user(userIndex):
    return dao.query(TestInfo.testName).\
                join(TestingUser,
                     TestingUser.testIndex == TestInfo.index).\
                join(User,
                     User.index == userIndex).\
                filter(TestingUser.userIndex == userIndex,
                       and_(TestInfo.endDate > datetime.now(),
                            TestInfo.startDate <= datetime.now())).all()
Beispiel #6
0
def select_master_index(masterId):
    return dao.query(Master.index).\
               filter(Master.id == masterId).first().index
Beispiel #7
0
def select_user_count(testIndex):
    return dao.query(TestingUser).\
              filter(TestingUser.testIndex == testIndex).count()
Beispiel #8
0
def select_ban_list_index(testIndex):
    return dao.query(BanList.banIndex).\
              filter(BanList.testIndex == testIndex,
                     BanList.isDeleted == 'FALSE').all()
Beispiel #9
0
def select_allow_site_list():
    return dao.query(AllowSite.siteURL,
                     AllowSite.siteName).all()
Beispiel #10
0
def select_allow_list_index(testIndex):
    return dao.query(AllowList.webIndex).\
              filter(AllowList.testIndex == testIndex,
                     AllowList.isDeleted == 'FALSE').all()
Beispiel #11
0
def select_master_email(courseName):
    return dao.query(Master.emailAddress).\
                join(TestInfo,
                     TestInfo.masterIndex == Master.index).\
                filter(TestInfo.testName == courseName).first()
Beispiel #12
0
def select_course(masterIndex):
    return dao.query(TestInfo.index).\
              filter(TestInfo.masterIndex == masterIndex).first().index   
Beispiel #13
0
def delete_allow_list_in_course(courseIndex):
    dao.query(AllowList).\
        filter(AllowList.testIndex == courseIndex).\
        update(dict(isDeleted = "TRUE"))
Beispiel #14
0
def update_user_process_info(testIndex, userIndex, processInfo):
    dao.query(TestingUser).\
        filter(TestingUser.testIndex == testIndex,
               TesingUser.userIndex == userIndex).\
        update(dict(processInformation = processInfo))
Beispiel #15
0
def select_ban_program_name(programIndex):
    return dao.query(BanProgram.programName).\
            filter(BanProgram.index == programIndex).first()
Beispiel #16
0
def delete_ban_list_in_course(courseIndex):
    dao.query(BanList).\
        filter(BanList.testIndex == courseIndex).\
        update(dict(isDeleted = "TRUE"))
Beispiel #17
0
def select_user_process_info(testIndex, userIndex):
    return dao.query(TestingUser.processInformation).\
              filter(TestingUser.testIndex == testIndex,
                     TestingUser.userIndex == userIndex).first()
Beispiel #18
0
def select_user_index(userId):
    return dao.query(User.index).\
              filter(User.id == userId).first().index
Beispiel #19
0
def select_user_info(userIndex):
    return dao.query(User.id,
                     User.name).\
              filter(User.index == userIndex).first()
Beispiel #20
0
def select_user_in_course(courseIndex, userIndex):
    return dao.query(TestingUser.index).\
              filter(TestingUser.userIndex == userIndex,
                     TestingUser.testIndex == courseIndex).first().index
Beispiel #21
0
def select_end_course_for_chart():
    return dao.query(TestInfo.index, TestInfo.masterIndex, TestInfo.testName).\
                filter(TestInfo.endDate <= datetime.now(), TestInfo.makeChart == 'FALSE').all()
Beispiel #22
0
def select_ban_list_in_test(testIndex):
    return dao.query(BanList.banIndex).all()
Beispiel #23
0
def select_master_info(masterIndex):
    return dao.query(Master.id,
                     Master.email).\
              filter(Master.index == masterIndex).first()
Beispiel #24
0
def modify_ban_list_in_course(courseIndex, banIndex):
    dao.query(BanList).\
        filter(BanList.testIndex == courseIndex,
               BanList.banIndex == banIndex).\
        update(dict(isDeleted = "FALSE"))
Beispiel #25
0
def select_master_check(masterId):
    return dao.query(Master.index,
                     Master.password).\
              filter(Master.id == masterId).first()
Beispiel #26
0
def modify_allow_list_in_course(courseIndex, webIndex):
    dao.query(AllowList).\
        filter(AllowList.testIndex == courseIndex,
               AllowList.banIndex == webIndex).\
        update(dict(isDeleted = "FALSE"))
Beispiel #27
0
def select_course_index(courseName):
    return dao.query(TestInfo.index).\
              filter(TestInfo.testName == courseName).first().index
Beispiel #28
0
def modify_course(courseName, startDate, endDate):
    dao.query(TestInfo).\
        filter(TestInfo.testName == courseName).\
        update(dict(startDate = startDate,
                    endDate = endDate)) 
Beispiel #29
0
def get_course_end_date(courseIndex):
    return dao.query(TestInfo.endDate).\
               filter(TestInfo.index == courseIndex).first().endDate