Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GuiΩ
ActivitesMentales_Django
Commits
03fec0b1
Commit
03fec0b1
authored
May 08, 2022
by
GuiΩ
Browse files
[[PROF_LATEX]] substitution in LaTeX code
parent
620d4e0a
Pipeline
#508518
failed with stages
in 3 minutes and 45 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
am/models.py
View file @
03fec0b1
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment