diff options
author | Karl Berry <karl@freefriends.org> | 2022-05-24 20:23:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-05-24 20:23:29 +0000 |
commit | d1a45dc92e84130c08386511a72d4ba1bc95b1b9 (patch) | |
tree | 0b41d5e406b7fb349d9c8a6fe3e05e255e2b92a9 /Master/texmf-dist/tex/latex/stex/hwexam.sty | |
parent | 36e380761892b6ddfed9ad4e5cd585a8b3ae17cc (diff) |
stex (24may22)
git-svn-id: svn://tug.org/texlive/trunk@63390 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/hwexam.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/hwexam.sty | 145 |
1 files changed, 72 insertions, 73 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/hwexam.sty b/Master/texmf-dist/tex/latex/stex/hwexam.sty index b1738e32924..84387461ed3 100644 --- a/Master/texmf-dist/tex/latex/stex/hwexam.sty +++ b/Master/texmf-dist/tex/latex/stex/hwexam.sty @@ -6,7 +6,7 @@ %% %% hwexam.dtx (with options: `package') %% -\ProvidesExplPackage{hwexam}{2022/02/26}{3.0.1}{homework assignments and exams} +\ProvidesExplPackage{hwexam}{2022/05/24}{3.1.0}{homework assignments and exams} \RequirePackage{l3keys2e} \newif\iftest\testfalse @@ -50,116 +50,115 @@ blank~for~extra~space} } \newcounter{assignment} -\numberproblemsin{assignment} -\renewcommand\prob@label[1]{\assignment@number.#1} \keys_define:nn { hwexam / assignment } { -id .str_set_x:N = \l__hwexam_assign_id_str, -number .int_set:N = \l__hwexam_assign_number_int, -title .tl_set:N = \l__hwexam_assign_title_tl, -type .tl_set:N = \l__hwexam_assign_type_tl, -given .tl_set:N = \l__hwexam_assign_given_tl, -due .tl_set:N = \l__hwexam_assign_due_tl, +id .str_set_x:N = \l__problems_assign_id_str, +number .int_set:N = \l__problems_assign_number_int, +title .tl_set:N = \l__problems_assign_title_tl, +type .tl_set:N = \l__problems_assign_type_tl, +given .tl_set:N = \l__problems_assign_given_tl, +due .tl_set:N = \l__problems_assign_due_tl, loadmodules .code:n = { -\bool_set_true:N \l__hwexam_assign_loadmodules_bool +\bool_set_true:N \l__problems_assign_loadmodules_bool } } -\cs_new_protected:Nn \__hwexam_assignment_args:n { -\str_clear:N \l__hwexam_assign_id_str -\int_set:Nn \l__hwexam_assign_number_int {-1} -\tl_clear:N \l__hwexam_assign_title_tl -\tl_clear:N \l__hwexam_assign_type_tl -\tl_clear:N \l__hwexam_assign_given_tl -\tl_clear:N \l__hwexam_assign_due_tl -\bool_set_false:N \l__hwexam_assign_loadmodules_bool +\cs_new_protected:Nn \__problems_assignment_args:n { +\str_clear:N \l__problems_assign_id_str +\int_set:Nn \l__problems_assign_number_int {-1} +\tl_clear:N \l__problems_assign_title_tl +\tl_clear:N \l__problems_assign_type_tl +\tl_clear:N \l__problems_assign_given_tl +\tl_clear:N \l__problems_assign_due_tl +\bool_set_false:N \l__problems_assign_loadmodules_bool \keys_set:nn { hwexam / assignment }{ #1 } } \newcommand\given@due[2]{ \bool_lazy_all:nF { -{\tl_if_empty_p:V \l__hwexam_inclassign_given_tl} -{\tl_if_empty_p:V \l__hwexam_assign_given_tl} -{\tl_if_empty_p:V \l__hwexam_inclassign_due_tl} -{\tl_if_empty_p:V \l__hwexam_assign_due_tl} +{\tl_if_empty_p:V \l__problems_inclassign_given_tl} +{\tl_if_empty_p:V \l__problems_assign_given_tl} +{\tl_if_empty_p:V \l__problems_inclassign_due_tl} +{\tl_if_empty_p:V \l__problems_assign_due_tl} }{ #1 } -\tl_if_empty:NTF \l__hwexam_inclassign_given_tl { -\tl_if_empty:NF \l__hwexam_assign_given_tl { -\hwexam@given@kw\xspace\l__hwexam_assign_given_tl +\tl_if_empty:NTF \l__problems_inclassign_given_tl { +\tl_if_empty:NF \l__problems_assign_given_tl { +\hwexam@given@kw\xspace\l__problems_assign_given_tl } }{ -\hwexam@given@kw\xspace\l__hwexam_inclassign_given_tl +\hwexam@given@kw\xspace\l__problems_inclassign_given_tl } \bool_lazy_or:nnF { \bool_lazy_and_p:nn { -\tl_if_empty_p:V \l__hwexam_inclassign_due_tl +\tl_if_empty_p:V \l__problems_inclassign_due_tl }{ -\tl_if_empty_p:V \l__hwexam_assign_due_tl +\tl_if_empty_p:V \l__problems_assign_due_tl } }{ \bool_lazy_and_p:nn { -\tl_if_empty_p:V \l__hwexam_inclassign_due_tl +\tl_if_empty_p:V \l__problems_inclassign_due_tl }{ -\tl_if_empty_p:V \l__hwexam_assign_due_tl +\tl_if_empty_p:V \l__problems_assign_due_tl } }{ ,~ } -\tl_if_empty:NTF \l__hwexam_inclassign_due_tl { -\tl_if_empty:NF \l__hwexam_assign_due_tl { -\hwexam@due@kw\xspace \l__hwexam_assign_due_tl +\tl_if_empty:NTF \l__problems_inclassign_due_tl { +\tl_if_empty:NF \l__problems_assign_due_tl { +\hwexam@due@kw\xspace \l__problems_assign_due_tl } }{ -\hwexam@due@kw\xspace \l__hwexam_inclassign_due_tl +\hwexam@due@kw\xspace \l__problems_inclassign_due_tl } \bool_lazy_all:nF { -{ \tl_if_empty_p:V \l__hwexam_inclassign_given_tl } -{ \tl_if_empty_p:V \l__hwexam_assign_given_tl } -{ \tl_if_empty_p:V \l__hwexam_inclassign_due_tl } -{ \tl_if_empty_p:V \l__hwexam_assign_due_tl } +{ \tl_if_empty_p:V \l__problems_inclassign_given_tl } +{ \tl_if_empty_p:V \l__problems_assign_given_tl } +{ \tl_if_empty_p:V \l__problems_inclassign_due_tl } +{ \tl_if_empty_p:V \l__problems_assign_due_tl } }{ #2 } } \newcommand\assignment@title[3]{ -\tl_if_empty:NTF \l__hwexam_inclassign_title_tl { -\tl_if_empty:NTF \l__hwexam_assign_title_tl { +\tl_if_empty:NTF \l__problems_inclassign_title_tl { +\tl_if_empty:NTF \l__problems_assign_title_tl { #1 }{ -#2\l__hwexam_assign_title_tl#3 +#2\l__problems_assign_title_tl#3 } }{ -#2\l__hwexam_inclassign_title_tl#3 +#2\l__problems_inclassign_title_tl#3 } } \newcommand\assignment@number{ -\int_compare:nNnTF \l__hwexam_inclassign_number_int = {-1} { -\int_compare:nNnTF \l__hwexam_assign_number_int = {-1} { +\int_compare:nNnTF \l__problems_inclassign_number_int = {-1} { +\int_compare:nNnTF \l__problems_assign_number_int = {-1} { \arabic{assignment} } { -\int_use:N \l__hwexam_assign_number_int +\int_use:N \l__problems_assign_number_int } }{ -\int_use:N \l__hwexam_inclassign_number_int +\int_use:N \l__problems_inclassign_number_int } } \newenvironment{assignment}[1][]{ -\__hwexam_assignment_args:n { #1 } -\int_compare:nNnTF \l__hwexam_assign_number_int = {-1} { +\__problems_assignment_args:n { #1 } +\int_compare:nNnTF \l__problems_assign_number_int = {-1} { \global\stepcounter{assignment} }{ -\global\setcounter{assignment}{\int_use:N\l__hwexam_assign_number_int} +\global\setcounter{assignment}{\int_use:N\l__problems_assign_number_int} } \setcounter{problem}{0} +\renewcommand\prob@label[1]{\assignment@number.##1} \def\current@section@level{\document@hwexamtype} \begin{@assignment} }{ \end{@assignment} } \def\ass@title{ -\protect\document@hwexamtype~\arabic{assignment} +{\protect\document@hwexamtype}~\arabic{assignment} \assignment@title{}{\;(}{)\;} -- \given@due{}{} } \ifmultiple \newenvironment{@assignment}{ -\bool_if:NTF \l__hwexam_assign_loadmodules_bool { +\bool_if:NTF \l__problems_assign_loadmodules_bool { \begin{sfragment}[loadmodules]{\ass@title} }{ \begin{sfragment}{\ass@title} @@ -177,34 +176,34 @@ loadmodules .code:n = { }{} \fi% multiple \keys_define:nn { hwexam / inclassignment } { -number .int_set:N = \l__hwexam_inclassign_number_int, -title .tl_set:N = \l__hwexam_inclassign_title_tl, -type .tl_set:N = \l__hwexam_inclassign_type_tl, -given .tl_set:N = \l__hwexam_inclassign_given_tl, -due .tl_set:N = \l__hwexam_inclassign_due_tl, -mhrepos .str_set_x:N = \l__hwexam_inclassign_mhrepos_str -} -\cs_new_protected:Nn \__hwexam_inclassignment_args:n { -\int_set:Nn \l__hwexam_inclassign_number_int {-1} -\tl_clear:N \l__hwexam_inclassign_title_tl -\tl_clear:N \l__hwexam_inclassign_type_tl -\tl_clear:N \l__hwexam_inclassign_given_tl -\tl_clear:N \l__hwexam_inclassign_due_tl -\str_clear:N \l__hwexam_inclassign_mhrepos_str +number .int_set:N = \l__problems_inclassign_number_int, +title .tl_set:N = \l__problems_inclassign_title_tl, +type .tl_set:N = \l__problems_inclassign_type_tl, +given .tl_set:N = \l__problems_inclassign_given_tl, +due .tl_set:N = \l__problems_inclassign_due_tl, +mhrepos .str_set_x:N = \l__problems_inclassign_mhrepos_str +} +\cs_new_protected:Nn \__problems_inclassignment_args:n { +\int_set:Nn \l__problems_inclassign_number_int {-1} +\tl_clear:N \l__problems_inclassign_title_tl +\tl_clear:N \l__problems_inclassign_type_tl +\tl_clear:N \l__problems_inclassign_given_tl +\tl_clear:N \l__problems_inclassign_due_tl +\str_clear:N \l__problems_inclassign_mhrepos_str \keys_set:nn { hwexam / inclassignment }{ #1 } } -\__hwexam_inclassignment_args:n {} +\__problems_inclassignment_args:n {} \newcommand\inputassignment[2][]{ -\__hwexam_inclassignment_args:n { #1 } -\str_if_empty:NTF \l__hwexam_inclassign_mhrepos_str { +\__problems_inclassignment_args:n { #1 } +\str_if_empty:NTF \l__problems_inclassign_mhrepos_str { \input{#2} }{ -\stex_in_repository:nn{\l__hwexam_inclassign_mhrepos_str}{ -\input{\mhpath{\l__hwexam_inclassign_mhrepos_str}{#2}} +\stex_in_repository:nn{\l__problems_inclassign_mhrepos_str}{ +\input{\mhpath{\l__problems_inclassign_mhrepos_str}{#2}} } } -\__hwexam_inclassignment_args:n {} +\__problems_inclassignment_args:n {} } \newcommand\includeassignment[2][]{ \newpage @@ -236,7 +235,7 @@ duration .tl_set:N = \testheading@duration, reqpts .tl_set:N = \testheading@reqpts, tools .tl_set:N = \testheading@tools } -\cs_new_protected:Nn \__hwexam_testheading_args:n { +\cs_new_protected:Nn \__problems_testheading_args:n { \tl_clear:N \testheading@min \tl_clear:N \testheading@duration \tl_clear:N \testheading@reqpts @@ -244,7 +243,7 @@ tools .tl_set:N = \testheading@tools \keys_set:nn { hwexam / testheading }{ #1 } } \newenvironment{testheading}[1][]{ -\__hwexam_testheading_args:n{ #1 } +\__problems_testheading_args:n{ #1 } \newcount\check@time\check@time=\testheading@min \advance\check@time by -\theassignment@totalmin \newif\if@bonuspoints |