summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-08-14 21:59:50 +0000
committerKarl Berry <karl@freefriends.org>2016-08-14 21:59:50 +0000
commit5d04af50057f1d5b00575b4374bd1d856f3390f9 (patch)
tree2213f685f7381e7d10b0fbdb157eeb535c94011a /Master/texmf-dist/tex
parente7b9ba9bd3d15b500cc7433035fd41bebde49942 (diff)
exsheets (14aug16)
git-svn-id: svn://tug.org/texlive/trunk@41850 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/exsheets.sty764
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg8
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def2
3 files changed, 345 insertions, 429 deletions
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty
index 73d7bbd6d24..9509f543385 100644
--- a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty
+++ b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty
@@ -28,8 +28,8 @@
\RequirePackage { expl3 , xparse }
\ExplSyntaxOn
-\tl_const:Nn \c_exsheets_date_tl {2016/02/01}
-\tl_const:Nn \c_exsheets_version_tl {0.21b}
+\tl_const:Nn \c_exsheets_date_tl {2016/08/14}
+\tl_const:Nn \c_exsheets_version_tl {0.21d}
\tl_const:Nn \c_exsheets_info_tl
{Yet~ another~ package~ for~ the~ creation~ of~ exercise~ sheets~ and~ exams.}
@@ -41,11 +41,11 @@
% ----------------------------------------------------------------------------
% variants of kernel functions:
-\cs_generate_variant:Nn \prop_get:NnN { NV , Nx , cV , cf }
-\cs_generate_variant:Nn \prop_get:NnNF { NV , Nx , cV , cf }
-\cs_generate_variant:Nn \prop_get:NnNT { NV , Nx , cV , cf }
-\cs_generate_variant:Nn \prop_get:NnNTF { NV , Nx , cV , cf }
-\cs_generate_variant:Nn \prop_gput:Nnn { Nf , Nff , Nfx , Nx , Nxx , NxV , cf , cff }
+\cs_generate_variant:Nn \prop_get:NnN { NV , Nx , cV , cx }
+\cs_generate_variant:Nn \prop_get:NnNF { NV , Nx , cV , cx }
+\cs_generate_variant:Nn \prop_get:NnNT { NV , Nx , cV , cx }
+\cs_generate_variant:Nn \prop_get:NnNTF { NV , Nx , cV , cx }
+\cs_generate_variant:Nn \prop_gput:Nnn { Nf , Nff , Nfx , Nx , Nxx , NxV , cx , cxx }
\cs_generate_variant:Nn \prop_gput_if_new:Nnn { Nxx }
\cs_generate_variant:Nn \tl_if_blank:nTF { x }
\cs_generate_variant:Nn \tl_if_eq:nnF { x }
@@ -63,6 +63,7 @@
\int_new:N \l__exsheets_tmpc_int
\int_new:N \l__exsheets_tmpd_int
\int_new:N \l__exsheets_tmpe_int
+\int_new:N \g__exsheets_tmpa_int
\dim_new:N \l__exsheets_tmpa_dim
\dim_new:N \l__exsheets_tmpb_dim
\seq_new:N \l__exsheets_tmpa_seq
@@ -166,14 +167,7 @@
% ----------------------------------------------------------------------------
\RequirePackage
- { xtemplate , l3sort , l3keys2e , xcolor , etoolbox , environ , pgfcore }
-
-% ----------------------------------------------------------------------------
-% color:
-\xdefinecolor { exsheetsblue } { rgb } { 0.02 , 0.04 , 0.48 }
-\xdefinecolor { exsheetsred } { rgb } { 0.65 , 0.04 , 0.07 }
-% \tl_new:N \g__exsheets_color_tl
-\tl_const:Nn \c__exsheets_color_tl { exsheetsblue }
+ { xtemplate , l3sort , l3keys2e , etoolbox , environ , pgfcore }
% ----------------------------------------------------------------------------
% write to aux file:
@@ -188,78 +182,220 @@
\exp_not:N \providecommand \exp_not:N \exsheets@save@number[2]{} ^^J
\exp_not:N \providecommand \exp_not:N \exsheets@sum@of@points[1]{} ^^J
\exp_not:N \providecommand \exp_not:N \exsheets@sum@of@bonus[1]{} ^^J
- \exp_not:N \providecommand \exp_not:N \exsheets@use@id[2]{} ^^J
- % \exp_not:N \providecommand \exp_not:N \exsheets@number@of@questions[1]{} ^^J
- % \exp_not:N \providecommand \exp_not:N \numberofquestions{}
+ \exp_not:N \providecommand \exp_not:N \exsheets@used@id[2]{} ^^J
}
}
% ----------------------------------------------------------------------------
-% how are questions/solutions/... counted?
-\bool_new:N \l__exsheets_print_number_bool
-\bool_set_true:N \l__exsheets_print_number_bool
-
+% variables:
+\bool_new:N \l__exsheets_print_number_bool
+\bool_set_true:N \l__exsheets_print_number_bool
+\bool_new:N \l__exsheets_solutions_by_ref_bool
+\bool_new:N \l__exsheets_questions_totoc_bool
+\bool_new:N \l__exsheets_solutions_totoc_bool
+\bool_new:N \l__exsheets_auto_label_bool
+\bool_new:N \l__exsheets_no_skip_after_bool
+\bool_new:N \l__exsheets_points_questions_default_bool
+\bool_set_false:N \l__exsheets_points_questions_default_bool
+\bool_new:N \l__exsheets_parse_points_bool
+\bool_set_true:N \l__exsheets_parse_points_bool
+\bool_new:N \l__exsheets_points_name_bool
+\bool_set_true:N \l__exsheets_points_name_bool
+\bool_new:N \l__exsheets_points_separate_bonus_bool
+\bool_new:N \l__exsheets_grades_half_bool
+\bool_new:N \g__exsheets_questions_use_bool
+\bool_gset_true:N \g__exsheets_questions_use_bool
+\bool_new:N \l__exsheets_questions_use_bool
+\bool_set_true:N \l__exsheets_questions_use_bool
+\bool_new:N \l__exsheets_questions_deactivate_bool
+\bool_new:N \l__exsheets_save_question_body_to_aux_bool
+\bool_set_false:N \l__exsheets_save_question_body_to_aux_bool
+\bool_new:N \l__exsheets_solutions_use_bool
+\bool_set_true:N \l__exsheets_solutions_use_bool
+\bool_new:N \l__exsheets_use_this_question_bool
+\bool_new:N \l__exsheets_questions_print_bool
+\bool_set_true:N \l__exsheets_questions_print_bool
+\bool_new:N \l__exsheets_inside_question_bool
+\bool_new:N \l__exsheets_only_print_points_bool
+\bool_new:N \l__exsheets_exam_bool
+\bool_set_false:N \l__exsheets_exam_bool
+\bool_new:N \l__exsheets_questions_runin_bool
+\bool_set_false:N \l__exsheets_questions_runin_bool
+\bool_new:N \l__exsheets_questions_debug_bool
+\bool_set_false:N \l__exsheets_questions_debug_bool
+\bool_new:N \l__exsheets_select_questions_bool
+\bool_new:N \l__exsheets_include_all_bool
+\bool_new:N \l__exsheets_include_random_bool
+\bool_new:N \l__exsheets_include_by_id_bool
+\bool_set_true:N \l__exsheets_include_all_bool
+\bool_new:N \l__exsheets_use_selection_bool
+\bool_new:N \l__exsheets_solutions_print_bool
+\bool_set_false:N \l__exsheets_solutions_print_bool
+\bool_new:N \l__exsheets_solutions_print_here_bool
+\bool_set_false:N \l__exsheets_solutions_print_here_bool
+\bool_new:N \l__exsheets_solutions_print_section_bool
+\bool_set_false:N \l__exsheets_solutions_print_section_bool
+\bool_new:N \l__exsheets_solutions_print_chapter_bool
+\bool_set_false:N \l__exsheets_solutions_print_chapter_bool
+\bool_new:N \l__exsheets_solutions_print_all_bool
+\bool_set_false:N \l__exsheets_solutions_print_all_bool
+\bool_new:N \l__exsheets_inside_solution_bool
+\bool_set_false:N \l__exsheets_inside_solution_bool
+\bool_new:N \l__exsheets_solutions_runin_bool
+\bool_set_false:N \l__exsheets_solutions_runin_bool
+\bool_new:N \l__exsheets_print_byID_sorted_bool
+\bool_set_true:N \l__exsheets_print_byID_sorted_bool
+\bool_new:N \l__exsheets_blank_width_bool
+\bool_new:N \l__exsheets_blank_linespread_bool
+
+\tl_new:N \l__exsheets_points_name_tl
+\tl_set:Nn \l__exsheets_points_name_tl {P.}
+\tl_new:N \l__exsheets_points_name_plural_tl
+\tl_set:Nn \l__exsheets_points_name_plural_tl {P.}
+\tl_new:N \l__exsheets_bonus_name_tl
+\tl_set:Nn \l__exsheets_bonus_name_tl {P.}
+\tl_new:N \l__exsheets_bonus_name_plural_tl
+\tl_set:Nn \l__exsheets_bonus_name_plural_tl {P.}
+\tl_new:N \l__exsheets_points_number_format_tl
+\tl_new:N \l__exsheets_bonus_number_format_tl
+\tl_new:N \l__exsheets_points_pre_bonus_marker_tl
+\tl_set:Nn \l__exsheets_points_pre_bonus_marker_tl { \space(+ }
+\tl_new:N \l__exsheets_points_post_bonus_marker_tl
+\tl_set:Nn \l__exsheets_points_post_bonus_marker_tl { ) }
+\tl_new:N \l__exsheets_points_format_tl
+\tl_set:Nn \l__exsheets_points_format_tl { \use:n }
\tl_new:N \l__exsheets_qu_counter_pattern_tl
\tl_set:Nn \l__exsheets_qu_counter_pattern_tl { qu. }
\tl_new:N \l__exsheets_qu_counter_interpretation_tl
\tl_new:N \l__exsheets_counter_patterns_tl
-\tl_new:N \l__exsheets_current_pattern_interpretation_tl
-\tl_new:N \l__exsheets_current_pattern_tl
+\tl_new:N \l__exsheets_heading_instance_tl
+\tl_set:Nn \l__exsheets_heading_instance_tl {block}
+\tl_new:N \l__exsheets_question_heading_instance_tl
+\tl_new:N \l__exsheets_solution_heading_instance_tl
+\tl_new:N \l_exsheets_heading_title_user_format_tl
+\tl_set:Nn \l_exsheets_heading_title_user_format_tl { \normalsize\bfseries }
+\tl_new:N \l_exsheets_heading_subtitle_user_format_tl
+\tl_set:Nn \l_exsheets_heading_subtitle_user_format_tl { \normalsize\itshape }
+\tl_new:N \l__exsheets_questions_toclevel_tl
+\tl_set:Nn \l__exsheets_questions_toclevel_tl {subsection}
+\tl_new:N \l__exsheets_solutions_toclevel_tl
+\tl_set:Nn \l__exsheets_solutions_toclevel_tl {subsection}
+\tl_new:N \l__exsheets_new_chapter_hook_tl
+\tl_new:N \l__exsheets_new_section_hook_tl
+\tl_new:N \g__exsheets_use_current_question_tl
+\tl_new:N \l__exsheets_questions_name_tl
+\tl_set:Nn \l__exsheets_questions_name_tl {Question}
+\tl_new:N \l__exsheets_exercise_name_tl
+\tl_set:Nn \l__exsheets_exercise_name_tl {Exercise}
+\tl_new:N \l__exsheets_questions_pre_hook_tl
+\tl_new:N \l__exsheets_questions_post_hook_tl
+\tl_new:N \l__exsheets_questions_pre_body_hook_tl
+\tl_new:N \l__exsheets_questions_post_body_hook_tl
+\tl_new:N \l__exsheets_after_begin_question_tl
+\tl_new:N \CurrentQuestionID
+\tl_new:N \l__exsheets_questions_id_tl
+\tl_new:N \l__exsheets_questions_subtitle_tl
+\tl_new:N \g__exsheets_questions_current_id_tl
+\tl_new:N \l__exsheets_questions_title_tl
+\tl_new:N \l__exsheets_questions_label_tl
+\tl_new:N \l__exsheets_questions_points_tl
+\tl_new:N \l__exsheets_include_id_tl
+\tl_new:N \l__exsheets_solutions_name_tl
+\tl_set:Nn \l__exsheets_solutions_name_tl {Solution}
+\tl_new:N \l__exsheets_solutions_pre_body_hook_tl
+\tl_new:N \l__exsheets_solutions_post_body_hook_tl
+\tl_new:N \l__exsheets_solutions_pre_hook_tl
+\tl_new:N \l__exsheets_solutions_post_hook_tl
+\tl_new:N \l__exsheets_blank_linespread_tl
+\tl_set:Nn \l__exsheets_blank_linespread_tl { 1 }
+\tl_new:N \l__exsheets_blank_scale_tl
+\tl_set:Nn \l__exsheets_blank_scale_tl { 1 }
+\tl_new:N \l__exsheets_use_solution_tl
+\tl_new:N \l_exsheets_solutions_name_style_tl
+\tl_set:Nn \l_exsheets_solutions_name_style_tl { \normalsize \bfseries }
-\RequirePackage { cntformats }
+\int_zero_new:N \l__exsheets_variations_int
+\int_new:N \g__exsheets_questions_id_int
+\int_gzero:N \g__exsheets_questions_id_int
+\int_new:N \g__exsheets_questions_used_int
+\int_zero_new:N \l__exsheets_include_random_int
+\int_new:N \l__exsheets_questions_set_int
+\int_new:N \g__exsheets_select_random_int
+\int_new:N \g__exsheets_selection_number_int
+\int_new:N \l__exsheets_counter_ch_int
+\int_new:N \l__exsheets_current_ch_int
+\int_new:N \l__exsheets_counter_sec_int
+\int_new:N \l__exsheets_current_sec_int
+\int_new:N \l_exsheets_counter_qu_int
+
+\fp_new:N \g__exsheets_points_sum_fp
+\fp_new:N \l__exsheets_points_default_fp
+\fp_set:Nn \l__exsheets_points_default_fp {1}
+\fp_new:N \l__exsheets_question_points_fp
+\fp_new:N \g_exsheets_total_points_fp
+\fp_new:N \g__exsheets_bonus_sum_fp
+\fp_new:N \l__exsheets_question_bonus_fp
+\fp_new:N \g_exsheets_total_bonus_fp
+\fp_new:N \l__exsheets_grade_round_fp
+\fp_zero:N \l__exsheets_grade_round_fp
+\fp_new:N \g__exsheets_this_question_points_fp
+\fp_new:N \g__exsheets_this_question_bonus_fp
+
+\dim_new:N \l__exsheets_questions_skip_below_dim
+\dim_set:Nn \l__exsheets_questions_skip_below_dim { .5\baselineskip }
+\dim_new:N \l__exsheets_solutions_skip_below_dim
+\dim_set:Nn \l__exsheets_solutions_skip_below_dim { .5\baselineskip }
+\dim_new:N \l__exsheets_blank_dim
+
+\seq_new:N \l__exsheets_use_tags_seq
+\seq_new:N \g_exsheets_included_questions_seq
+
+\prop_new:N \l__exsheets_relgrades_prop
+\prop_new:N \l__exsheets_class_prop
+\prop_new:N \g__exsheets_tags_prop
+\prop_new:N \g__exsheets_questions_id_prop
+\prop_new:N \g__exsheets_questions_subtitle_prop
+\prop_new:N \g__exsheets_questions_used_prop
+\prop_new:N \g_exsheets_question_identification_prop
+\prop_new:N \g__exsheets_included_questions_prop
+\prop_new:N \g__exsheets_solutions_content_prop
+\prop_new:N \g__exsheets_solutions_questions_id_prop
+\prop_new:N \g__exsheets_solutions_names_prop
+\prop_new:N \g__exsheets_solutions_counter_prop
+
+\clist_new:N \l__exsheets_include_id_clist
+\clist_new:N \l__exsheets_exclude_id_clist
+\clist_new:N \questionsincludedlast
+
+\box_new:N \l__exsheets_blank_box
+
+% ----------------------------------------------------------------------------
+% how are questions/solutions/... counted?
+\RequirePackage {cntformats}
\cs_if_exist:NT \thechapter
{
- \AddCounterPattern* [ exsheets ] { chapter } { ch }
- \ReadCounterFrom [ exsheets ] { chapter } \l__exsheets_counter_ch_int
+ \AddCounterPattern* [exsheets] {chapter} {ch}
+ \ReadCounterFrom [exsheets] {chapter} \l__exsheets_counter_ch_int
}
-\AddCounterPattern* [ exsheets ] { section } { se }
-\ReadCounterFrom [ exsheets ] { section } \l__exsheets_counter_sec_int
+\AddCounterPattern* [exsheets] {section} {se}
+\ReadCounterFrom [exsheets] {section} \l__exsheets_counter_sec_int
-\NewCounterPattern* [ exsheets ] { question } { qu }
-\ReadCounterFrom [ exsheets ] { question } \l_exsheets_counter_qu_int
+\NewCounterPattern* [exsheets] {question} {qu}
+\ReadCounterFrom [exsheets] {question} \l_exsheets_counter_qu_int
% ----------------------------------------------------------------------------
% (also) package options:
-\bool_new:N \l__exsheets_solutions_by_ref_bool
-\bool_new:N \l__exsheets_questions_totoc_bool
-\bool_new:N \l__exsheets_solutions_totoc_bool
-\bool_new:N \l__exsheets_auto_label_bool
-\bool_new:N \l__exsheets_no_skip_after_bool
-\bool_new:N \l__exsheets_use_saved_pattern_bool
-\bool_set_true:N \l__exsheets_use_saved_pattern_bool
-
-\tl_new:N \l__exsheets_heading_instance_tl
-\tl_set:Nn \l__exsheets_heading_instance_tl {block}
-\tl_new:N \l__exsheets_question_heading_instance_tl
-\tl_new:N \l__exsheets_solution_heading_instance_tl
-\tl_new:N \l_exsheets_heading_title_user_format_tl
-\tl_set:Nn \l_exsheets_heading_title_user_format_tl { \normalsize\bfseries }
-\tl_new:N \l_exsheets_heading_subtitle_user_format_tl
-\tl_set:Nn \l_exsheets_heading_subtitle_user_format_tl { \normalsize\itshape }
-\tl_new:N \l__exsheets_questions_toclevel_tl
-\tl_set:Nn \l__exsheets_questions_toclevel_tl {subsection}
-\tl_new:N \l__exsheets_solutions_toclevel_tl
-\tl_set:Nn \l__exsheets_solutions_toclevel_tl {subsection}
-\tl_new:N \l__exsheets_new_chapter_hook_tl
-\tl_new:N \l__exsheets_new_section_hook_tl
-
-\dim_new:N \l__exsheets_questions_skip_below_dim
-\dim_set:Nn \l__exsheets_questions_skip_below_dim { .5\baselineskip }
-\dim_new:N \l__exsheets_solutions_skip_below_dim
-\dim_set:Nn \l__exsheets_solutions_skip_below_dim { .5\baselineskip }
-
\keys_define:nn {exsheets}
{
- color .code:n =
- \exsheets_option_dropped:n {color} ,
counter-format .code:n =
- \SaveCounterPattern [ exsheets ]
+ \SaveCounterPattern [exsheets]
\l__exsheets_qu_counter_pattern_tl
\l__exsheets_qu_counter_interpretation_tl
{#1} ,
- counter-within .code:n = \@addtoreset{question}{#1} ,
+ counter-format .initial:n = qu. ,
+ counter-within .code:n = \@addtoreset {question} {#1} ,
headings .tl_set:N = \l__exsheets_heading_instance_tl ,
load-headings .code:n =
\exsheets_option_dropped:n {load-headings} ,
@@ -303,52 +439,16 @@
\cs_set:Npn \__exsheets_pageref:n {#1}
\exsheets_update_referencing_commands: ,
chapter-hook .tl_set:N = \l__exsheets_new_chapter_hook_tl ,
- section-hook .tl_set:N = \l__exsheets_new_section_hook_tl ,
- use-saved-counter-format .bool_set:N = \l__exsheets_use_saved_pattern_bool
+ section-hook .tl_set:N = \l__exsheets_new_section_hook_tl %,
+% use-saved-counter-format .bool_set:N = \l__exsheets_use_saved_pattern_bool
}
-\keys_set:nn {exsheets} { counter-format = qu. }
+% TODO: remove this in a v1.0:
% process package options:
\ProcessKeysOptions {exsheets}
% ----------------------------------------------------------------------------
% points for exercises
-\bool_new:N \l__exsheets_points_questions_default_bool
-\bool_set_false:N \l__exsheets_points_questions_default_bool
-\bool_new:N \l__exsheets_parse_points_bool
-\bool_set_true:N \l__exsheets_parse_points_bool
-\bool_new:N \l__exsheets_points_name_bool
-\bool_set_true:N \l__exsheets_points_name_bool
-\bool_new:N \l__exsheets_points_separate_bonus_bool
-
-\fp_new:N \g__exsheets_points_sum_fp
-\fp_new:N \l__exsheets_points_default_fp
-\fp_set:Nn \l__exsheets_points_default_fp { 1 }
-\fp_new:N \l__exsheets_question_points_fp
-% this one should be public:
-\fp_new:N \g_exsheets_total_points_fp
-\fp_new:N \g__exsheets_bonus_sum_fp
-\fp_new:N \l__exsheets_question_bonus_fp
-% this one should be public
-\fp_new:N \g_exsheets_total_bonus_fp
-
-\tl_new:N \l__exsheets_points_name_tl
-\tl_set:Nn \l__exsheets_points_name_tl {P.}
-\tl_new:N \l__exsheets_points_name_plural_tl
-\tl_set:Nn \l__exsheets_points_name_plural_tl {P.}
-\tl_new:N \l__exsheets_bonus_name_tl
-\tl_set:Nn \l__exsheets_bonus_name_tl {P.}
-\tl_new:N \l__exsheets_bonus_name_plural_tl
-\tl_set:Nn \l__exsheets_bonus_name_plural_tl {P.}
-\tl_new:N \l__exsheets_points_number_format_tl
-\tl_new:N \l__exsheets_bonus_number_format_tl
-\tl_new:N \l__exsheets_points_pre_bonus_marker_tl
-\tl_set:Nn \l__exsheets_points_pre_bonus_marker_tl { \space(+ }
-\tl_new:N \l__exsheets_points_post_bonus_marker_tl
-\tl_set:Nn \l__exsheets_points_post_bonus_marker_tl { ) }
-\tl_new:N \l__exsheets_points_format_tl
-\tl_set:Nn \l__exsheets_points_format_tl { \use:n }
-
\cs_new_protected:Npn \__exsheets_set_points_name:nNN #1#2#3
{
\tl_if_in:nnTF {#1} { / }
@@ -403,7 +503,7 @@
\tl_use:N #2
{
\bool_if:NTF \l__exsheets_parse_points_bool
- { \exsheets_num:n { \fp_to_decimal:n {#1} } }
+ { \exsheets_num:n {#1} }
{ \use:n {#1} }
}
\group_end:
@@ -646,8 +746,6 @@
% ----------------------------------------------------------------------------
% variations of an exam, see http://tex.stackexchange.com/q/57012/5049 for
% inspiration of the following features
-\int_zero_new:N \l__exsheets_variations_int
-
\cs_new_protected:Npn \exsheets_set_variations:n #1
{
\int_compare:nNnTF {#1} < { 2 }
@@ -736,11 +834,6 @@
% ----------------------------------------------------------------------------
% grades distribution
-\prop_new:N \l__exsheets_relgrades_prop
-\fp_new:N \l__exsheets_grade_round_fp
-\fp_zero:N \l__exsheets_grade_round_fp
-\bool_new:N \l__exsheets_grades_half_bool
-
\cs_new:Npn \__exsheets_fp_round_to_half:n #1
{ round( 2*(#1),0)/2 }
@@ -818,25 +911,10 @@
% ----------------------------------------------------------------------------
% Aufgaben und Lösungen
-\bool_new:N \g__exsheets_questions_use_bool
-\bool_gset_true:N \g__exsheets_questions_use_bool
-\bool_new:N \l__exsheets_questions_use_bool
-\bool_set_true:N \l__exsheets_questions_use_bool
-\bool_new:N \l__exsheets_questions_deactivate_bool
-\bool_new:N \l__exsheets_save_question_body_to_aux_bool
-\bool_set_false:N \l__exsheets_save_question_body_to_aux_bool
-
-\bool_new:N \l__exsheets_solutions_use_bool
-\bool_set_true:N \l__exsheets_solutions_use_bool
-
\cs_new:Npn \exsheets_glue:N #1
{ \cleaders \vbox:n {} \skip_vertical:N #1 }
% classes, topics and other group concepts:
-\prop_new:N \l__exsheets_class_prop
-\tl_new:N \g__exsheets_use_current_question_tl
-\bool_new:N \l__exsheets_use_this_question_bool
-
\cs_new_protected:Npn \exsheets_new_question_class:nn #1#2
{
\prop_put:Nnn \l__exsheets_class_prop {#2} {#1}
@@ -874,16 +952,16 @@
\bool_if:cT { l__exsheets_questions_#1_bool }
{
% add #1 to questions property
- \prop_gput:cff { g__exsheets_questions_#1_prop }
+ \prop_gput:cxx { g__exsheets_questions_#1_prop }
{ \int_to_arabic:n { \g__exsheets_questions_id_int } }
- { \tl_use:c { l__exsheets_questions_#1_tl } }
+ { \exp_not:v { l__exsheets_questions_#1_tl } }
% add to #2 list, if it's a new one
- \prop_get:cfNF { g__exsheets_#2_prop }
- { \tl_use:c { l__exsheets_questions_#1_tl } }
+ \prop_get:cxNF { g__exsheets_#2_prop }
+ { \exp_not:v { l__exsheets_questions_#1_tl } }
\l__exsheets_tmpa_tl
{
- \prop_gput:cfn { g__exsheets_#2_prop }
- { \tl_use:c { l__exsheets_questions_#1_tl } }
+ \prop_gput:cxn { g__exsheets_#2_prop }
+ { \exp_not:v { l__exsheets_questions_#1_tl } }
{ \__exsheets_dummy: }
}
}
@@ -891,8 +969,8 @@
\bool_if:cT { g__exsheets_use_#2_bool }
{
% is this question an active one?
- \prop_get:cfNTF { g__exsheets_#2_active_prop }
- { \tl_use:c { l__exsheets_questions_#1_tl } }
+ \prop_get:cxNTF { g__exsheets_#2_active_prop }
+ { \exp_not:v { l__exsheets_questions_#1_tl } }
\l__exsheets_tmpa_tl
{
\bool_set_true:c { l__exsheets_#1_active_bool }
@@ -923,6 +1001,7 @@
\l__exsheets_tmpb_tl
\l__exsheets_tmpc_tl
{ \bool_set_false:N \l__exsheets_solutions_use_bool }
+ % \bool_show:N \l__exsheets_solutions_use_bool
}
}
}
@@ -979,9 +1058,6 @@
% ----------------------------------------------------------------------------
% question tags:
-\prop_new:N \g__exsheets_tags_prop
-\seq_new:N \l__exsheets_use_tags_seq
-
% #1: ID
% #2: tags
\cs_new_protected:Npn \exsheets_set_question_tags:nn #1#2
@@ -1023,26 +1099,6 @@
% ----------------------------------------------------------------------------
% die 'question' Umgebung
-\tl_new:N \l__exsheets_questions_name_tl
-\tl_set:Nn \l__exsheets_questions_name_tl {Question}
-\tl_new:N \l__exsheets_exercise_name_tl
-\tl_set:Nn \l__exsheets_exercise_name_tl {Exercise}
-
-\tl_new:N \l__exsheets_questions_pre_hook_tl
-\tl_new:N \l__exsheets_questions_post_hook_tl
-\tl_new:N \l__exsheets_questions_pre_body_hook_tl
-\tl_new:N \l__exsheets_questions_post_body_hook_tl
-\tl_new:N \l__exsheets_after_begin_question_tl
-
-\tl_new:N \CurrentQuestionID
-
-\bool_new:N \l__exsheets_questions_print_bool
-\bool_set_true:N \l__exsheets_questions_print_bool
-\bool_new:N \l__exsheets_inside_question_bool
-
-\int_new:N \g__exsheets_questions_id_int
-\int_gzero:N \g__exsheets_questions_id_int
-
\cs_new:Npn \IfInsideQuestionTF
{ \bool_if:NTF \l__exsheets_inside_question_bool }
\cs_new:Npn \IfInsideQuestionT
@@ -1131,26 +1187,12 @@
\group_end:
\bool_if:NT \l__exsheets_questions_print_bool
{
- #2
- { #1 }
- #3
+ #2 { #1 } #3
\exsheets_add_space:N \l__exsheets_questions_skip_below_dim
}
}
\cs_generate_variant:Nn \__exsheets_save_and_print_question_body:nnn { VVV }
-\prop_new:N \g__exsheets_questions_id_prop
-\prop_new:N \g__exsheets_questions_subtitle_prop
-\prop_new:N \g__exsheets_questions_used_prop
-\int_new:N \g__exsheets_questions_used_int
-
-\tl_new:N \l__exsheets_questions_id_tl
-\tl_new:N \l__exsheets_questions_subtitle_tl
-\tl_new:N \g__exsheets_questions_current_id_tl
-\tl_new:N \l__exsheets_questions_title_tl
-\tl_new:N \l__exsheets_questions_label_tl
-\tl_new:N \l__exsheets_questions_points_tl
-
\prg_new_conditional:Npnn \exsheets_if_question_subtitle: { p,T,F,TF }
{
\tl_if_blank:VTF \l__exsheets_questions_subtitle_tl
@@ -1162,11 +1204,6 @@
\cs_new:Npn \IfQuestionSubtitleT { \exsheets_if_question_subtitle:T }
\cs_new:Npn \IfQuestionSubtitleF { \exsheets_if_question_subtitle:F }
-\bool_new:N \l__exsheets_only_print_points_bool
-
-\fp_new:N \g__exsheets_this_question_points_fp
-\fp_new:N \g__exsheets_this_question_bonus_fp
-
\cs_new_protected:Npn \__exsheets_read_points:w #1 ! #2 ! #3 \q_stop
{
\tl_if_blank:nTF {#1}
@@ -1370,7 +1407,7 @@
{
\__exsheets_determine_question_usage:
\exsheets_if_current_question_is_used:T
- { \refstepcounter{question} }
+ { \refstepcounter {question} }
\__exsheets_get_sectioning_numbers:
\bool_if:nT
{
@@ -1434,8 +1471,8 @@
\l__exsheets_question_heading_instance_tl
\l__exsheets_questions_title_tl
\l__exsheets_qu_counter_interpretation_tl
- { 0 }
- { 0 }
+ {0}
+ {0}
\l__exsheets_tmpa_tl
}
{
@@ -1445,7 +1482,7 @@
\l__exsheets_questions_title_tl
\l__exsheets_qu_counter_interpretation_tl
\l__exsheets_questions_points_tl
- { 0 }
+ {0}
\l__exsheets_tmpa_tl
}
}
@@ -1467,8 +1504,6 @@
}
% current question number:
-\prop_new:N \g_exsheets_question_identification_prop
-
\cs_new_protected:Npn \exsheets@save@number #1#2
{ \expandafter\global\expandafter\edef\csname exsheets@question@#1\endcsname{#2} }
@@ -1509,6 +1544,9 @@
}
}
+% #1: prop
+% #2: id
+% #3: code
\cs_new_protected:Npn \__exsheets_restore_number_from_and_do:Nnn #1#2#3
{
\prop_get:NnNT #1 {#2} \l__exsheets_tmpc_tl
@@ -1522,14 +1560,14 @@
}
\cs_generate_variant:Nn \__exsheets_restore_number_from_and_do:Nnn { NV }
-\NewDocumentCommand \QuestionNumber { m }
+\NewDocumentCommand \QuestionNumber {m}
{ \exsheets_question_number:n {#1} }
\cs_new_protected:Npn \exsheets_question_number:n #1
{
\prop_get:NnNTF \g__exsheets_questions_id_prop {#1} \l__exsheets_tmpa_tl
{ \__exsheets_question_number:c { exsheets@question@\l__exsheets_tmpa_tl } }
- { \textbf{??} }
+ { \textbf {??} }
}
\cs_new_protected:Npn \__exsheets_question_number:N #1
@@ -1537,9 +1575,9 @@
\cs_if_exist:NTF #1
{
\exp_after:wN \__exsheets_get_question_number:w #1 \q_stop
- \ReadCounterPatternFrom [ exsheets ] \l__exsheets_qu_counter_pattern_tl
+ \ReadCounterPatternFrom [exsheets] \l__exsheets_qu_counter_pattern_tl
}
- { \textbf{??} }
+ { \textbf {??} }
}
\cs_generate_variant:Nn \__exsheets_question_number:N { c }
@@ -1591,11 +1629,6 @@
\NewDocumentCommand \ExSheetsHeading { mmmmmm }
{ \exsheets_use_heading:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} }
-\bool_new:N \l__exsheets_exam_bool
-\bool_set_false:N \l__exsheets_exam_bool
-\bool_new:N \l__exsheets_questions_runin_bool
-\bool_set_false:N \l__exsheets_questions_runin_bool
-
% options for the questions:
\keys_define:nn { exsheets / question }
{
@@ -1705,15 +1738,8 @@
{ \prop_item:cn { g__exsheets_question_property_#1_prop } {#2} }
{ ?? }
}
-\cs_generate_variant:Nn \exsheets_get_question_property:nn { no }
+\cs_generate_variant:Nn \exsheets_get_question_property:nn { no , nV }
-\int_new:N \g__exsheets_tmpa_int
-% \cs_new_protected:Npn \ForEachQuestion #1
-% {
-% \int_gzero:N \g__exsheets_tmpa_int
-% \int_step_inline:nnnn {1} {1} {\numberofquestions}
-% { \int_gincr:N \g__exsheets_tmpa_int #1 }
-% }
\cs_new_protected:Npn \ForEachQuestion #1
{
\int_gzero:N \g__exsheets_tmpa_int
@@ -1735,10 +1761,8 @@
% ----------------------------------------------------------------------------
% debug-Info:
-\bool_new:N \l__exsheets_questions_debug_bool
-\bool_set_false:N \l__exsheets_questions_debug_bool
-
-\colorlet { exsheetsdebugcolor } { yellow }
+\RequirePackage {xcolor}
+\colorlet {exsheetsdebugcolor} {yellow}
\keys_define:nn {exsheets}
{
@@ -1751,7 +1775,7 @@
\noindent
\group_begin:
\normalfont\normalsize\normalcolor
- \colorbox { exsheetsdebugcolor }
+ \colorbox {exsheetsdebugcolor}
{ \parbox { \dim_eval:n { #1 - 2 \fboxsep } } {#2} }
\group_end:
\par
@@ -1797,22 +1821,6 @@
% ----------------------------------------------------------------------------
% include random/selected questions from a file:
-\bool_new:N \l__exsheets_select_questions_bool
-\bool_new:N \l__exsheets_include_all_bool
-\bool_new:N \l__exsheets_include_random_bool
-\bool_new:N \l__exsheets_include_by_id_bool
-\bool_set_true:N \l__exsheets_include_all_bool
-
-\prop_new:N \g__exsheets_included_questions_prop
-\clist_new:N \l__exsheets_include_id_clist
-\clist_new:N \l__exsheets_exclude_id_clist
-\clist_new:N \questionsincludedlast
-
-\seq_new:N \g_exsheets_included_questions_seq
-
-\int_new:N \l__exsheets_include_random_int
-\int_zero:N \l__exsheets_include_random_int
-
\cs_new_protected:Npn \exsheets_file_input_if_exist:n #1
{ \file_if_exist:nT {#1} { \file_input:n {#1} } }
\cs_new_protected:Npn \exsheets_file_input_if_exist:nF #1#2
@@ -1840,9 +1848,6 @@
\group_end:
}
-\int_new:N \l__exsheets_questions_set_int
-\int_new:N \g__exsheets_select_random_int
-
\cs_new_protected:Npn \exsheets_include_questions:n #1
{
\bool_set_true:N \l__exsheets_select_questions_bool
@@ -1915,8 +1920,6 @@
\int_set:Nn \l__exsheets_include_random_int {#1}
}
-\int_new:N \g__exsheets_selection_number_int
-
\cs_new_protected:Npn \__exsheets_select_question:n #1
{
\bool_if:NT \l__exsheets_select_questions_bool
@@ -2016,8 +2019,6 @@
}
\cs_generate_variant:Nn \__exsheets_select_question_by_id:n { V }
-\tl_new:N \l__exsheets_include_id_tl
-\bool_new:N \l__exsheets_use_selection_bool
% TODO: poor efficiency -- there should be no need to map through
% \l__exsheets_class_prop *two* times
\cs_new_protected:Npn \__exsheets_select_question_random:n #1
@@ -2144,26 +2145,6 @@
% ----------------------------------------------------------------------------
% die 'solution' Umgebung:
-\bool_new:N \l__exsheets_solutions_print_bool
-\bool_set_false:N \l__exsheets_solutions_print_bool
-\bool_new:N \l__exsheets_solutions_print_here_bool
-\bool_set_false:N \l__exsheets_solutions_print_here_bool
-\bool_new:N \l__exsheets_solutions_print_section_bool
-\bool_set_false:N \l__exsheets_solutions_print_section_bool
-\bool_new:N \l__exsheets_solutions_print_chapter_bool
-\bool_set_false:N \l__exsheets_solutions_print_chapter_bool
-\bool_new:N \l__exsheets_solutions_print_all_bool
-\bool_set_false:N \l__exsheets_solutions_print_all_bool
-
-% \prop_new:N \g_exsheets_question_identification_prop
-\prop_new:N \g__exsheets_solutions_content_prop
-\prop_new:N \g__exsheets_solutions_questions_id_prop
-\prop_new:N \g__exsheets_solutions_names_prop
-\prop_new:N \g__exsheets_solutions_counter_prop
-
-\tl_new:N \l__exsheets_solutions_name_tl
-\tl_set:Nn \l__exsheets_solutions_name_tl { Solution }
-
\cs_new_protected:Npn \__exsheets_save_solution:n #1
{
% save for later use
@@ -2187,12 +2168,11 @@
{
\bool_if:NT \l__exsheets_solutions_print_here_bool
{
- \int_set:Nn \l_exsheets_counter_qu_int { \arabic{question} }
+ \int_set:Nn \l_exsheets_counter_qu_int { \arabic {question} }
\__exsheets_get_sectioning_numbers:
- \__exsheets_print_solution:VVVn
- \l__exsheets_qu_counter_interpretation_tl
- \l__exsheets_solutions_name_tl
+ \__exsheets_print_solution:VVn
\g__exsheets_questions_current_id_tl
+ \l__exsheets_solutions_name_tl
{#1}
}
}
@@ -2206,39 +2186,35 @@
{ \__exsheets_save_solution:V \BODY }
}
-\bool_new:N \l__exsheets_inside_solution_bool
-\bool_set_false:N \l__exsheets_inside_solution_bool
-
-\tl_new:N \l__exsheets_use_solution_tl
-
-\newenvironment { __exsheets_solution: } [1]
+\newenvironment {__exsheets_solution:} [1]
{
\tl_clear:N \l__exsheets_use_solution_tl
+ % \prop_show:N \l__exsheets_class_prop
\prop_map_inline:Nn \l__exsheets_class_prop
{
- \use:c { __exsheets_solutions_use_##1: }
+ \use:c {__exsheets_solutions_use_##1:}
\bool_if:nTF
{
+ \l__exsheets_solutions_use_bool
+ &&
(
- \l__exsheets_solutions_use_bool
- &&
- \bool_if_p:c { l__exsheets_##2_active_bool }
+ !\bool_if_p:c {g__exsheets_use_##1_bool}
+ ||
+ \bool_if_p:c {l__exsheets_##2_active_bool}
)
- ||
- ! \bool_if_p:c { g__exsheets_use_##1_bool }
}
- { \tl_put_right:Nn \l__exsheets_use_solution_tl { y } }
- { \tl_put_right:Nn \l__exsheets_use_solution_tl { n } }
+ { \tl_put_right:Nn \l__exsheets_use_solution_tl {y} }
+ { \tl_put_right:Nn \l__exsheets_use_solution_tl {n} }
}
% verwende, wenn ein Ja dabei war:
- \tl_if_in:NnT \l__exsheets_use_solution_tl { y }
+ \tl_if_in:NnT \l__exsheets_use_solution_tl {y}
{ \bool_set_true:N \l__exsheets_solutions_use_bool }
\bool_if:NT \l__exsheets_questions_deactivate_bool
{ \bool_set_false:N \l__exsheets_solutions_use_bool }
\bool_if:NT \l__exsheets_solutions_use_bool
{
\bool_set_true:N \l__exsheets_inside_solution_bool
- \IfNoValueF {#1} { \keys_set:nn { exsheets / solution } {#1} }
+ \IfNoValueF {#1} { \keys_set:nn {exsheets/solution} {#1} }
}
\tl_if_blank:VT \l__exsheets_solution_heading_instance_tl
{
@@ -2250,9 +2226,6 @@
}
{ \end__exsheets_solution_internal: }
-\bool_new:N \l__exsheets_solutions_runin_bool
-\bool_set_false:N \l__exsheets_solutions_runin_bool
-
\cs_new_protected:Npn \__exsheets_solutions_name:nnn #1#2#3
{
\tl_if_blank:VT \l__exsheets_solution_heading_instance_tl
@@ -2267,9 +2240,6 @@
}
\cs_generate_variant:Nn \__exsheets_solutions_name:nnn { VV , VVV }
-\tl_new:N \l_exsheets_solutions_name_style_tl
-\tl_set:Nn \l_exsheets_solutions_name_style_tl { \normalsize \bfseries }
-
\cs_new:Npn \exsheets_solutions_name_style:n #1
{ \l_exsheets_solutions_name_style_tl #1 }
@@ -2282,14 +2252,14 @@
\exsheets_write_to_aux_x:n
{
\token_to_str:N \newlabel { exse:#1 }
- { { \arabic { section } } { \thepage } }
+ { { \arabic {section} } { \thepage } }
}
\cs_if_exist:NT \thechapter
{
\exsheets_write_to_aux_x:n
{
\token_to_str:N \newlabel { exch:#1 }
- { { \arabic { chapter } } { \thepage } }
+ { { \arabic {chapter} } { \thepage } }
}
}
\@esphack
@@ -2339,12 +2309,6 @@
\group_end:
}
-\int_new:N \l__exsheets_counter_ch_int
-\int_new:N \l__exsheets_current_ch_int
-\int_new:N \l__exsheets_counter_sec_int
-\int_new:N \l__exsheets_current_sec_int
-\int_new:N \l_exsheets_counter_qu_int
-
\keys_define:nn {exsheets}
{
exsheets_print_solutions .choice: ,
@@ -2361,9 +2325,9 @@
\cs_new_protected:Npn \__exsheets_get_sectioning_numbers:
{
\cs_if_exist:NT \chapter
- { \int_set:Nn \l__exsheets_counter_ch_int { \arabic{chapter} } }
- \int_set:Nn \l__exsheets_counter_sec_int { \arabic{section} }
- \int_set:Nn \l_exsheets_counter_qu_int { \arabic{question} }
+ { \int_set:Nn \l__exsheets_counter_ch_int { \arabic {chapter} } }
+ \int_set:Nn \l__exsheets_counter_sec_int { \arabic {section} }
+ \int_set:Nn \l_exsheets_counter_qu_int { \arabic {question} }
}
% #1: numeric ID
@@ -2388,23 +2352,9 @@
\__exsheets_sectioning_hook:nV {sec}
\l__exsheets_new_section_hook_tl
\group_end:
- \bool_if:NTF \l__exsheets_use_saved_pattern_bool
- {
- \eSaveCounterPatternFrom [ exsheets ]
- \l__exsheets_current_pattern_interpretation_tl
- \l__exsheets_current_pattern_tl
- \l__exsheets_tmpd_tl
- }
- {
- \eSaveCounterPatternFrom [ exsheets ]
- \l__exsheets_current_pattern_interpretation_tl
- \l__exsheets_current_pattern_tl
- \l__exsheets_qu_counter_pattern_tl
- }
- \__exsheets_print_solution:VVVV
- \l__exsheets_current_pattern_tl
- \l__exsheets_tmpa_tl
+ \__exsheets_print_solution:VVV
\l__exsheets_tmpc_tl
+ \l__exsheets_tmpa_tl
\l__exsheets_tmpb_tl
}
}
@@ -2558,6 +2508,7 @@
\__exsheets_print_solution_if:nn {#2} {#1}
}
}
+\cs_generate_variant:Nn \exsheets_print_solutions_if:nnn {nnV}
% print by ID:
\seq_new:N \l__exsheets_solutions_byID_seq
@@ -2582,44 +2533,14 @@
}
\seq_map_inline:Nn \l__exsheets_tmpa_seq
{
- \group_begin:
- \tl_if_eq:nnF {##1} { \q_no_value }
- {
- \prop_get:NnNT \g__exsheets_solutions_names_prop
- {##1} \l__exsheets_tmpa_tl
- {
- \prop_get:NnN \g__exsheets_solutions_content_prop
- {##1} \l__exsheets_tmpb_tl
- \prop_get:NnN \g__exsheets_solutions_questions_id_prop
- {##1} \l__exsheets_tmpc_tl
- \prop_get:NnN \g__exsheets_solutions_counter_prop
- {##1} \l__exsheets_tmpd_tl
- \__exsheets_restore_number_from_and_do:Nnn
- \g_exsheets_question_identification_prop
- {##1}
- {
- \bool_if:NTF \l__exsheets_use_saved_pattern_bool
- {
- \eSaveCounterPatternFrom [ exsheets ]
- \l__exsheets_current_pattern_interpretation_tl
- \l__exsheets_current_pattern_tl
- \l__exsheets_tmpd_tl
- }
- {
- \eSaveCounterPatternFrom [ exsheets ]
- \l__exsheets_current_pattern_interpretation_tl
- \l__exsheets_current_pattern_tl
- \l__exsheets_qu_counter_pattern_tl
- }
- \__exsheets_print_solution:VVVV
- \l__exsheets_current_pattern_tl
- \l__exsheets_tmpa_tl
- \l__exsheets_tmpc_tl
- \l__exsheets_tmpb_tl
- }
- }
- }
- \group_end:
+ \prop_get:NnNT \g_exsheets_question_identification_prop {##1}
+ \l__exsheets_tmpa_tl
+ {
+ \exsheets_print_solutions_if:nnV
+ { \c_true_bool }
+ {##1}
+ \l__exsheets_tmpa_tl
+ }
}
}
@@ -2643,10 +2564,10 @@
{ \char_set_catcode_letter:N \@ } {#1}
\tl_if_in:nnTF {#1} { @@@ }
{ \__exsheets_solutions_name:nnn { } {#2} {#3} }
- { \__exsheets_solutions_name:nnn {#1} { #2 } {#3} }
+ { \__exsheets_solutions_name:nnn {#1} {#2} {#3} }
\tex_penalty:D \c_ten_thousand
}
-\cs_generate_variant:Nn \exsheets_solutions_print_name:nnn { VVV }
+\cs_generate_variant:Nn \exsheets_solutions_print_name:nnn { V , VVV }
\cs_new:Npn \__exsheets_surround_with:nnn #1#2#3 { #2#1#3 }
\cs_generate_variant:Nn \__exsheets_surround_with:nnn { nVV }
@@ -2654,22 +2575,23 @@
% think about the interface with \exsheetsprintsolution a bit more, especially
% about the placement of the hooks!
-% #1: number
+% #1: ID
% #2: name
-% #3: ID
-% #4: body
-\cs_new_protected:Npn \__exsheets_print_solution:nnnn #1#2#3#4
+% #3: body
+\cs_new_protected:Npn \__exsheets_print_solution:nnn #1#2#3
{
\group_begin:
- \tl_set:Nn \CurrentQuestionID {#3}
+ \tl_set:Nn \CurrentQuestionID {#1}
+ \tl_set:Nx \l__exsheets_tmpa_tl
+ { \exsheets_get_question_property:nn {counter} {#1} }
\__exsheets_surround_with:nVV
{
\exp_args:Nnx
\exsheetsprintsolution
- { \exsheets_solutions_print_name:nnn {#1} {#2} {#3} }
+ { \exsheets_solutions_print_name:Vnn \l__exsheets_tmpa_tl {#2} {#1} }
{
\exp_not:V \l__exsheets_solutions_pre_body_hook_tl
- \exp_not:n {#4}
+ \exp_not:n {#3}
\exp_not:V \l__exsheets_solutions_post_body_hook_tl
}
}
@@ -2678,7 +2600,7 @@
\exsheets_add_space:N \l__exsheets_solutions_skip_below_dim
\group_end:
}
-\cs_generate_variant:Nn \__exsheets_print_solution:nnnn { VVV, VVVV }
+\cs_generate_variant:Nn \__exsheets_print_solution:nnn { VV , VVV }
% a user command to be redefined as needed; must have two mandatory arguments!
% #1: heading
@@ -2692,14 +2614,6 @@
\cs_new:Npn \PrintSolutionsF
{ \bool_if:NF \l__exsheets_solutions_print_bool }
-\bool_new:N \l__exsheets_print_byID_sorted_bool
-\bool_set_true:N \l__exsheets_print_byID_sorted_bool
-
-\tl_new:N \l__exsheets_solutions_pre_body_hook_tl
-\tl_new:N \l__exsheets_solutions_post_body_hook_tl
-\tl_new:N \l__exsheets_solutions_pre_hook_tl
-\tl_new:N \l__exsheets_solutions_post_hook_tl
-
\keys_define:nn { exsheets / solution }
{
headings .tl_set:N = \l__exsheets_solution_heading_instance_tl ,
@@ -2767,15 +2681,6 @@
% the \blank{<words>} command
\RequirePackage {ulem} \normalem
-\dim_new:N \l__exsheets_blank_dim
-\tl_new:N \l__exsheets_blank_linespread_tl
-\tl_set:Nn \l__exsheets_blank_linespread_tl { 1 }
-\tl_new:N \l__exsheets_blank_scale_tl
-\tl_set:Nn \l__exsheets_blank_scale_tl { 1 }
-\box_new:N \l__exsheets_blank_box
-\bool_new:N \l__exsheets_blank_width_bool
-\bool_new:N \l__exsheets_blank_linespread_bool
-
\cs_new:Npn \exsheets_write_blank:n #1 {#1}
\cs_set_eq:NN \exsheets_write_blank:n \uline
@@ -2936,83 +2841,83 @@
% ----------------------------------------------------------------------------
% default definitions:
% question / solution pair:
-\NewQuSolPair{question}{solution}
+\NewQuSolPair {question} {solution}
% properties:
% \DeclareQuestionProperty{number}
-\DeclareQuestionProperty{counter}
-\DeclareQuestionProperty{subtitle}
-\DeclareQuestionProperty{question-body}
-\DeclareQuestionProperty{points}
-\DeclareQuestionProperty{bonus-points}
+\DeclareQuestionProperty {counter}
+\DeclareQuestionProperty {subtitle}
+\DeclareQuestionProperty {question-body}
+\DeclareQuestionProperty {points}
+\DeclareQuestionProperty {bonus-points}
\bool_if:NT \l__exsheets_auto_label_bool
{
- \DeclareQuestionProperty{ref}
- \DeclareQuestionProperty{pageref}
+ \DeclareQuestionProperty {ref}
+ \DeclareQuestionProperty {pageref}
}
% classes:
-\DeclareQuestionClass{class}{classes}
-\DeclareQuestionClass{topic}{topics}
+\DeclareQuestionClass {class} {classes}
+\DeclareQuestionClass {topic} {topics}
% ----------------------------------------------------------------------------
% Sprachanpassungen
-\RequirePackage { translations }
+\RequirePackage {translations}
% translation for the exercises
-\DeclareTranslationFallback { exsheets-exercise-name } { Exercise }
-\DeclareTranslation { English } { exsheets-exercise-name } { Exercise }
-\DeclareTranslation { British } { exsheets-exercise-name } { Exercise }
-\DeclareTranslation { American } { exsheets-exercise-name } { Exercise }
-\DeclareTranslation { French } { exsheets-exercise-name } { Exercice }
-\DeclareTranslation { German } { exsheets-exercise-name } { \"Ubung }
-\DeclareTranslation { Italian } { exsheets-exercise-name } { Esercizio }
-\DeclareTranslation { Spanish } { exsheets-exercise-name } { Ejercicio }
-\DeclareTranslation { Catalan } { exsheets-exercise-name } { Exercici }
-\DeclareTranslation { Turkish } { exsheets-exercise-name } { Egzersiz }
-\DeclareTranslation { Croatian } { exsheets-exercise-name } { Primjer }
-\DeclareTranslation { Hungarian } { exsheets-exercise-name } { Gyakorol }
-\DeclareTranslation { Danish } { exsheets-exercise-name } { Opgave }
-\DeclareTranslation { Norsk } { exsheets-exercise-name } { Oppgave }
-\DeclareTranslation { Portuges } { exsheets-exercise-name } { Exerc\'\i cio }
+\DeclareTranslationFallback {exsheets-exercise-name} {Exercise}
+\DeclareTranslation {English} {exsheets-exercise-name} {Exercise}
+\DeclareTranslation {British} {exsheets-exercise-name} {Exercise}
+\DeclareTranslation {American} {exsheets-exercise-name} {Exercise}
+\DeclareTranslation {French} {exsheets-exercise-name} {Exercice}
+\DeclareTranslation {German} {exsheets-exercise-name} {\"Ubung}
+\DeclareTranslation {Italian} {exsheets-exercise-name} {Esercizio}
+\DeclareTranslation {Spanish} {exsheets-exercise-name} {Ejercicio}
+\DeclareTranslation {Catalan} {exsheets-exercise-name} {Exercici}
+\DeclareTranslation {Turkish} {exsheets-exercise-name} {Egzersiz}
+\DeclareTranslation {Croatian} {exsheets-exercise-name} {Primjer}
+\DeclareTranslation {Hungarian} {exsheets-exercise-name} {Gyakorol}
+\DeclareTranslation {Danish} {exsheets-exercise-name} {Opgave}
+\DeclareTranslation {Norsk} {exsheets-exercise-name} {Oppgave}
+\DeclareTranslation {Portuges} {exsheets-exercise-name} {Exerc\'\i cio}
% translation for the question
-\DeclareTranslationFallback { exsheets-question-name } { Question }
-\DeclareTranslation { English } { exsheets-question-name } { Question }
-\DeclareTranslation { British } { exsheets-question-name } { Question }
-\DeclareTranslation { American } { exsheets-question-name } { Question }
-\DeclareTranslation { French } { exsheets-question-name } { Question }
-\DeclareTranslation { German } { exsheets-question-name } { Aufgabe }
-\DeclareTranslation { Italian } { exsheets-question-name } { Questione }
-\DeclareTranslation { Spanish } { exsheets-question-name } { Pregunta }
-\DeclareTranslation { Catalan } { exsheets-question-name } { Q\"uesti\'o }
-\DeclareTranslation { Turkish } { exsheets-question-name } { Soru }
-\DeclareTranslation { Croatian } { exsheets-question-name } { Zadatak }
-\DeclareTranslation { Hungarian } { exsheets-question-name } { Feladat }
-\DeclareTranslation { Danish } { exsheets-question-name } { Opgave }
-\DeclareTranslation { Norsk } { exsheets-question-name } { Oppgave }
-\DeclareTranslation { Portuges } { exsheets-question-name } { Quest\~ao }
+\DeclareTranslationFallback {exsheets-question-name} {Question}
+\DeclareTranslation {English} {exsheets-question-name} {Question}
+\DeclareTranslation {British} {exsheets-question-name} {Question}
+\DeclareTranslation {American} {exsheets-question-name} {Question}
+\DeclareTranslation {French} {exsheets-question-name} {Question}
+\DeclareTranslation {German} {exsheets-question-name} {Aufgabe}
+\DeclareTranslation {Italian} {exsheets-question-name} {Questione}
+\DeclareTranslation {Spanish} {exsheets-question-name} {Pregunta}
+\DeclareTranslation {Catalan} {exsheets-question-name} {Q\"uesti\'o}
+\DeclareTranslation {Turkish} {exsheets-question-name} {Soru}
+\DeclareTranslation {Croatian} {exsheets-question-name} {Zadatak}
+\DeclareTranslation {Hungarian} {exsheets-question-name} {Feladat}
+\DeclareTranslation {Danish} {exsheets-question-name} {Opgave}
+\DeclareTranslation {Norsk} {exsheets-question-name} {Oppgave}
+\DeclareTranslation {Portuges} {exsheets-question-name} {Quest\~ao}
% translation for the solutions
-\DeclareTranslationFallback { exsheets-solution-name } { Solution }
-\DeclareTranslation { English } { exsheets-solution-name } { Solution }
-\DeclareTranslation { British } { exsheets-solution-name } { Solution }
-\DeclareTranslation { American } { exsheets-solution-name } { Solution }
-\DeclareTranslation { French } { exsheets-solution-name } { Solution }
-\DeclareTranslation { German } { exsheets-solution-name } { L\"osung }
-\DeclareTranslation { Italian } { exsheets-solution-name } { Soluzione }
-\DeclareTranslation { Spanish } { exsheets-solution-name } { Soluci\'on }
-\DeclareTranslation { Catalan } { exsheets-solution-name } { Soluci\'o }
-\DeclareTranslation { Turkish } { exsheets-solution-name } { \c C\"oz\"um }
-\DeclareTranslation { Croatian } { exsheets-solution-name } { Rje\v{s}enje }
-\DeclareTranslation { Hungarian } { exsheets-solution-name } { Megold\'{a}s }
-\DeclareTranslation { Danish } { exsheets-solution-name } { L\o sning }
-\DeclareTranslation { Norsk } { exsheets-solution-name } { L\o sning }
-\DeclareTranslation { Portuges } { exsheets-solution-name } { Solu\c c\~ao }
+\DeclareTranslationFallback {exsheets-solution-name} {Solution}
+\DeclareTranslation {English} {exsheets-solution-name} {Solution}
+\DeclareTranslation {British} {exsheets-solution-name} {Solution}
+\DeclareTranslation {American} {exsheets-solution-name} {Solution}
+\DeclareTranslation {French} {exsheets-solution-name} {Solution}
+\DeclareTranslation {German} {exsheets-solution-name} {L\"osung}
+\DeclareTranslation {Italian} {exsheets-solution-name} {Soluzione}
+\DeclareTranslation {Spanish} {exsheets-solution-name} {Soluci\'on}
+\DeclareTranslation {Catalan} {exsheets-solution-name} {Soluci\'o}
+\DeclareTranslation {Turkish} {exsheets-solution-name} {\c C\"oz\"um}
+\DeclareTranslation {Croatian} {exsheets-solution-name} {Rje\v{s}enje}
+\DeclareTranslation {Hungarian} {exsheets-solution-name} {Megold\'{a}s}
+\DeclareTranslation {Danish} {exsheets-solution-name} {L\o sning}
+\DeclareTranslation {Norsk} {exsheets-solution-name} {L\o sning}
+\DeclareTranslation {Portuges} {exsheets-solution-name} {Solu\c c\~ao}
% the actual translating
\tl_set:Nn \l__exsheets_exercise_name_tl
- { \GetTranslation { exsheets-exercise-name } }
+ { \GetTranslation {exsheets-exercise-name} }
\tl_set:Nn \l__exsheets_questions_name_tl
- { \GetTranslation { exsheets-question-name } }
+ { \GetTranslation {exsheets-question-name} }
\tl_set:Nn \l__exsheets_solutions_name_tl
- { \GetTranslation { exsheets-solution-name } }
+ { \GetTranslation {exsheets-solution-name} }
% ----------------------------------------------------------------------------
@@ -3285,9 +3190,20 @@ HISTORY:
not printed
2016/01/26 v0.21a - remove deprecated \prop_get:Nn (=> \prop_item:Nn)
2016/02/01 v0.21b - fix annoying bug in \exsheets_print_solutions_if:nnn
+2016/03/21 v0.21c - use question property `counter' for retrieving the
+ counter patterns in solution's headings (this
+ resolves http://tex.stackexchange.com/q/299898)
+ - remove option `use-saved-counter-format': solutions
+ should always have the same number pattern as the
+ corresponding questions
+2016/08/14 v0.21d - fix issue #32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO:
+- solve the problem using verbatim material in questions and solutions
+ (difficult)
+- allow for different kinds of problems/solutions using an independant counter
+ (not trivial)
- points/decimal-marker, points/frac (?), points/format (?,im interface)
- points: swedish style
- \examspace inside {tasks} => possible? (\pagegoal-\pagetotal) gives wrong
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg
index 0b6c7f267e6..3f899b23033 100644
--- a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg
+++ b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg
@@ -326,8 +326,8 @@
vscale = 2 ,
pre-code = \rule{\linewidth}{1pt} ,
post-code = \rule{\linewidth}{1pt} ,
- title-format = \large\scshape\color{exsheetsred} ,
- number-format = \large\bfseries\color{exsheetsblue} ,
+ title-format = \large\scshape\color{rgb:red,0.65;green,0.04;blue,0.07} ,
+ number-format = \large\bfseries\color{rgb:red,0.02;green,0.04;blue,0.48} ,
points-format = \itshape ,
join = { number[r,B] title[l,B] (.333em,0pt) } ,
attach =
@@ -345,8 +345,8 @@
vscale = 2 ,
pre-code = \rule{\linewidth}{1pt} ,
post-code = \rule{\linewidth}{1pt} ,
- title-format = \large\scshape\color{exsheetsred} ,
- number-format = \large\bfseries\color{exsheetsblue} ,
+ title-format = \large\scshape\color{rgb:red,0.65;green,0.04;blue,0.07} ,
+ number-format = \large\bfseries\color{rgb:red,0.02;green,0.04;blue,0.48} ,
points-format = \itshape ,
points-pre-code = ( ,
points-post-code = ) ,
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def
index 788412cb0a4..b4a436a9520 100644
--- a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def
+++ b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def
@@ -223,7 +223,7 @@
number-format = \l__exsheets_heading_number_format_tl ,
number-pre-code = \l__exsheets_heading_number_pre_code_tl ,
number-post-code = \l__exsheets_heading_number_post_code_tl ,
- subtitle-format = \l__exsheets_heading_title_format_tl ,
+ subtitle-format = \l__exsheets_heading_subtitle_format_tl ,
subtitle-pre-code = \l__exsheets_heading_subtitle_pre_code_tl ,
subtitle-post-code = \l__exsheets_heading_subtitle_post_code_tl ,
points-format = \l__exsheets_heading_points_format_tl ,