Commit 03fec0b1 authored by GuiΩ's avatar GuiΩ
Browse files

[[PROF_LATEX]] substitution in LaTeX code

parent 620d4e0a
Pipeline #508518 failed with stages
in 3 minutes and 45 seconds
......@@ -182,6 +182,7 @@ class VarReplacer(object):
Possibles vars :
[[QUESTION]]: the question latex code
[[CLASSE]]: the classe name
[[PROF_LATEX]]: nom_latex of the teacher
[[ANNEE_SCO]]: the school year fromated
[[NFEUILLE]]: the sheet number
[[NFEUILLE_n]]: the sheet number, encode on n digits with leading 0
......@@ -224,7 +225,6 @@ class VarReplacer(object):
# if (sheet == null && seance !=null) {
# sheet = seance.getSheet();
# }
question = kwargs.get('question')
seance = kwargs.get('seance')
feuille = kwargs.get('feuille')
......@@ -291,9 +291,12 @@ class VarReplacer(object):
"\\[\\[ONLY_FIRST\\]\\].*?\\[\\[END_ONLY_FIRST\\]\\]",
"",
code)
if classe:
code = code.replace("[[PROF_LATEX]]", classe.enseignant.nom_latex)
return code
def _replace_feuille(self, code, **kwargs):
print('_replace_feuille:', kwargs)
feuille = kwargs.get('feuille')
code = code.replace("[[NFEUILLE]]", str(feuille.get_position()))
match = re.search("\\[\\[NFEUILLE_(\\d+)\\]\\]", code)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment