diff --git a/notes_tools/reports/term_reports.py b/notes_tools/reports/term_reports.py index 56a0904..88a8671 100755 --- a/notes_tools/reports/term_reports.py +++ b/notes_tools/reports/term_reports.py @@ -25,7 +25,7 @@ def term_info(classe, ds_df): eval_info["Trimestre"] = ds_df["Trimestre"].unique()[0] return eval_info -def build_target_name(classe, term, path = Path("./")): +def build_target_name(classe, term_num, path = Path("./")): """ Build the path where the .tex will be sored >>> build_target_name("312", "DS1") @@ -33,9 +33,9 @@ def build_target_name(classe, term, path = Path("./")): >>> build_target_name("312", "DS1", Path("plop/")) Path('plop/312/report_DS1.tex') """ - return Path(path + "/{cls}/report_T{term}.tex".format(cls=classe, term=term)) + return Path(path + "/{cls}/report_T{term_num}.tex".format(cls=classe, term_num=term_num)) -def term_report(classe, term, path = Path('./'), +def term_report(classe, term_num, path = Path('./'), template = "tpl_reports_term.tex"): """ Generate the report of a evaluation for a class @@ -51,7 +51,7 @@ def term_report(classe, term, path = Path('./'), flat_df = extract_flat_marks(ws) logger.info("Worksheets parsed") - term_df = flat_df[flat_df['Trimestre'] == term] + term_df = flat_df[flat_df['Trimestre'] == term_num] quest_df, exo_df, eval_df = digest_flat_df(term_df) #conn_df = exo_df[exo_df["Nom"].str.contains('Conn')] @@ -66,7 +66,7 @@ def term_report(classe, term, path = Path('./'), "students":students_pov, } - target = build_target_name(classe, term, path) + target = build_target_name(classe, term_num, path) feed_template(target, datas, template)