diff options
author | Karl Berry <karl@freefriends.org> | 2017-05-19 21:12:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-05-19 21:12:44 +0000 |
commit | b6a9d061f27e2822b7de379c66c030d9ea0e8fb3 (patch) | |
tree | 7a9b6e488d40920bb153db1f0e7be10f8df3935a /Master/texmf-dist/doc/latex/xsim/examples/xsim.various.tex | |
parent | 910f589664407d620dc2a30c7b1de1a10e715df1 (diff) |
xsim (19may17)
git-svn-id: svn://tug.org/texlive/trunk@44430 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/xsim/examples/xsim.various.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/xsim/examples/xsim.various.tex | 237 |
1 files changed, 237 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/xsim/examples/xsim.various.tex b/Master/texmf-dist/doc/latex/xsim/examples/xsim.various.tex new file mode 100644 index 00000000000..1b7b13f98b3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xsim/examples/xsim.various.tex @@ -0,0 +1,237 @@ +\documentclass{article} +\usepackage{xsim,lipsum,tcolorbox} + +\DeclareExerciseType{question}{ + exercise-env = question , + solution-env = hint , + exercise-name = Question , + solution-name = Hint , + exercise-template = default , + solution-template = default , + counter = exercise % shares a counter with the `exercise' type +} + +\DeclareExerciseType{problem}{ + exercise-env = problem , + solution-env = answer , + exercise-name = Problem , + solution-name = Answer , + exercise-template = tcolorbox , + solution-template = tcolorbox +} + +\DeclareExerciseProperty{grade} +\DeclareExerciseProperty{difficulty} + +\tcbuselibrary{breakable} +\DeclareExerciseEnvironmentTemplate{tcolorbox} + {% + \newcommand*\writehere{% + \IfInsideSolutionTF{}{% + \tcblower + \emph{Your answer:} + \vspace*{4cm} + }% + } + \vspace{\baselineskip} + \tcolorbox[ + colback = red!5!white , + colframe = red!75!black , + colbacktitle = yellow!50!red , + coltitle = red!25!black , + fonttitle = \bfseries , + subtitle style = { + boxrule = 0.4pt , + colback = yellow!50!red!25!white + } , + breakable , + title = \GetExerciseName~\GetExerciseProperty{counter} + \IfExercisePropertySetT{points}{% + (\GetExerciseProperty{points} + \IfExerciseGoalSingularTF{points} + {\XSIMtranslate{point}} + {\XSIMtranslate{points}})% + }] + \IfInsideSolutionF{% + \IfExercisePropertySetT{tags}{% + Tags: \ListExerciseTags{tags}{, } \par + }% + }% + } + {% + \endtcolorbox + \vspace{\baselineskip} + } + +\xsimsetup{ + % tags = {geometry} , + % topics = {geometry} + % tags/ingore-untagged % if true untagged exercise will be printed regardless + % % which tags have been chosen +} + +\begin{document} + +\gradingtable \par \bigskip + +Total: \printtotalpoints \par +from questions: \printpoints{question} \par +from exercises: \printpoints{exercise} \par +from problems: \printpoints{problem} \par \bigskip + +Total bonus: \printtotalbonus \par +from questions: \printbonus{question} \par +from exercises: \printbonus{exercise} \par +from problems: \printbonus{problem} \par + +% 1 +\begin{exercise}[points=4,bonus-points=1,topics=geometry,tags={geometry,triangles},grade=7] + \lipsum[1] +\begin{verbatim} +foo x^2 y^3 \gna +\end{verbatim} +\end{exercise} +\begin{solution}[print] + This is the solution to \ExerciseType\ \GetExerciseProperty{counter}. +\begin{verbatim} +foo x^2 y^3 \gna +\end{verbatim} +\end{solution} + +% 2 +\begin{exercise}[subtitle=Foo,points=5,topics=analysis,tags={analysis,functions},grade=11] + \lipsum[2] +\end{exercise} +\begin{solution} + This is the solution to \ExerciseType\ \GetExerciseProperty{counter}. +\end{solution} + +% 3 +\begin{problem}[tags={analysis,functions}] + \lipsum[3] + \writehere +\end{problem} +\begin{answer} + This is the solution to \ExerciseType\ \GetExerciseProperty{counter}. +\end{answer} + +% 4 +\begin{question} + \lipsum[4] + + \verb+\ExerciseID+: \GetExerciseAliasProperty{ID} + + \verb+\GetExerciseProperty{id}+: \GetExerciseProperty{id} + + \verb+\GetExerciseAliasProperty{ID}+: \GetExerciseAliasProperty{ID} + + \verb+\GetExerciseProperty{ID}+: \GetExerciseProperty{ID} +\end{question} +\begin{hint} + This is the solution to \ExerciseType\ \GetExerciseProperty{counter}. +\end{hint} + +% 5 +\begin{problem}[points=2] + \lipsum[3] + + \verb+\ExerciseID+: \GetExerciseAliasProperty{ID} + + \verb+\GetExerciseProperty{id}+: \GetExerciseProperty{id} + + \verb+\GetExerciseAliasProperty{ID}+: \GetExerciseAliasProperty{ID} + + \verb+\GetExerciseProperty{ID}+: \GetExerciseProperty{ID} + \writehere +\end{problem} +\begin{answer} + This is the solution to \ExerciseType\ \GetExerciseProperty{counter}. +\end{answer} + +% 6 +\begin{problem}[points=1] + \lipsum[3] + + \verb+\ExerciseID+: \GetExerciseAliasProperty{ID} + + \verb+\GetExerciseProperty{id}+: \GetExerciseProperty{id} + + \verb+\GetExerciseAliasProperty{ID}+: \GetExerciseAliasProperty{ID} + + \verb+\GetExerciseProperty{ID}+: \GetExerciseProperty{ID} +\end{problem} +\begin{answer} + This is the solution to \ExerciseType\ \GetExerciseProperty{counter}. +\end{answer} + +% 7 +\begin{exercise}[ID=test] + \lipsum[5] + + \verb+\ExerciseID+: \GetExerciseAliasProperty{ID} + + \verb+\GetExerciseProperty{id}+: \GetExerciseProperty{id} + + \verb+\GetExerciseAliasProperty{ID}+: \GetExerciseAliasProperty{ID} + + \verb+\GetExerciseProperty{ID}+: \GetExerciseProperty{ID} +\end{exercise} +\begin{solution} + This is the solution to \ExerciseType\ \GetExerciseProperty{counter}. +\end{solution} + +% 8 +\begin{exercise}[print=false,use=false] + \lipsum[5] +\end{exercise} +\begin{solution} + This is the solution to \ExerciseType\ \GetExerciseProperty{counter}. +\end{solution} + +% \printsolutionstype{exercise} + +\printsolutions* + +\section{Statistics} + +\ForEachUsedExerciseByType{% + \noindent\XSIMmixedcase{\ExerciseParameterGet{#1}{exercise-name}}~#3: \\ + \hspace*{2em}id: #2, type: #1, subtitle: #4, points: #5, bonus: #6\par \medskip +} + +\bigskip + +\ForEachUsedExerciseByID{% + \noindent\XSIMmixedcase{\ExerciseParameterGet{#1}{exercise-name}}~#3: \\ + \hspace*{2em}id: #2, type: #1, subtitle: #4, points: #5, bonus: #6\par \medskip +} + +\bigskip + +\ForEachUsedExerciseByType{% + \ExercisePropertyIfSetT{#1}{#2}{points} + { \XSIMmixedcase{\ExerciseParameterGet{#1}{exercise-name}}~#3: #5~points\par }% +} + +\bigskip + +Number of questions: \numberofquestions \par +Number of exercises: \numberofexercises \par +Number of problems: \numberofproblems + +\section{Grading tables} + +\gradingtable[template=default*,type=exercise] \par \bigskip + +\gradingtable[template=default*,type=problem] \par \bigskip + +\gradingtable[template=default*] \par \bigskip + +% vertical +\gradingtable[type=exercise] \par \bigskip + +\gradingtable[type=problem] \par \bigskip + +\gradingtable + +\end{document} |