From 8386ad01eabc29665253b2802642db78823ed11d Mon Sep 17 00:00:00 2001 From: Sebastian Kuhnert Date: Tue, 16 Jun 2009 09:28:44 +0000 Subject: exercisesheets.sty: add solutions=nonoral option --- exercisesheets.sty | 20 +++++++++++++------- exercisesheets.tex | 11 ++++++----- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/exercisesheets.sty b/exercisesheets.sty index e075b6a..cfa10b5 100644 --- a/exercisesheets.sty +++ b/exercisesheets.sty @@ -22,12 +22,14 @@ % configuration keys \newif\ifexsh@solutions -\newif\ifexsh@nonoralsolutions\exsh@nonoralsolutionstrue +\newif\ifexsh@oralsolutions +\newif\ifexsh@nonoralsolutions \pgfkeys{/exsh/.is family,/exsh, solutions/.is choice, - solutions/true/.code=\exsh@solutionstrue\exsh@nonoralsolutionstrue, - solutions/oral/.code=\exsh@solutionstrue\exsh@nonoralsolutionsfalse, - solutions/false/.code=\exsh@solutionsfalse\exsh@nonoralsolutionsfalse, + solutions/true/.code=\exsh@solutionstrue\exsh@oralsolutionstrue\exsh@nonoralsolutionstrue, + solutions/oral/.code=\exsh@solutionstrue\exsh@oralsolutionstrue\exsh@nonoralsolutionsfalse, + solutions/nonoral/.code=\exsh@solutionstrue\exsh@oralsolutionsfalse\exsh@nonoralsolutionstrue, + solutions/false/.code=\exsh@solutionsfalse\exsh@oralsolutionsfalse\exsh@nonoralsolutionsfalse, solutions/.default=true, only/.initial={-}, all/.style={/exsh/only={-}},all/.value forbidden, @@ -533,10 +535,14 @@ \newenvironment{solution}[1][]{% \pgfkeys{exsh,every solution,#1,solution font}% \ifbool{exsh@solutions}{% - \ifbool{exsh@nonoralsolutions}{% - \let\next\exsh@startsolution + \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{% + \ifbool{exsh@oralsolutions}{ + \let\next\exsh@startsolution + }{% + \let\next\exsh@skipsolution + }% }{% - \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{% + \ifbool{exsh@nonoralsolutions}{ \let\next\exsh@startsolution }{% \let\next\exsh@skipsolution diff --git a/exercisesheets.tex b/exercisesheets.tex index 66f948b..46888cb 100644 --- a/exercisesheets.tex +++ b/exercisesheets.tex @@ -113,12 +113,13 @@ The following options are available: \end{description} \item[\option{all}] Typeset all sheets (equivalent to \option{only=-}). This is the default. - \item[\option{solutions\opt{=\param{true/false/oral}}}] By default, solutions - (provided in the \texttt{solution} environment) are not included in the - output. By providing the option \option{solutions=true} (or just + \item[\option{solutions\opt{=\param{true/false/oral/nonoral}}}] By default, + solutions (provided in the \texttt{solution} environment) are not included in + the output. By providing the option \option{solutions=true} (or just \option{solutions}) this can be changed. Choosing \option{solutions=oral} - shows only solutions for exercises marked \option{oral}. The latter is useful - for printouts taken to class. + shows only solutions for exercises marked \option{oral} (useful for printouts + taken to class). Choosing \option{solutions=nonoral} shows only solutions for + exercises that are not marked \option{oral} (useful for correcting). \item[\option{solutionsby=\param{name/names}}] Use this to give the authors of the solutions. They are credited at the beginning of each sheet, if the solutions are included in the output. -- cgit v1.2.3