From 8f2ae963382d309985b2e74ff27407185bde8a60 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Sun, 18 Apr 2021 09:57:53 +0200 Subject: [PATCH] Feat: add handling ppre --- recopytex/dashboard/exam_analysis/app.py | 4 ++-- recopytex/dashboard/student_analysis/app.py | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/recopytex/dashboard/exam_analysis/app.py b/recopytex/dashboard/exam_analysis/app.py index 54e36f8..e4bdc3c 100644 --- a/recopytex/dashboard/exam_analysis/app.py +++ b/recopytex/dashboard/exam_analysis/app.py @@ -192,7 +192,7 @@ def update_final_scores(data): scores = pd.DataFrame.from_records(data) try: - if scores.iloc[0]["Commentaire"] == "commentaire": + if scores.iloc[0]["Commentaire"] == "commentaire" or scores.iloc[0].str.contains("PPRE").any(): scores.drop([0], inplace=True) except KeyError: pass @@ -280,7 +280,7 @@ def update_final_scores_hist(data): def update_competence_fig(data): scores = pd.DataFrame.from_records(data) try: - if scores.iloc[0]["Commentaire"] == "commentaire": + if scores.iloc[0]["Commentaire"] == "commentaire" or scores.iloc[0].str.contains("PPRE").any(): scores.drop([0], inplace=True) except KeyError: pass diff --git a/recopytex/dashboard/student_analysis/app.py b/recopytex/dashboard/student_analysis/app.py index 1f7cc74..afc1c5b 100644 --- a/recopytex/dashboard/student_analysis/app.py +++ b/recopytex/dashboard/student_analysis/app.py @@ -191,11 +191,8 @@ def update_student_scores(tribe, student, term): except pd.errors.ParserError: pass else: - try: - if scores.iloc[0]["Commentaire"] == "commentaire": - scores.drop([0], inplace=True) - except KeyError: - pass + if scores.iloc[0]["Commentaire"] == "commentaire" or scores.iloc[0].str.contains("PPRE").any(): + scores.drop([0], inplace=True) scores = flat_df_students(scores).dropna(subset=["Score"]) scores = scores[scores["Eleve"] == student] scores = scores[scores["Trimestre"] == term]