From 7b299cb87dfb293aecd1963232f822d7aeb2c5b5 Mon Sep 17 00:00:00 2001
From: Sebastian Kuhnert
Date: Wed, 21 Oct 2009 15:05:22 +0000
Subject: exercisesheets.sty: add support for optional exercises and bonus
 points

---
 exercisesheets.tex | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

(limited to 'exercisesheets.tex')

diff --git a/exercisesheets.tex b/exercisesheets.tex
index 46888cb..81dec8f 100644
--- a/exercisesheets.tex
+++ b/exercisesheets.tex
@@ -29,7 +29,7 @@
 
 \newcommand{\exsh}{\texttt{exercisesheets}\xspace}
 
-\newcommand{\param}[1]{$\langle${\normalfont\itshape #1}$\rangle$}
+\newcommand{\param}[1]{$\langle${\normalfont\itshape #1\/}$\rangle$}
 \newcommand{\opt}[1]{\textcolor{green!50!black}{#1}}
 \newcommand{\option}[1]{{\normalfont\texttt{\color{blue!50!black}#1}}}
 
@@ -133,7 +133,7 @@ The following options are available:
 \subsection{Supplying Meta-Data}
 
 The following commands are enhanced (or provided) to set the options controlling
-the sheet headers (see Section \ref{sec:sheet}):
+the sheet headers (see Section~\ref{sec:sheet}):
 \begin{lstlisting}
 \subject{(*\param{subject}*)}
 \author{(*\param{author}*)}
@@ -200,14 +200,18 @@ The following \param{options} are supported:
 This inserts an exercise into the current document. The following options are
 supported:
 \begin{description}
- \item[\option{points=\param{number}}] Assign this exercise \param{number}
-  points. By default, exercises are unlabelled.
- \item[\option{oral}] Label this exercise as \emph{oral}. This supersedes and is
-  superseded by the option \option{points}.
  \item[\option{name=\param{text}}] Use \param{text} as the name of the exercise.
   Useful for exercises that prove a famous theorem.
  \item[\option{firstline=\param{text}}] Save some space by text \param{text}
   behind the exercise title.
+ \item[\option{points=\param{number}}] Assign this exercise \param{number}
+  points. By default, exercises are unlabelled.
+ \item[\option{oral}] Label this exercise as \emph{oral}. This supersedes and is
+  superseded by the option \option{points}.
+ \item[\option{pointsinfo=\param{text}}] Supply \param{text} as additional
+  information to be displayed after the points.
+ \item[\option{optional}] Shortcut for \option{pointsinfo=optional} with
+  automatic translation.
  \item[\option{solutions\opt{=\param{true/false}}}] Use this to override the
   document (or sheet) default.
 \end{description}
@@ -252,8 +256,9 @@ each place.
 \begin{exercise}[points=10]
   \begin{enumerate}
    \item Part 1 \points{oral}
-   \item Part 2 \points{4}
-   \item Part 3 \points{6}
+   \item Part 2 \points[optional]{oral}
+   \item Part 3 \points{4}
+   \item Part 4 \points[bonus]{6}
   \end{enumerate}
 \end{exercise}
 \end{lstlisting}
@@ -298,6 +303,9 @@ the used strings, you can do so with the following options:
  \item[\option{strings/oral=\param{string}}]
  \item[\option{strings/point=\param{string}}]
  \item[\option{strings/points=\param{string}}]
+ \item[\option{strings/bonus point=\param{string}}]
+ \item[\option{strings/bonus points=\param{string}}]
+ \item[\option{strings/optional=\param{string}}]
 \end{description}
 
 Example: Give an introduction that should only be included in the version with
@@ -393,7 +401,7 @@ The following options allow fine-tuning of the spacing:
 
 Example: Only include points for sub-exercises when solutions are typeset:
 \begin{lstlisting}
-\ifsolutions{}{\renewcommand{\points}[1]{}}
+\ifsolutions{}{\renewcommand{\points}[2][]{}}
 \end{lstlisting}
 
 \subsection{Using Hooks}
-- 
cgit v1.2.3

