summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/stex/doc/packages/stex-hwexam.tex
blob: 5aced96e6645537defb96875ff932ce825f21ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

The \pkg{hwexam} package and class supplies an infrastructure that allows to format
nice-looking assignment sheets by simply including problems from problem files marked up
with the \pkg{roblem} package.  It is designed to be compatible with |problems.sty|, and
inherits some of the functionality.

\begin{variable}{solutions,notes,hints,gnotes,pts,min}
  The \pkg{wexam} package and class take the options |solutions|, |notes|, |hints|,
  |gnotes|, |pts|, |min|, and |boxed| that are just passed on to the \pkg{problems}
  package (cf. its documentation for a description of the intended behavior).
\end{variable}

This package supplies the \DescribeEnv{assignment}|assignment| environment that groups
problems into assignment sheets. It takes an optional KeyVal argument with the keys
\DescribeMacro{number}|number| (for the assignment number; if none is given, 1 is
assumed as the default or --- in multi-assignment documents --- the ordinal of the
|assignment| environment), \DescribeMacro{title}|title| (for the assignment title; this
is referenced in the title of the assignment sheet), \DescribeMacro{type}|type| (for the
assignment type; e.g. ``quiz'', or ``homework''), \DescribeMacro{given}|given| (for the
date the assignment was given), and \DescribeMacro{due}|due| (for the date the
assignment is due).

Furthermore, the \pkg{hwexam} package takes the option
\DescribeMacro{multiple}|multiple| that allows to combine multiple assignment sheets
into a compound document (the assignment sheets are treated as section, there is a table
of contents, etc.).

Finally, there is the option \DescribeMacro{test}|test| that modifies the behavior to
facilitate formatting tests. Only in |test| mode, the macros |\testspace|,
|\testnewpage|, and |\testemptypage| have an effect: they generate space for the
students to solve the given problems. Thus they can be left in the {\LaTeX} source. 

\DescribeMacro{\testspace}|\testspace| takes an argument that expands to a dimension,
and leaves vertical space accordingly. \DescribeMacro{\testnewpage}|\testnewpage| makes
a new page in |test| mode, and \DescribeMacro{\testemptypage}|\testemptypage| generates
an empty page with the cautionary message that this page was intentionally left empty.

Finally, the \DescribeEnv{testheading}|\testheading| takes an optional keyword argument
where the keys \DescribeMacro{duration}|duration| specifies a string that specifies the
duration of the test, \DescribeMacro{min}|min| specifies the equivalent in number of
minutes, and \DescribeMacro{reqpts}|reqpts| the points that are required for a perfect
grade.

\begin{latexcode}
\title{320101 General Computer Science (Fall 2010)}
\begin{testheading}[duration=one hour,min=60,reqpts=27]
  Good luck to all students!
\end{testheading}
\end{latexcode}

Will result in
\begin{center}
  \begin{minipage}{.9\textwidth}
\makeatletter
\@problem{1.1}{4}{10}
\@problem{2.1}{4}{8}
\@problem{2.2}{6}{10}
\@problem{2.3}{6}{10}
\@problem{3.1}{4}{8}
\@problem{3.2}{4}{8}
\@problem{3.3}{2}{4}
\makeatother
\title{320101 General Computer Science (Fall 2010)}
\begin{testheading}[duration=one hour,min=60,reqpts=27]
  good luck
\end{testheading}
\end{minipage}
\end{center}
\ednote{MK: The first three ``problems'' come from the stex examples above, how do we get rid
  of this?}

\begin{function}{\inputassignment}
  The |\inputassignment| macro can be used to input an assignment from another file. It
  takes an optional KeyVal argument and a second argument which is a path to the file
  containing the problem (the macro assumes that there is only one |assignment|
  environment in the included file).  The keys |number|, |title|, |type|, |given|, and
  |due| are just as for the |assignment| environment and (if given) overwrite the ones
  specified in the |assignment| environment in the included file.
\end{function}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../stex-manual"
%%% End: