From 0e06b454144b2b566f5889836e1605d9cade581a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 24 Oct 2012 23:27:10 +0000 Subject: exsheets (24oct12) git-svn-id: svn://tug.org/texlive/trunk@28067 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/exsheets/README | 2 +- .../texmf-dist/doc/latex/exsheets/exsheets_en.pdf | Bin 681099 -> 689795 bytes .../texmf-dist/doc/latex/exsheets/exsheets_en.tex | 167 ++++++++++++++++++--- .../doc/latex/exsheets/grading-table.pdf | Bin 0 -> 26403 bytes .../doc/latex/exsheets/grading-table.tex | 22 +++ 5 files changed, 173 insertions(+), 18 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/exsheets/grading-table.pdf create mode 100644 Master/texmf-dist/doc/latex/exsheets/grading-table.tex (limited to 'Master/texmf-dist/doc/latex/exsheets') diff --git a/Master/texmf-dist/doc/latex/exsheets/README b/Master/texmf-dist/doc/latex/exsheets/README index 4ac38eeb800..74803b4238a 100644 --- a/Master/texmf-dist/doc/latex/exsheets/README +++ b/Master/texmf-dist/doc/latex/exsheets/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -EXSHEETS v0.2b - 2012/10/08 +EXSHEETS v0.3 - 2012/10/23 bundled packages: the EXSHEETS package diff --git a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf index 8125d021770..502693a22cf 100644 Binary files a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf and b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf differ diff --git a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex index f8e2eefd934..e9fb998099b 100644 --- a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex +++ b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex @@ -43,7 +43,6 @@ % % use `xelatex' and `biber' for compilation % -\RequirePackage{setspace} \documentclass[DIV10,toc=index,toc=bib,numbers=noendperiod]{cnpkgdoc} % ---------------------------------------------------------------------------- % document layout and typographic features @@ -59,7 +58,8 @@ skipbelow = .6\baselineskip plus .5ex minus .5ex , skipabove = .6\baselineskip plus .5ex minus .5ex , innerleftmargin = 1.5em , - innerrightmargin = 2.5em + innerrightmargin = 2.5em , + ignorelastdescenders } , gobble = 1 } @@ -88,12 +88,14 @@ \addcmds{ acs, addpoints, blank, bigstar, bottomrule, citetitle, cmd, color, DeclareInstance, DeclareTemplateInterface, DeclareQuestionProperty, - DebugExSheets, endspacing, GetQuestionProperty, grade, includequestions, - midrule, points, PrintIfIncludeActiveF, PrintIfIncludeActiveT, - PrintIfIncludeActiveTF, printsolutions, PrintSolutionsTF, - QuestionNumber, s, sample, setlength, SetQuestionProperties, SetupExSheets, - spacing, square, sumpoints, tabcolsep, task, textcite, textcolor, toprule, - totalpoints + DebugExSheets, endspacing, examspace, ForEachQuestion, GetQuestionProperty, + grade, includequestions, iflastquestion, + midrule, NewQuSolPair, numberofquestions, points, PrintIfIncludeActiveF, + PrintIfIncludeActiveT, PrintIfIncludeActiveTF, printsolutions, + PrintSolutionsTF, + QuestionNumber, RenewQuSolPair, s, sample, setlength, SetQuestionProperties, + SetupExSheets, spacing, square, sumpoints, tabcolsep, task, textcite, textcolor, + toprule, totalpoints } % translations: @@ -211,6 +213,11 @@ 4 = .5 } +\usepackage{amssymb} +\NewQuSolPair + {question*}[name=\llap{$\bigstar$\space}Bonus Question] + {solution*}[name=\llap{$\bigstar$\space}Solution] + \DeclareTranslation{English}{Kueche}{kitchen} \DeclareTranslation{German}{Kueche}{K\"uche} \DeclareTranslation{Spanish}{Kueche}{cocina} @@ -246,6 +253,22 @@ \expsign \gdef\cnpkgdoctriangle{\unexpsign}}} +\usepackage{marginnote} +\makeatletter +\newcommand*\sinceversion[1]{% + \@bsphack + \marginnote{% + \footnotesize\sffamily\RaggedRight + \textcolor{black!75}{Introduced in version~#1}}% + \@esphack} +\newcommand*\changedversion[1]{% + \@bsphack + \marginnote{% + \footnotesize\sffamily\RaggedRight + \textcolor{black!75}{Changed in version~#1}}% + \@esphack} +\makeatother + % ---------------------------------------------------------------------------- % title page \TitlePicture{% @@ -475,6 +498,15 @@ argument. \end{question} \end{beispiel} +\sinceversion{3.0}On additional thing: you might want to define custom +commands that should behave differently if they're inside or outside of the +\code{question} environment. In this case you can use these commands: +\begin{beschreibung} + \expandable\Befehl{IfInsideQuestionTF}{}\ma{} + \expandable\Befehl{IfInsideQuestionT}{} + \expandable\Befehl{IfInsideQuestionF}{} +\end{beschreibung} + \subsubsection{Options to the \code{question} Environment}\secidx[options]{questions} The \code{question} environment takes one or more of the following options: \begin{beschreibung} @@ -649,10 +681,11 @@ and a number of commands to retrieve the sum of points and/or bonus points. \currentbonussum \Befehl{totalpoints}*\newline prints the sum of the points \emph{and} the sum of the bonus points with ``unit'': - \totalpoints + \totalpoints\space The starred version prints the sum of the points without ``unit'': \totalpoints*. \end{beschreibung} -The last three commands need at least \emph{two} \LaTeX\ runs to get the sum right. +The commands \cmd{pointssum}, \cmd{bonussum} and \cmd{totalpoints} need at least +\emph{two} \LaTeX\ runs to get the sum right. Suppose you have an exercise worth \points{4} which consists of four questions listed with an \code{enumerate} environment that are all worth \points{1} each. @@ -1067,6 +1100,45 @@ It is now possible to recover these values later: \end{center} \end{beispiel} +\sinceversion{3.0}There are additional commands that might prove useful: +\begin{beschreibung} + \Befehl{ForEachQuestion}{}\newline + Inside the argument one can refer to the \ac{id} of a question with \code{\#1}. + Beware that this command only knows of questions used before it is issued. + \expandable\Befehl{numberofquestions}\newline + Returns the current number of used questions. Beware that this command only knows + of questions used before it is issued. + \expandable\Befehl{iflastquestion}{}\ma{}\newline + Although this command is available in the whole document it is only useful + inside \cmd{ForEachQuestion}. It tells you if the end of the loop is reached + or not. +\end{beschreibung} +For example one could use these commands to create a grading table: +\begin{beispiel}[code only] + \begin{tabular}{|l|*{\numberofquestions}{c|}c|}\hline + Question & + \ForEachQuestion{\QuestionNumber{#1}\iflastquestion{}{&}} & + Total \\ \hline + Points & + \ForEachQuestion{\GetQuestionProperty{points}{#1}\iflastquestion{}{&}} & + \pointssum* \\ \hline + Reached & + \ForEachQuestion{\iflastquestion{}{&}} & \\ \hline +\end{tabular} +\end{beispiel} +For four questions the table now would look similar to figure~\ref{fig:grading-table}. + +\begin{figure}[ht] + \centering + \begin{tabular}{|l|*{4}{c|}c|}\hline + Question & 1. & 2. & 3. & 4. & Total \\ \hline + Points & 3 & 5 & 10 & 8 & 26 \\ \hline + Reached & & & & & \\ \hline + \end{tabular} + \caption{An example for a grading table. (Actually this is a fake. See the + \code{grading-table.tex} file shipped with exsheets for the real use case.)} + \label{fig:grading-table} +\end{figure} \secidx*{Additional Information to Questions} \subsection{Selectively Include Questions from External Files}\label{sec:include} @@ -1137,6 +1209,38 @@ not taken into consideration. In fact it is completely ignored and the questions are included anyway. I'm still not sure this is a feature or a bug\ldots \secidx*{Include from External Files} +\subsection{Own Question/Solution Pairs} +\noindent\sinceversion{3.0}\ExSheets provides he possibility to create new +environments that behave like the \code{question} and \code{solution} environments. +This would allow, for example, to define a \code{question*}/\code{solution*} +environment pair for bonus questions. The following commands may be used in the +document preamble: +\begin{beschreibung} + \Befehl{NewQuSolPair}{}\oa{}\ma{}\oa{} + \Befehl{RenewQuSolPair}{}\oa{}\ma{}\oa{} +\end{beschreibung} +The standard environments are defined as follows: +\begin{beispiel}[code only] + \NewQuSolPair{question}{solution} +\end{beispiel} + +Let's say we want the possibility to add bonus questions. A simple way would be +to define starred variants that add a star in the margin left to the title: +\begin{beispiel} + % preamble: + % \NewQuSolPair + % {question*}[name=\llap{$\bigstar$\space}Bonus Question] + % {solution*}[name=\llap{$\bigstar$\space}Solution] + \begin{question*} + This is a bonus question. + \end{question*} + \begin{solution*}[print] + This is what the solution looks like. + \end{solution*} +\end{beispiel} +As you can see the environments take the same options as are described for the +standard \code{question} and \code{solution} environments. + \subsection{The \code{tasks} Environment}\label{sec:tasks}\secidx{tasks} \subsubsection{How it works} The \code{tasks} environment is similar to a list like \code{enumerate} but not @@ -1265,14 +1369,18 @@ in one of the tasks. This will temporarily overwrite the default label. \secidx*{tasks} \subsection{Filling in the Blanks}\secidx{Blanks} -Both in exercise sheets and in exams it is sometimes desirable to be able to -create \blank{blanks} that have to be filled in. Or may be some more lines: -\blank[width=5\linewidth]{} +\subsubsection{Cloze}\secidx[Cloze]{Blanks} +\noindent\changedversion{3.0}Both in exercise sheets and in exams it is sometimes +desirable to be able to create \blank{blanks} that have to be filled in. Or may +be some more lines: \blank[width=5\linewidth]{} \begin{beschreibung} - \Befehl{blank}[]{}\newline + \Befehl{blank}*[]{}\newline creates a blank in normal text or in a question but fills the text of its - argument if inside a solution. + argument if inside a solution. If used at the \emph{begin of a paragraph} + \cmd{blank} will do two things: it will set the linespread according to an + option explained below and will insert \cmd*{par} after the lines. If you + don't want that use the starred version. \end{beschreibung} The options are these: @@ -1281,6 +1389,9 @@ The options are these: The style of the line. \Option[blank]{width}{}\Default{} The width of the line. If it is not used the width of the filled in text is used. + \Option[blank]{linespread}{}\Default{1} + Set the linespread for the blank lines. This only has an effect if \cmd{blank} + is used at the begin of a paragraph. \end{beschreibung} \begin{beispiel} \begin{question} @@ -1296,8 +1407,30 @@ The options are these: \end{beispiel} A number of empty lines are easily created by setting the width option: \begin{beispiel} - % \usepackage{setspace} - \spacing{2}\blank[width=4.8\linewidth]{}\endspacing + + \blank[width=4.8\linewidth,linespread=1.5]{} +\end{beispiel} + +\subsubsection{Vertical Space for answers}\secidx[vertical space]{Blanks} +\noindent\sinceversion{3.0}When you're creating an exam you might want to add some +vertical space where the students can write down their answers. While you can +always use \cmd*{vspace} this is not always handy when the space left on the +page is less than you want. In this case it would be nice if a) there would be +no warning and b) the rest of the space would be added at the top of the next +page. This is what the following command is for: +\begin{beschreibung} + \Befehl{examspace}*{}\newline + Add space as specified in \ma{}. If the space available on the current + page is not enough the rest of the space will be added at the top of the + next page. The starred version will silently drop any leftover space instead + of adding it to the next page. +\end{beschreibung} +\begin{beispiel} + \begin{question} + What do you think of this feature? + \examspace{3cm} + \end{question} + This line comes after the space. \end{beispiel} \secidx*{Blanks} diff --git a/Master/texmf-dist/doc/latex/exsheets/grading-table.pdf b/Master/texmf-dist/doc/latex/exsheets/grading-table.pdf new file mode 100644 index 00000000000..424286f0916 Binary files /dev/null and b/Master/texmf-dist/doc/latex/exsheets/grading-table.pdf differ diff --git a/Master/texmf-dist/doc/latex/exsheets/grading-table.tex b/Master/texmf-dist/doc/latex/exsheets/grading-table.tex new file mode 100644 index 00000000000..85239f69181 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsheets/grading-table.tex @@ -0,0 +1,22 @@ +\documentclass{scrartcl} +\usepackage{exsheets} +\DeclareQuestionProperty{points} + +\begin{document} + +\begin{question}{3}\SetQuestionProperties{points=3} +\end{question} +\begin{question}{5}\SetQuestionProperties{points=5} +\end{question} +\begin{question}{10}\SetQuestionProperties{points=10} +\end{question} +\begin{question}{8}\SetQuestionProperties{points=8} +\end{question} + +\begin{tabular}{|l|*{\numberofquestions}{c|}c|}\hline + Question & \ForEachQuestion{\QuestionNumber{#1}\iflastquestion{}{&}} & Total \\ \hline + Points & \ForEachQuestion{\GetQuestionProperty{points}{#1}\iflastquestion{}{&}} & \pointssum* \\ \hline + Reached & \ForEachQuestion{\iflastquestion{}{&}} & \\ \hline +\end{tabular} + +\end{document} \ No newline at end of file -- cgit v1.2.3