summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/hwexam
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-11-12 00:31:31 +0000
committerKarl Berry <karl@freefriends.org>2010-11-12 00:31:31 +0000
commit70e387eb63ce4723858c48592208e193dec294f3 (patch)
tree61ec42df871a70687151ed4a6d1bc6a5c81dc53c /Master/texmf-dist/tex/latex/stex/hwexam
parent2cee8f6dcf8e9596b5cfe9d1f3e55c61b261a320 (diff)
stex 0.9.3 (11nov10)
git-svn-id: svn://tug.org/texlive/trunk@20410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/hwexam')
-rw-r--r--Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty125
-rw-r--r--Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty.ltxml29
2 files changed, 154 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty
new file mode 100644
index 00000000000..98415d16b8e
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty
@@ -0,0 +1,125 @@
+%%
+%% 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}[2010/06/25 v0.9b homework assignments and exams]
+\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}}
+\newif\iftest\testfalse
+\newif\ifsolutions\solutionsfalse
+\DeclareOption{test}{\testtrue\solutionsfalse}
+\newif\ifmultiple\multiplefalse
+\DeclareOption{multiple}{\multipletrue}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{problem}}
+\ProcessOptions
+\RequirePackage{keyval}[1997/11/10]
+\RequirePackage{problem}
+\addmetakey{assig}{number}
+\addmetakey*{assig}{title}
+\addmetakey{assig}{type}
+\addmetakey{assig}{given}
+\addmetakey{assig}{due}
+\def\given@due#1#2{%
+\ifx\assig@given\@empty\else\ifx\assig@due\@empty\else{#1}\fi\fi%
+\ifx\assig@given\@empty\else{Given {\assig@given}}\fi%
+\ifx\assig@given\@empty\else\ifx\assig@due\@empty\else{, }\fi\fi%
+\ifx\assig@due\@empty\else{Due {\assig@due}}\fi%
+\ifx\assig@given\@empty\else{\ifx\assig@due\@empty\else{#2}\fi}\fi}
+\ifmultiple
+\def\assignment@titleblock{%
+\@ifundefined{assig@number}{\stepcounter{section}}{\setcounter{section}{\assig@number}}%
+\section*{\document@hwexamtype~\arabic{section}:~\assig@title\given@due{\\(})}%
+\addcontentsline{toc}{section}{\document@hwexamtype~{\arabic{section}}:~\assig@title}%
+\setcounter{problem}{0}}
+\else
+\def\assignment@titleblock{%
+\setcounter{section}{\assig@number}
+\begin{center}\bf
+\Large\@title\\
+\document@hwexamtype~\assig@number:~\assig@title\strut\\
+\large{\given@due()}
+\end{center}}
+\fi
+\def\assignment@process@keys#1{\metasetkeys{assig}{#1}
+\ifx\inclassig@title\@empty\else\def\assig@title{\inclassig@title}\fi
+\ifx\inclassig@type\@empty\else\def\assig@type{\inclassig@type}\fi
+\ifx\inclassig@number\@empty\else\def\assig@number{\inclassig@number}\fi
+\ifx\inclassig@due\@empty\else\def\assig@due{\inclassig@due}\fi
+\ifx\inclassig@given\@empty\else\def\assig@given{\inclassig@given}\fi}
+\def\inclassig@title{}
+\def\inclassig@type{}
+\def\inclassig@number{}
+\def\inclassig@due{}
+\def\inclassig@given{}
+\newenvironment{assignment}[1][]{\assignment@process@keys{#1}%
+\assignment@titleblock}{}
+\addmetakey[\assig@default@type]{document}{hwexamtype}
+\addmetakey{inclassig}{number}
+\addmetakey{inclassig}{title}
+\addmetakey{inclassig}{type}
+\addmetakey{inclassig}{given}
+\addmetakey{inclassig}{due}
+\newcommand{\includeassignment}[2][]{\metasetkeys{inclassig}{#1}\include{#2}}
+\newcommand{\inputassignment}[2][]{\metasetkeys{inclassig}{#1}\input{#2}}
+\addmetakey{quizheading}{tas}
+\newcommand\quizheading[1]{\def\@tas{#1}%
+\large\noindent NAME: \hspace{8cm} MAILBOX:\\[2ex]%
+\ifx\@tas\@empty\else%
+\noindent YOUR TA: \@for\@I:=\@tas\do{$\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}
+\def\testspace#1{\iftest\vspace*{#1}\fi}
+\def\testnewpage{\iftest\newpage\fi}
+\def\testemptypage{\iftest\begin{center}This page was intentionally left
+ blank for extra space\end{center}\vfill\eject\else\fi}
+\def\@problem#1#2#3{\stepcounter{assignment@probs}
+\def\@test{#2}\ifx\@test\@empty\else\addtocounter{assignment@totalpts}{#2}\fi
+\def\@test{#3}\ifx\@test\@empty\else\addtocounter{assignment@totalmin}{#3}\fi
+\xdef\correction@probs{\correction@probs & #1}%
+\xdef\correction@pts{\correction@pts & #2}
+\xdef\correction@reached{\correction@reached &}}
+\newcounter{assignment@probs}
+\newcounter{assignment@totalpts}
+\newcounter{assignment@totalmin}
+\def\correction@probs{prob.}%
+\def\correction@pts{total}%
+\def\correction@reached{reached}%
+\stepcounter{assignment@probs}
+\def\correction@table{\begin{tabular}{|l|*{\theassignment@probs}{c|}|p{3cm}|}\hline%
+&\multicolumn{\theassignment@probs}{c||}%
+{\footnotesize To be used for grading, do not write here} &\\\hline
+\correction@probs & Sum & grade\\\hline
+\correction@pts &\theassignment@totalpts & \strut\hspace{3cm}\strut\\\hline
+\correction@reached & & \\[.7cm]\hline
+\end{tabular}}
+\endinput
+%%
+%% End of file `hwexam.sty'.
diff --git a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty.ltxml b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty.ltxml
new file mode 100644
index 00000000000..e0857729fe8
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty.ltxml
@@ -0,0 +1,29 @@
+# -*- CPERL -*-
+package LaTeXML::Package::Pool;
+use strict;
+use LaTeXML::Package;
+RequirePackage('problem');
+RegisterNamespace('assig'=>"http://omdoc.org/ontology/assignments#");
+RegisterDocumentNamespace('assig'=>"http://omdoc.org/ontology/assignments#");
+DefEnvironment('{assignment} OptionalKeyVals:assig',
+ "<omdoc:omgroup ?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() "
+ . "assig:dummy='for the namespace'"
+ . "?#locator(stex:srcref='#locator')()>"
+ . "<omdoc:metadata ?#locator(stex:srcref='#locator')()>"
+ . "<dc:title ?#locator(stex:srcref='#locator')()>"
+ . "Assignment ?&KeyVal(#1,'num')(&KeyVal(#1,'num').)()"
+ . "?&KeyVal(#1,'title')((&KeyVal(#1,'title')))"
+ . "</dc:title>"
+ . "?&KeyVal(#1,'given')(<omdoc:meta property='assig:given'>&KeyVal(#1,'given')</omdoc:meta>)()"
+ . "?&KeyVal(#1,'due')(<omdoc:meta property='assig:due'>&KeyVal(#1,'due')</omdoc:meta>)()"
+ . "?&KeyVal(#1,'pts')(<omdoc:meta property='assig:pts'>&KeyVal(#1,'pts')</omdoc:meta>)()"
+ . "</omdoc:metadata>"
+ . "#body"
+ ."</omdoc:omgroup>\n");
+DefMacro('\includeassignment [] {}','\input{#2}');
+DefMacro('\inputassignment [] {}','\input{#2}');
+DefEnvironment('{testheading}OptionalKeyVals:omdoc','');
+DefConstructor('\testspace{}','');
+DefConstructor('\testnewpage','');
+DefConstructor('\testemptypage','');
+1;