コード例 #1
0
ファイル: groupStudents.py プロジェクト: Aniltilanthe/sCool
def update_download_link__details_student(studentSelected, studentSelectedDate,
                                          groupMain):
    defaultValues = ["", "disabled"]

    if not util.isValidValueId(groupMain) or not util.isValidValueId(
            studentSelected):
        return defaultValues

    if studentSelectedDate is None or studentSelectedDate == '':
        studentSelectedDate = ''

    #    the student is not in the group
    if not isStudentInGroup(studentSelected, groupMain):
        return defaultValues

    csv_string = ""
    try:
        csv_string = util.get_download_link_data_uri(
            getStudentData(int(studentSelected), int(groupMain),
                           format(studentSelectedDate)))
    except Exception as e:
        print('groupStudents update_download_link__details_student ')
        print(e)

    return csv_string, ""
コード例 #2
0
ファイル: groupStudents.py プロジェクト: Aniltilanthe/sCool
def onSelectFeatureOverview(selectedFeatures, studentSelected, groupSelected):
    graphs = []

    if not util.isValidValueId(groupSelected) or not util.isValidValueId(
            studentSelected):
        return html.Div(graphs)

    graphs = plotStudentOverviewFeatures(int(studentSelected),
                                         int(groupSelected), selectedFeatures)

    return html.Div(graphs)
コード例 #3
0
ファイル: groupStudents.py プロジェクト: Aniltilanthe/sCool
def display_graphs_student_overview(studentSelected, groupSelected):
    graphs = []

    if not util.isValidValueId(groupSelected) or not util.isValidValueId(
            studentSelected):
        return html.Div(graphs)

    if not isStudentInGroup(studentSelected, groupSelected):
        return graphs

    graphs = plotStudentOverview(int(studentSelected), int(groupSelected))

    return html.Div(graphs)
コード例 #4
0
ファイル: groupStudents.py プロジェクト: Aniltilanthe/sCool
def display_graphs_student(studentSelected, studentSelectedDate,
                           studentGraphDirection, groupSelected):
    graphs = []

    if not util.isValidValueId(groupSelected) or not util.isValidValueId(
            studentSelected):
        return html.Div(graphs)

    if studentSelectedDate is None or studentSelectedDate == '':
        studentSelectedDate = ''

    graphs = plotStudent(int(studentSelected), int(groupSelected),
                         format(studentSelectedDate), studentGraphDirection)

    return html.Div(graphs)
コード例 #5
0
def update_bar(n_clicks, groupMain, selectedFeature, selectedFeature1, selectedFeature3, selectedAxis, 
               selectedFigureType, 
               selectedDistribution,
               selectedFeatureColorGroupBy,
               selectedFeatureColorGroupBySub,
               selectedFeatureMulti,
               containerChildren 
               ):    
    graphs = []
    
    if n_clicks == 0 or  not util.isValidValueId(groupMain) :
        return html.Div(graphs)
    
    if   not ( selectedFeature1 ) :
        selectedFeature1 = ''
    
    if   not ( selectedFeature3 ) :
        selectedFeature3 = ''
        
    
    graphs = plotClassOverview( int(groupMain), selectedFeature, selectedAxis, selectedFigureType, selectedFeature1, selectedFeature3,
                               selectedDistribution         = selectedDistribution,
                               selectedFeatureMulti         = selectedFeatureMulti,
                               groupBy  = selectedFeatureColorGroupBy, 
                               groupBySub                   = selectedFeatureColorGroupBySub,   )
    
    if not(None is containerChildren):
        if isinstance(containerChildren, list):
            graphs = graphs + containerChildren 
        else :
            if isinstance(containerChildren, dict) and 'props' in containerChildren.keys():
                graphs = graphs + containerChildren.get('props').get('children')


    return   graphs 
コード例 #6
0
ファイル: groupStudents.py プロジェクト: Aniltilanthe/sCool
def set_options_date(groupId):
    if util.isValidValueId(groupId):

        print('set_options_date Hey There ')
        groupDateOptions = studentGrouped.getGroupDateOptions(groupId)

        return groupDateOptions

    return []
コード例 #7
0
ファイル: groupStudents.py プロジェクト: Aniltilanthe/sCool
def setStudentDateOptions(studentSelected, groupSelected):
    defaultValue = []

    if not util.isValidValueId(groupSelected) or not util.isValidValueId(
            studentSelected):
        return defaultValue

    if not isStudentInGroup(studentSelected, groupSelected):
        return defaultValue

    dfStudentData = getStudentData(int(studentSelected), int(groupSelected))

    if dfStudentData is None or dfStudentData.empty == True:
        return defaultValue

    return [{
        'label': d,
        'value': d
    } for d in dfStudentData['Start'].dt.date.unique()]
コード例 #8
0
def update_download_link_custom_group(groupMain):
    if  not util.isValidValueId(groupMain) :
        return "", "disabled"
    
    csv_string = ""
    try:
        csv_string = util.get_download_link_data_uri( studentGrouped.getStudentsOfLearningActivityDF(int(groupMain)) )
    except Exception as e: 
        print('custom update_download_link_custom_group ')
        print(e)
    
    return csv_string, ""
コード例 #9
0
def update_download_link(groupMain, groupComparision):
    if not util.isValidValueId(groupMain):
        return ""

    csv_string = ""
    try:
        csv_string = util.get_download_link_data_uri(
            getGroupData(int(groupMain), groupComparision))
    except Exception as e:
        print('groups update_download_link__details_student ')
        print(e)

    return csv_string
コード例 #10
0
def update_bar(groupMain, groupComparision):
    graphs = []

    if not util.isValidValueId(groupMain):
        return html.Div(graphs)

    try:
        graphs = plotClassOverview(int(groupMain), groupComparision)
    except Exception as e:
        print('groups update_bar ')
        print(e)

    return html.Div(graphs, className="col")
コード例 #11
0
ファイル: groupStudents.py プロジェクト: Aniltilanthe/sCool
def setStudentOptions(groupSelected):

    if not util.isValidValueId(groupSelected):
        return []

    students = getStudentsOfLearningActivity(int(groupSelected))

    return [{
        'label': row['Name'],
        'value': row['StudentId']
    } for index, row in dfStudentDetails[dfStudentDetails[
        constants.STUDENT_ID_FEATURE].isin(students)][['StudentId', 'Name']].
            drop_duplicates(subset=['StudentId'], keep='first').iterrows()]
コード例 #12
0
def update_main_overview(groupMain):
    graphs = []

    if not util.isValidValueId(groupMain):
        return html.Div(graphs)

    try:
        graphs = plotGroupOverview(groupMain)
    except Exception as e:
        print('groups update_main_overview ')
        print(e)

    return html.Div(graphs,
                    #                     className = "width-100"
                    )