diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/exsheets/exsheets.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets.sty | 60 |
1 files changed, 52 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty index 0ac48c0717c..ed95236e601 100644 --- a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty +++ b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty @@ -25,8 +25,8 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % ---------------------------------------------------------------------------- -\def\exsheets@date{2013/10/11} -\def\exsheets@version{0.10} +\def\exsheets@date{2013/11/20} +\def\exsheets@version{0.11} \RequirePackage { expl3 , xparse } \ProvidesExplPackage @@ -900,6 +900,36 @@ { \exsheets_declare_question_class:nn { #1 } { #2 } } \@onlypreamble \DeclareQuestionClass +\cs_new:Npn \exsheets_get_question_class:n #1 + { + \cs_if_exist:cT { l__exsheets_questions_#1_tl } + { \tl_use:c { l__exsheets_questions_#1_tl } } + } + +\DeclareExpandableDocumentCommand \GetQuestionClass { m } + { \exsheets_get_question_class:n { #1 } } + +\cs_new_protected:Npn \exsheets_print_question_class:nTF #1#2#3 + { + \group_begin: + \tl_set:Nx \l__exsheets_tmpa_tl + { \exsheets_get_question_class:n { #1 } } + \tl_if_blank:VTF \l__exsheets_tmpa_tl + { #3 } + { + \cs_set_protected:Npn \__exsheets_print_question_class:n ##1 { #2 } + \__exsheets_print_question_class:n + { \exsheets_get_question_class:n { #1 } } + } + \group_end: + } +\NewDocumentCommand \PrintQuestionClassTF { mmm } + { \exsheets_print_question_class:nTF { #1 } { #2 } { #3 } } +\NewDocumentCommand \PrintQuestionClassT { mm } + { \exsheets_print_question_class:nTF { #1 } { #2 } { } } +\NewDocumentCommand \PrintQuestionClassF { mm } + { \exsheets_print_question_class:nTF { #1 } { } { #2 } } + % ---------------------------------------------------------------------------- % die 'question' Umgebung \tl_new:N \l__exsheets_questions_name_tl @@ -1145,6 +1175,16 @@ \l__exsheets_questions_title_tl \l__exsheets_exercise_name_tl } + \tl_if_blank:VTF \l__exsheets_questions_id_tl + { + \tl_set:Nx \l__exsheets_tmpa_tl + { \int_use:N \g__exsheets_questions_id_int } + } + { + \tl_set_eq:NN + \l__exsheets_tmpa_tl + \l__exsheets_questions_id_tl + } \bool_if:NTF \l__exsheets_parse_points_bool { \__exsheets_use_heading:VVVnnV @@ -1153,7 +1193,7 @@ \l__exsheets_qu_counter_interpretation_tl { \l__exsheets_question_points_fp } { \l__exsheets_question_bonus_fp } - \g__exsheets_questions_current_id_tl + \l__exsheets_tmpa_tl } { \__exsheets_use_heading:VVVnnV @@ -1162,7 +1202,7 @@ \l__exsheets_qu_counter_interpretation_tl { \l__exsheets_questions_points_tl } { 0 } - \g__exsheets_questions_current_id_tl + \l__exsheets_tmpa_tl } } } @@ -1986,7 +2026,7 @@ \cs_new_protected:Npn \__exsheets_print_solution_if:nn #1#2 { - \exp_args:No \int_compare:nT { #2 } + \bool_if:nT { #2 } { \prop_get:NnN \g__exsheets_solutions_names_prop { #1 } \l__exsheets_tmpa_tl @@ -2068,7 +2108,7 @@ { \__exsheets_read_number:w #2 \q_stop \__exsheets_print_solution_if:nn { #1 } - { \l__exsheets_counter_sec_int = #3 } + { \int_compare_p:n { \l__exsheets_counter_sec_int = #3 } } } % print by chapter: @@ -2126,7 +2166,7 @@ { \__exsheets_read_number:w #2 \q_stop \__exsheets_print_solution_if:nn { #1 } - { \l__exsheets_counter_ch_int = #3 } + { \int_compare_p:n { \l__exsheets_counter_ch_int = #3 } } } % print all: @@ -2732,7 +2772,11 @@ HISTORY: - changed horizontal spaces declared as `1ex' into `.3333em' in the declarations of the headings instances - +2013/11/07 v0.10a - fix bug in loading headings of questions; when + included from an external file sometimes the wrong ID + has been passed to the headings +2013/11/20 v0.11 - \GetQuestionClass{} + - \PrintQuestionClass(TF) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO: |