From 42fa39bdf06888e8792d99cef72c35d246971322 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 23 Aug 2022 08:47:47 +0200 Subject: [PATCH] Feat: ajoute \annexe et \hint --- tools/style/myXsim.sty | 52 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/tools/style/myXsim.sty b/tools/style/myXsim.sty index f66837e..219ac55 100644 --- a/tools/style/myXsim.sty +++ b/tools/style/myXsim.sty @@ -95,6 +95,44 @@ }% } +% Annexes +\DeclareExerciseProperty{annexe} +\NewDocumentEnvironment{annexe}{+b} + {% + \edef\ExerciseType{\csname g_xsim_exercise_type_tl\endcsname}% + \edef\ExerciseID{\csname g_xsim_exercise_id_tl\endcsname}% + \SetExerciseProperty{annexe}{#1}% + } + {} +\newcommand\printannexes{% + \ForEachUsedExerciseByType{% + \GetExercisePropertyT{annexe} + {\subsection*{Annexe de l'exercice ##3} + + ####1 + }% + }% +} + +% Coup de pouces +\DeclareExerciseProperty{hint} +\NewDocumentEnvironment{hint}{+b} + {% + \edef\ExerciseType{\csname g_xsim_exercise_type_tl\endcsname}% + \edef\ExerciseID{\csname g_xsim_exercise_id_tl\endcsname}% + \SetExerciseProperty{hint}{#1}% + } + {} +\newcommand\printhints{% + \ForEachUsedExerciseByType{% + \GetExercisePropertyT{hint} + {\subsection*{Coup de pouce pour Ex:##3} + + ####1 + }% + }% +} + \newcommand\printsectionexercises{% \ForEachUsedExerciseByType{% \ifnum\ExercisePropertyGet{##1}{##2}{step}=\value{section} @@ -103,6 +141,13 @@ }% } +\newcommand\seflevaluation{% + \begin{tikzpicture} + \foreach \k in {0,1,...,4}{ + \draw (\k*0.5, 0) node[draw, star, star points=5, star point ratio=0.5]{}; + } + \end{tikzpicture} +} \newcommand\listsectionexercises{% \begin{itemize}[label={$\square$}] @@ -118,12 +163,7 @@ \GetExerciseProperty{subtitle}% {{\PropertyValue}}% \dotfill - %Auto-évaluation - \begin{tikzpicture} - \foreach \k in {0,1,...,4}{ - \draw (\k*0.5, 0) node[draw, star, star points=5, star point ratio=0.5]{}; - } - \end{tikzpicture} + \selfevaluation \fi }% \end{itemize}