summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/xsim/examples/xsim.difficulties.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/xsim/examples/xsim.difficulties.tex')
-rw-r--r--Master/texmf-dist/doc/latex/xsim/examples/xsim.difficulties.tex53
1 files changed, 53 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/xsim/examples/xsim.difficulties.tex b/Master/texmf-dist/doc/latex/xsim/examples/xsim.difficulties.tex
new file mode 100644
index 00000000000..02712f15d66
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/xsim/examples/xsim.difficulties.tex
@@ -0,0 +1,53 @@
+\documentclass{article}
+
+\usepackage[clear-aux]{xsim}
+\DeclareExerciseTagging{difficulty}
+\xsimsetup{
+ difficulty={easy,hard}
+}
+
+\DeclareExerciseEnvironmentTemplate{custom}
+ {
+ \subsection*
+ {%
+ \XSIMmixedcase {\GetExerciseName}\nobreakspace
+ \GetExerciseProperty{counter}%
+ \IfExercisePropertySetT{difficulty}
+ { {\normalfont(\GetExerciseProperty{difficulty})}}%
+ \IfInsideSolutionF{%
+ \IfExercisePropertySetT{subtitle}
+ { {\normalfont\itshape\GetExerciseProperty{subtitle}}}%
+ }%
+ }%
+ \IfExercisePropertySetT{points}
+ {%
+ \marginpar
+ {%
+ \IfInsideSolutionF{\rule{1.2cm}{1pt}\slash}%
+ \GetExerciseProperty{points}%
+ \IfExercisePropertySetT{bonus-points}
+ {\nobreakspace(+\GetExerciseProperty{bonus-points})}
+ \nobreakspace\XSIMtranslate{point-abbr}%
+ }%
+ }%
+ }
+ {}
+
+\xsimsetup{exercise/template = custom}
+
+\begin{document}
+
+\begin{exercise}[difficulty=easy]
+ An easy question.
+\end{exercise}
+\begin{exercise}[difficulty=medium]
+ This one's a bit harder.
+\end{exercise}
+\begin{exercise}[difficulty=hard]
+ Now let’s see if you can solve this one.
+\end{exercise}
+\begin{exercise}[difficulty=medium]
+ This is medium but printed anyway
+\end{exercise}
+
+\end{document}