<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%%
%% This is file `hwexam.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% hwexam.dtx  (with options: `package')
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{hwexam}[2016/04/06 v1.1 homework assignments and exams]
\newif\if@hwexam@mh@\@hwexam@mh@false
\DeclareOption{mh}{\@hwexam@mh@true}
\newif\iftest\testfalse
\DeclareOption{test}{\testtrue}
\newif\ifmultiple\multiplefalse
\DeclareOption{multiple}{\multipletrue}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{problem}}
\ProcessOptions
\RequirePackage{keyval}[1997/11/10]
\if@hwexam@mh@\RequirePackage{hwexam-mh}\fi
\RequirePackage{problem}
\AfterBabelLanguage{ngerman}{\input{hwexam-ngerman.ldf}}
\newcommand\hwexam@assignment@kw{Assignment}
\newcommand\hwexam@given@kw{Given}
\newcommand\hwexam@due@kw{Due}
\newcounter{assignment}
\numberproblemsin{assignment}
\renewcommand\prob@label[1]{\arabic{assignment}.#1}
\srefaddidkey{assig}
\addmetakey{assig}{number}
\addmetakey*{assig}{title}
\addmetakey{assig}{type}
\addmetakey{assig}{given}
\addmetakey{assig}{due}
\addmetakey[false]{assig}{loadmodules}[true]
\newcommand\given@due[2]{%
\ifx \inclassig@given\@empty
\ifx \assig@given\@empty
\ifx \inclassig@due\@empty
\ifx \assig@due\@empty% all empty do nothing
\else #1%
\fi
\else #1%
\fi
\else #1%
\fi
\else #1%
\fi
\ifx\inclassig@given\@empty
\ifx\assig@given\@empty% do nothing
\else \hwexam@given@kw\xspace \assig@given%
\fi
\else \hwexam@given@kw\xspace \inclassig@given%
\fi
\ifx \inclassig@due\@empty
\ifx \assig@due\@empty% do nothing
\else
\ifx \inclassig@given\@empty
\ifx \assig@given\@empty% do nothing
\else ,~%
\fi
\else ,~%
\fi
\fi
\else
\ifx \inclassig@given\@empty
\ifx \assig@given\@empty% do nothing
\else ,~%
\fi
\else ,~%
\fi
\fi
\ifx \inclassig@due\@empty
\ifx \assig@due\@empty% do nothing
\else \hwexam@due@kw\xspace \assig@due%
\fi
\else \hwexam@due@kw\xspace \inclassig@due%
\fi
\ifx \inclassig@given\@empty
\ifx \assig@given\@empty
\ifx \inclassig@due\@empty
\ifx \assig@due\@empty% all empty do nothing
\else #2%
\fi
\else #2%
\fi
\else #2%
\fi
\else #2%
\fi
}
\newcommand\assignment@title[3]
{\ifx\inclassig@title\@empty% if there is no outside title
\ifx\assig@title\@empty{#1}\else{#2\assig@title{#3}}\fi
\else{#2}\inclassig@title{#3}\fi}% else show the outside title
\newcommand\assignment@number%
{\ifx\inclassig@number\@empty% if there is no outside number
\ifx\assig@number\@empty\else\assig@number\fi
\else\inclassig@number\fi}% else show the outside number
\newenvironment{assignment}[1][]{\metasetkeys{assig}{#1}\sref@target%
\edef\@@num{\assignment@number}%
\ifx\@@num\@empty\stepcounter{assignment}\else\setcounter{assignment}{\@@num}\fi%
\setcounter{problem}{0}%
\def\current@section@level{\document@hwexamtype}%
\sref@label@id{\document@hwexamtype \thesection}%
\begin{@assignment}}
{\end{@assignment}}
\def\@@asstitle{\protect\document@hwexamtype~\arabic{assignment}%
\assignment@title{}{\;(}{)\;} -- \given@due{}{}}
\ifmultiple
\newenvironment{@assignment}%
{\ifx\assig@loadmodules\@true
\begin{omgroup}[loadmodules]{\@@asstitle}
\else
\begin{omgroup}{\@@asstitle}
\fi}
{\end{omgroup}}
\else
\newenvironment{@assignment}
{\begin{center}\bf
\Large\@title\strut\\
\document@hwexamtype~\arabic{assignment}\assignment@title{\;}{:\;}{\\}%
\large\given@due{--\;}{\;--}
\end{center}}
{}
\fi% multiple
\addmetakey{inclassig}{number}
\addmetakey*{inclassig}{title}
\addmetakey{inclassig}{type}
\addmetakey{inclassig}{given}
\addmetakey{inclassig}{due}
\addmetakey{inclassig}{mhrepos}
\clear@inclassig@keys%initially
\newcommand\includeassignment[2][]{\metasetkeys{inclassig}{#1}%
\include{#2}\clear@inclassig@keys}
\newcommand\inputassignment[2][]{\metasetkeys{inclassig}{#1}%
\input{#2}\clear@inclassig@keys}
\addmetakey{quizheading}{tas}
\newcommand\quizheading[1]{\def\@tas{#1}%
\large\noindent NAME: \hspace{8cm}  MAILBOX:\\[2ex]%
\ifx\@tas\@empty\else%
\noindent TA: \@for\@I:=\@tas\do{{\Large$\Box$}\@I\hspace*{1em}}\\[2ex]\fi}
\addmetakey{testheading}{min}
\addmetakey{testheading}{duration}
\addmetakey{testheading}{reqpts}
\newenvironment{testheading}[1][]{\metasetkeys{testheading}{#1}
{\noindent\large{}Name: \hfill Matriculation Number:\hspace*{2cm}\strut\\[1ex]
\begin{center}\Large\textbf{\@title}\\[1ex]\large\@date\\[3ex]\end{center}
{\textbf{You have
\ifx\test@heading@duration\@empty\testheading@min minutes\else\testheading@duration\fi
(sharp) for the test}};\\ Write the solutions to the sheet.}\par\noindent

\newcount\check@time\check@time=\testheading@min
\advance\check@time by -\theassignment@totalmin
The estimated time for solving this exam is {\theassignment@totalmin} minutes,
leaving you {\the\check@time} minutes for revising your exam.

\newcount\bonus@pts\bonus@pts=\theassignment@totalpts
\advance\bonus@pts by -\testheading@reqpts
You can reach {\theassignment@totalpts} points if you solve all problems. You will only need
{\testheading@reqpts} points for a perfect score, i.e.\ {\the\bonus@pts} points are
bonus points. \vfill
\begin{center}
  {\Large\em
  Different problems test different skills and knowledge, so do not get stuck on
  one problem.}\vfill\par\correction@table \\[3ex]
\end{center}}
{\newpage}
\newcommand\testspace[1]{\iftest\vspace*{#1}\fi}
\newcommand\testnewpage{\iftest\newpage\fi}
\newcommand\testemptypage[1][]{\iftest\begin{center}This page was intentionally left
    blank for extra space\end{center}\vfill\eject\else\fi}
\renewcommand\@problem[3]{\stepcounter{assignment@probs}
\def\@@pts{#2}\ifx\@@pts\@empty\else\addtocounter{assignment@totalpts}{#2}\fi
\def\@@min{#3}\ifx\@@min\@empty\else\addtocounter{assignment@totalmin}{#3}\fi
\xdef\correction@probs{\correction@probs &amp; #1}%
\xdef\correction@pts{\correction@pts &amp; #2}
\xdef\correction@reached{\correction@reached &amp;}}
\newcounter{assignment@probs}
\newcounter{assignment@totalpts}
\newcounter{assignment@totalmin}
\newcommand\correction@probs{prob.}%
\newcommand\correction@pts{total}%
\newcommand\correction@reached{reached}%
\stepcounter{assignment@probs}
\newcommand\correction@table{\begin{tabular}{|l|*{\theassignment@probs}{c|}|l|}\hline%
&amp;\multicolumn{\theassignment@probs}{c||}%|
{\footnotesize To be used for grading, do not write here} &amp;\\\hline
\correction@probs &amp; Sum &amp; grade\\\hline
\correction@pts &amp;\theassignment@totalpts &amp; \\\hline
\correction@reached &amp; &amp; \\[.7cm]\hline
\end{tabular}}
\endinput
%%
%% End of file `hwexam.sty'.
</pre></body></html>