???
This commit is contained in:
parent
e51d5d1143
commit
98f6c29d3a
@ -50,7 +50,7 @@ Le barème est donné à titre indicatif, il pourra être modifié.
|
|||||||
\begin{Exo}[5.5]
|
\begin{Exo}[5.5]
|
||||||
Voici les performances en saut en hauteur d'une classe de troisième. Les hauteurs sont données en centimètres.
|
Voici les performances en saut en hauteur d'une classe de troisième. Les hauteurs sont données en centimètres.
|
||||||
\begin{equation*}
|
\begin{equation*}
|
||||||
%{{ random.hauteurs() %}}
|
%{{ "; \\quad ".join(random.gaussRandomlist_strInt(120, 20, 10)) %}}
|
||||||
\end{equation*}
|
\end{equation*}
|
||||||
\begin{enumerate}[a.]
|
\begin{enumerate}[a.]
|
||||||
\item Quel est l'effectif total de cette série?
|
\item Quel est l'effectif total de cette série?
|
||||||
|
@ -12,6 +12,8 @@ def randfloat(approx = 1, low = 0, up = 10):
|
|||||||
ans = round(ans, approx)
|
ans = round(ans, approx)
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
random.randfloat = randfloat
|
||||||
|
|
||||||
def gaussRandomlist(mu = 0, sigma = 1, size = 10, manip = lambda x:x):
|
def gaussRandomlist(mu = 0, sigma = 1, size = 10, manip = lambda x:x):
|
||||||
""" return a list of a gaussian sample """
|
""" return a list of a gaussian sample """
|
||||||
ans = []
|
ans = []
|
||||||
@ -19,12 +21,13 @@ def gaussRandomlist(mu = 0, sigma = 1, size = 10, manip = lambda x:x):
|
|||||||
ans += [manip(random.gauss(mu,sigma))]
|
ans += [manip(random.gauss(mu,sigma))]
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
def hauteurs(num = 15):
|
|
||||||
return " ;\\quad ".join(gaussRandomlist(mu = 120, sigma = 10, size = 15, manip = lambda x: str(int(x))))
|
|
||||||
|
|
||||||
random.randfloat = randfloat
|
|
||||||
random.gaussRandomlist = gaussRandomlist
|
random.gaussRandomlist = gaussRandomlist
|
||||||
random.hauteurs = hauteurs
|
|
||||||
|
def gaussRandomlist_strInt(mu = 0, sigma = 1, size = 10):
|
||||||
|
return gaussRandomlist(mu, sigma, size, manip = lambda x: str(int(x)))
|
||||||
|
|
||||||
|
random.gaussRandomlist_strInt = gaussRandomlist_strInt
|
||||||
|
|
||||||
|
|
||||||
report_renderer = jinja2.Environment(
|
report_renderer = jinja2.Environment(
|
||||||
block_start_string = '%{',
|
block_start_string = '%{',
|
||||||
@ -50,7 +53,9 @@ def main(options):
|
|||||||
with open( dest, 'w') as f:
|
with open( dest, 'w') as f:
|
||||||
f.write(template.render(random = random, infos = {"subj" : subj}))
|
f.write(template.render(random = random, infos = {"subj" : subj}))
|
||||||
os.system("pdflatex " + dest)
|
os.system("pdflatex " + dest)
|
||||||
os.system("rm *.aux *.log")
|
|
||||||
|
if not options.dirty:
|
||||||
|
os.system("rm *.aux *.log")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
@ -59,6 +64,7 @@ if __name__ == '__main__':
|
|||||||
parser.add_option("-t","--tempalte",action="store",type="string",dest="template", help="File with template")
|
parser.add_option("-t","--tempalte",action="store",type="string",dest="template", help="File with template")
|
||||||
parser.add_option("-o","--output",action="store",type="string",dest="output",help="Base name for output (without .tex or any extension))")
|
parser.add_option("-o","--output",action="store",type="string",dest="output",help="Base name for output (without .tex or any extension))")
|
||||||
parser.add_option("-n","--number_subjects", action="store",type="int", dest="num_subj", default = 2, help="The number of subjects to make")
|
parser.add_option("-n","--number_subjects", action="store",type="int", dest="num_subj", default = 2, help="The number of subjects to make")
|
||||||
|
parser.add_option("-d","--dirty", action="store_true", dest="dirty", help="Do not clean after compilation")
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user