Re-enable possibility to make eval report

This commit is contained in:
Benjamin Bertrand
2017-03-31 18:33:53 +03:00
parent cbac93ec0c
commit b761f47da9
2 changed files with 14 additions and 19 deletions

View File

@@ -66,29 +66,32 @@ class Student(object):
exo = self.exo_df[self.exo_df["Exercice"] == exo_name]
quest = self.quest_df[self.quest_df["Exercice"] == exo_name]
tabular = [r"\begin{tabular}{|p{2cm}|c|}"]
tabular = [r"\begin{tabular}{|p{2cm}|p{1cm}|}"]
tabular.append(r"\hline")
tabular.append(r"\rowcolor{highlightbg}")
if type(exo_name) == int:
tabular.append(f"Exercice {exo_name} & {exo['Mark_barem'].all()} \\\\")
l = f"Exercice {exo_name} & {exo['Mark_barem'].all()}"
tabular.append(l + r" \\")
else:
tabular.append(f"{exo_name} & {exo['Mark_barem'].all()} \\\\")
l = f"{exo_name} & {exo['Mark_barem'].all()}"
tabular.append(l + r" \\")
tabular.append(r"\hline")
if len(quest) > 1:
for _, q in quest.iterrows():
line = ""
if not pd.isnull(q["Question"]):
line += str(q['Question'])
line += " "+str(q['Question'])
if not pd.isnull(q["Commentaire"]):
line += str(q['Commentaire'])
line += " "+str(q['Commentaire'])
line += " & "
if q["Niveau"] == 1:
line += q['Latex_rep']
else:
line += str(q['Mark'])
line += r"\\"
line += r" \\"
tabular.append(line)
tabular.append(r"\hline")