diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/README | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf | bin | 690202 -> 693812 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex | 33 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets.sty | 60 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/tasks.sty | 17 |
5 files changed, 99 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/latex/exsheets/README b/Master/texmf-dist/doc/latex/exsheets/README index 8869c5c2001..faed4849294 100644 --- a/Master/texmf-dist/doc/latex/exsheets/README +++ b/Master/texmf-dist/doc/latex/exsheets/README @@ -1,7 +1,7 @@ -------------------------------------------------------------------------- -EXSHEETS 2013/10/24 +EXSHEETS 2013/11/20 bundled packages: -the EXSHEETS package v0.10 +the EXSHEETS package v0.11 Yet another package for the creation of exercise sheets the EXSHEETS-LISTINGS package v0.2 Using listings in exsheets diff --git a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf Binary files differindex ac91edfbcfc..3b54dfb80f5 100644 --- a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf +++ b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf diff --git a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex index 547d7257865..54c8e2196c1 100644 --- a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex +++ b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex @@ -70,6 +70,7 @@ examspace, exlabel, ForEachQuestion, + GetQuestionClass, GetQuestionProperty, grade, includequestions,iflastquestion, @@ -78,6 +79,7 @@ numberofquestions, points,pointssum, PrintIfIncludeActiveF,PrintIfIncludeActiveT,PrintIfIncludeActiveTF, + PrintQuestionClassF,PrintQuestionClassT,PrintQuestionClassTF, printsolutions, PrintSolutionsF,PrintSolutionsTF,PrintSolutionsT, questionsincludedlast,QuestionNumber,RenewQuSolPair, @@ -392,6 +394,10 @@ proposes a solution for the problem of using verbatim material in \ExSheets' \env{question} and \env{solution} environments. It is presented in part~\ref{part:listings}. +\subsection{Version 0.11} +The commands \cs{GetQuestionClass} and \cs{PrintQuestionClassTF} have been +added. They're explained in section~\ref{sec:retr-class-value}. + \section{Thanks} I need to thank the many users who gave me feedback so far! For one thing this shows me that \ExSheets\ is useful to people. It also led to many @@ -1113,6 +1119,33 @@ now do something like the following: \end{question} \end{example} +\subsection{Retrieving the Class Value in a Question}\label{sec:retr-class-value} +Sometimes it may be desirable to retrieve the value of a class defined by +\cs{DeclareQuestionClass} that a question has in order to be able to print, +say. This is possible with the following commands: +\begin{commands} + \expandable\command{GetQuestionClass}[\marg{class}] + Prints the value of \meta{class} a question has. The command is + expandable. If the class does not exist or the value is empty the command + expands to nothing. + \command{PrintQuestionClassTF}[\marg{class}\marg{true}\marg{false}] + Test if a question has a non-empty value for class \meta{class} and either + leaves \meta{true} or \meta{false} in the input stream. In the + \meta{true} argument you can refer to the value with \code{\#1} where you + want it printed. + \command{PrintQuestionClassT}[\marg{class}\marg{true}] + Like \cs{PrintQuestionClassTF} but only has the \meta{true} branch. + \command{PrintQuestionClassF}[\marg{class}\marg{false}] + Like \cs{PrintQuestionClassTF} but only has the \meta{false} branch. +\end{commands} + +\begin{example} + \begin{question}[difficulty=hard] + This question has the difficulty level + ``\PrintQuestionClassTF{difficulty}{#1}{??}''. + \end{question} +\end{example} + \ExplSyntaxOn \bool_set_false:N \g__exsheets_use_difficulties_bool \ExplSyntaxOff 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: diff --git a/Master/texmf-dist/tex/latex/exsheets/tasks.sty b/Master/texmf-dist/tex/latex/exsheets/tasks.sty index af6f1ee9fea..96441a80247 100644 --- a/Master/texmf-dist/tex/latex/exsheets/tasks.sty +++ b/Master/texmf-dist/tex/latex/exsheets/tasks.sty @@ -265,6 +265,11 @@ label-offset : length = .3333em , after-item-skip : skip = 1ex plus 1ex minus 1ex } + +% in the next three commands we want a really unlikely to occurr marker; for +% this we use $ with unusual catcode in ``$tasks$default$label$'': +\char_set_catcode_alignment:N \$ + % the `default' template code: \DeclareTemplateCode { tasks } { default } { 3 } { @@ -335,7 +340,7 @@ \__tasks_read_item:w ##1 \q_stop \bool_if:NTF \l__tasks_enumerate_bool { - \tl_if_eq:VnT \l__tasks_tmp_label_tl { @tasks@default@label@ } + \tl_if_eq:VnT \l__tasks_tmp_label_tl { $tasks$default$label$ } { \int_gincr:N \g__tasks_int \SaveCounterPatternFrom [ tasks ] @@ -350,7 +355,7 @@ { \tl_set_eq:NN \l__tasks_label_tl \labelitemi } } \tl_put_left:NV \l__tasks_label_tl \l__tasks_label_format_tl - \tl_if_eq:VnTF \l__tasks_tmp_label_tl { @tasks@default@label@ } + \tl_if_eq:VnTF \l__tasks_tmp_label_tl { $tasks$default$label$ } { \__tasks_task:VVw \l__tasks_label_tl @@ -373,17 +378,19 @@ { \peek_meaning:NTF [ { \__tasks_read_item_aux:w } - { \__tasks_read_item_aux:w[@tasks@default@label@] } + { \__tasks_read_item_aux:w[$tasks$default$label$] } } \cs_new_protected:Npn \__tasks_read_item_aux:w [#1]#2 \q_stop { \tl_set:Nn \l__tasks_tmp_label_tl { #1 } - \tl_if_eq:nnF { #1 } { @tasks@default@label@ } + \tl_if_eq:nnF { #1 } { $tasks$default$label$ } { \tl_put_left:NV \l__tasks_tmp_label_tl \l__tasks_label_format_tl } \tl_set:Nn \l__tasks_item_tl { \ignorespaces #2 } } +\char_set_catcode_math_toggle:N \$ + % -------------------------------------------------------------------------- % choice box: \bool_new:N \l__tasks_choice_checked_bool @@ -570,4 +577,4 @@ be put at the beginning of a row 2013/04/22 v0.9a - new option `item-indent' - synchronized version number with `exsheets' until now but - won't any more
\ No newline at end of file + won't any more |