summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-11-22 00:04:35 +0000
committerKarl Berry <karl@freefriends.org>2013-11-22 00:04:35 +0000
commit9dd6af228b319f176777f85b0b551eda0df6cfbe (patch)
tree796ced742f82bbc992f2c3ef2ee0106b8bfde4f4 /Master/texmf-dist/tex
parent7e261e1a8dfc2d4a4f821b843dbbd9c20fd19baa (diff)
exsheets (20nov13)
git-svn-id: svn://tug.org/texlive/trunk@32203 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/exsheets.sty60
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/tasks.sty17
2 files changed, 64 insertions, 13 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:
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