Skip to content

Commit

Permalink
v0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
cgnieder committed Feb 21, 2020
1 parent ea091e5 commit d6a1df9
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 71 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
XSIM 2020/01/16 v0.16a
XSIM 2020/01/21 v0.17
XSIMVERB 2019/12/29 v0.1a

eXercise Sheets IMproved
Expand Down
41 changes: 21 additions & 20 deletions code/xsim.exercises.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -394,28 +394,29 @@
\int_gincr:N \g_xsim_id_int
\int_compare:nF { \g_xsim_max_id_int > \g_xsim_id_int }
{ \int_gset_eq:NN \g_xsim_max_id_int \g_xsim_id_int }
\tl_gset:Nx \g_xsim_exercise_id_tl { \int_use:N \g_xsim_id_int }
% save the goal values from the auxiliary files:
\xsim_foreach_goal:n
{
\xsim_temporary_goal_new:nen {#1} { \int_use:N \g_xsim_id_int } {##1}
\xsim_if_property_set:nxnT {#1} { \int_use:N \g_xsim_id_int } {##1}
\xsim_temporary_goal_new:nVn {#1} \g_xsim_exercise_id_tl {##1}
\xsim_if_property_set:nVnT {#1} \g_xsim_exercise_id_tl {##1}
{
\xsim_temporary_goal_set:nenn
\xsim_temporary_goal_set:nVnn
{#1}
{ \int_use:N \g_xsim_id_int }
\g_xsim_exercise_id_tl
{##1}
{ \xsim_get_property:nen {exercise} { \int_use:N \g_xsim_id_int } {##1} }
{ \xsim_get_property:nVn {#1} \g_xsim_exercise_id_tl {##1} }
}
}
\xsim_set_properties:nxx {#1} { \int_use:N \g_xsim_id_int }
\xsim_set_properties:nVx {#1} \g_xsim_exercise_id_tl
{
% preset options so the user doesn't has to:
print = true ,
use = true ,
% options set by the user:
\exp_not:n {#2} ,
% options which need to have certain values:
id = \int_use:N \g_xsim_id_int ,
id = \g_xsim_exercise_id_tl ,
section-value = \arabic{section} ,
section = \thesection ,
page-value = \arabic{page} ,
Expand All @@ -434,41 +435,41 @@
\xsim_foreach_goal:n
{
\fp_set:Nn \l__xsim_tmpa_fp
{ \xsim_temporary_goal_get:nen {#1} { \int_use:N \g_xsim_id_int } {##1} }
{ \xsim_temporary_goal_get:nVn {#1} \g_xsim_exercise_id_tl {##1} }
% set temporary goal to given property:
\xsim_if_property_given:nTF {##1}
{
\xsim_temporary_goal_set:nenn
\xsim_temporary_goal_set:nVnn
{#1}
{ \int_use:N \g_xsim_id_int }
\g_xsim_exercise_id_tl
{##1}
{ \xsim_get_property:nen {exercise} { \int_use:N \g_xsim_id_int } {##1} }
{ \xsim_get_property:nVn {#1} \g_xsim_exercise_id_tl {##1} }
}
{
\xsim_temporary_goal_set:nenn
\xsim_temporary_goal_set:nVnn
{#1}
{ \int_use:N \g_xsim_id_int }
\g_xsim_exercise_id_tl
{##1}
{0}
}
% update to property to complete value:
\xsim_if_property_set:nxnT {#1} { \int_use:N \g_xsim_id_int } {##1}
\xsim_if_property_set:nVnT {#1} \g_xsim_exercise_id_tl {##1}
{
\xsim_set_property:nxnx {#1} { \int_use:N \g_xsim_id_int } {##1}
\xsim_set_property:nVnx {#1} \g_xsim_exercise_id_tl {##1}
{ \fp_to_decimal:N \l__xsim_tmpa_fp }
}
}
\xsim_if_property_exist:nT {chapter}
{
\xsim_set_properties:nxx {#1} { \int_use:N \g_xsim_id_int }
\xsim_set_properties:nVx {#1} \g_xsim_exercise_id_tl
{
chapter-value = \arabic{chapter} ,
chapter = \thechapter
}
}
\tl_gclear:N \g_xsim_exercise_id_tl
\xsim_gsave_property:nxnN {#1} { \int_use:N \g_xsim_id_int } {id}
\g_xsim_exercise_id_tl
% \tl_gclear:N \g_xsim_exercise_id_tl
% \xsim_gsave_property:nVnN {#1} \l__xsim_tmpa_tl {id}
% \g_xsim_exercise_id_tl
\tl_gset_eq:NN \ExerciseID \g_xsim_exercise_id_tl
\tl_gset:Nn \ExerciseType {#1}
\xsim_verbose:x
Expand Down Expand Up @@ -613,4 +614,4 @@
% ----------------------------------------------------------------------------
\file_input_stop:

2020/02/20 - implement issue #2
2020/02/21 - implement issue #2
10 changes: 5 additions & 5 deletions code/xsim.goals.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
\cs_new_protected:Npn \xsim_synchronize_goals:nn #1#2
{
\xsim_foreach_goal:n
{ % \__xsim_temporary_goal_show:nnn {#1} {#2} {##1}
{
\xsim_if_property_set:nnnTF {#1} {#2} {##1}
{
\xsim_set_property:nnnx {#1} {#2} {##1}
Expand Down Expand Up @@ -171,30 +171,30 @@
% #3: goal
\cs_new_protected:Npn \xsim_temporary_goal_new:nnn #1#2#3
{ \fp_new:c {g__xsim_goal_#3_#1_#2_fp} }
\cs_generate_variant:Nn \xsim_temporary_goal_new:nnn {ne}
\cs_generate_variant:Nn \xsim_temporary_goal_new:nnn {nV}

% #1: type
% #2: id
% #3: goal
% #4: value
\cs_new_protected:Npn \xsim_temporary_goal_set:nnnn #1#2#3#4
{ \fp_gset:cn {g__xsim_goal_#3_#1_#2_fp} {#4} }
\cs_generate_variant:Nn \xsim_temporary_goal_set:nnnn {ne}
\cs_generate_variant:Nn \xsim_temporary_goal_set:nnnn {nV}

% #1: type
% #2: id
% #3: goal
% #4: value
\cs_new_protected:Npn \xsim_temporary_goal_add:nnnn #1#2#3#4
{ \fp_gadd:cn {g__xsim_goal_#3_#1_#2_fp} {#4} }
\cs_generate_variant:Nn \xsim_temporary_goal_add:nnnn {ne}
\cs_generate_variant:Nn \xsim_temporary_goal_add:nnnn {nV}

% #1: type
% #2: id
% #3: goal
\cs_new:Npn \xsim_temporary_goal_get:nnn #1#2#3
{ \fp_to_decimal:c {g__xsim_goal_#3_#1_#2_fp} }
\cs_generate_variant:Nn \xsim_temporary_goal_get:nnn {ne}
\cs_generate_variant:Nn \xsim_temporary_goal_get:nnn {nV}

% #1: type
% #2: id
Expand Down
10 changes: 9 additions & 1 deletion code/xsim.properties.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@
}
\cs_generate_variant:Nn \xsim_set_property:nnnn {nnxx,nnnV,nV,nVnx,nnnx,xx,xxnx,nxnx}

% #1: type
% #2: id
% #3: property
% #4: value
\cs_new_protected:Npn \__xsim_set_boolean_property:nnnn #1#2#3#4
{
\str_case_e:nnTF { \str_lowercase:n {#4} }
Expand All @@ -201,6 +205,10 @@
{ \__xsim_set_property:nnnn {#1} {#2} {#3} {false} }
}

% #1: type
% #2: id
% #3: property
% #4: value
\cs_new_protected:Npn \__xsim_set_unique_property:nnnn #1#2#3#4
{
\__xsim_set_property:nnnn {#1} {#2} {#3} {#4}
Expand Down Expand Up @@ -502,7 +510,7 @@
\xsim_save_property:nnnN {#1} {#2} {#3} #4
\tl_gset:NV #4 #4
}
\cs_generate_variant:Nn \xsim_gsave_property:nnnN {nx,xx}
\cs_generate_variant:Nn \xsim_gsave_property:nnnN {nx,xx,nV}

% ----------------------------------------------------------------------------
\file_input_stop:
22 changes: 20 additions & 2 deletions code/xsim.sty
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

\ExplSyntaxOn

\tl_const:Nn \c_xsim_date_tl {2020/02/15}
\tl_const:Nn \c_xsim_date_tl {2020/02/21}
\tl_const:Nn \c_xsim_version_major_number_tl {0}
\tl_const:Nn \c_xsim_version_minor_number_tl {16b}
\tl_const:Nn \c_xsim_version_minor_number_tl {17}
\tl_const:Nn \c_xsim_version_subrelease_tl {}
\tl_const:Nx \c_xsim_version_number_tl
{
Expand Down Expand Up @@ -78,9 +78,26 @@

\ProcessKeysPackageOptions {xsim/package}

\keys_define:nn {xsim/package}
{
final .code:n = \msg_error:nnn {xsim} {load-time-option} {final} ,
verbose .code:n = \msg_error:nnn {xsim} {load-time-option} {verbose} ,
clear-aux .code:n = \msg_error:nnn {xsim} {load-time-option} {clear-aux} ,
no-files .code:n = \msg_error:nnn {xsim} {load-time-option} {no-files} ,
use-aux .code:n = \msg_error:nnn {xsim} {load-time-option} {use-aux} ,
blank .code:n = \msg_error:nnn {xsim} {load-time-option} {blank}
}

% --------------------------------------------------------------------------

% messages:
\msg_new:nnn {xsim} {load-time-option}
{
`#1'~ is~ a~ load-time~ option! \\
You~ cannot~ set~ it~ with~ \token_to_str:N \xsimsetup ! \\
You~ need~ to~ use~ \token_to_str:N \usepackage [#1] {xsim} .
}

\msg_new:nnn {xsim} {rerun}
{
Exercise~ properties~ may~ have~ changed.~ Rerun~ to~ get~ them~
Expand Down Expand Up @@ -113,3 +130,4 @@
\file_input_stop:

2020/02/20 - implement issue #31 (blank package option)
2020/02/21 - don't allow package options to be set with \xsimsetup
15 changes: 15 additions & 0 deletions doc/xsim-manual.cls
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@
\XSIMfilewritestart*{\jobname.tmp}%
}%
\endgroup

\def\xsimman@read@options@[#1]{\pgfqkeys{/cnltx}{#1}}

\RenewDocumentEnvironment{sourcecode}{}
Expand Down Expand Up @@ -565,6 +566,7 @@
}
{%
\XSIMfilewritestop
\catcode`\^^M=5
\ifbool{cnltx@sidebyside}
{%
\cnltxcode
Expand Down Expand Up @@ -865,6 +867,16 @@
% ----------------------------------------------------------------------------
% versions:

\xsim@add@version{0.0} {2017-02-09}
\xsim@add@version{0.1} {2017-03-19}
\xsim@add@version{0.2} {2017-03-21}
\xsim@add@version{0.4} {2017-03-24}
\xsim@add@version{0.5} {2017-03-30}
\xsim@add@version{0.5a} {2017-04-15}
\xsim@add@version{0.5b} {2017-04-16}
\xsim@add@version{0.6} {2017-04-27}
\xsim@add@version{0.6a} {2017-04-28}
\xsim@add@version{0.7} {2017-05-09}
\xsim@add@version{0.8} {2017-05-18}
\xsim@add@version{0.8a} {2017-05-19}
\xsim@add@version{0.8b} {2017-05-23}
Expand All @@ -875,8 +887,11 @@
\xsim@add@version{0.12} {2019-09-26}
\xsim@add@version{0.13} {2019-10-06}
\xsim@add@version{0.14} {2019-10-13}
\xsim@add@version{0.14a} {2019-10-19}
\xsim@add@version{0.15} {2019-11-02}
\xsim@add@version{0.16} {2019-11-10}
\xsim@add@version{0.16a} {2020-01-16}
\xsim@add@version{0.17} {2020-02-21}

% ----------------------------------------------------------------------------
\newrobustcmd*\xsimauxfileinfo{%
Expand Down
14 changes: 8 additions & 6 deletions doc/xsim.history
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ HISTORY:
- \ProvideExerciseTagging
v0.12 2019/09/30 - add parameter versions for the plural forms of exercise
and solution names
- bug fixes (issues 37, 39, 43, 47)
- bug fixes (issues 37, 39, 43, 47)
v0.13 2019/10/06 - experimental package option `no-files'
v0.14 2019/10/13 - new exercise parameters `exercise-heading' and
`solution-heading'
Expand All @@ -133,12 +133,14 @@ HISTORY:
`use-aux'
v0.16 2019/11/10 - fix issue due to usage of own auxiliary file
- \XSIMatbegindocument and \XSIMatenddocument
- \xprintexercise, \xprintsolution, \xsimprint, \xsimxprint
- \xprintexercise, \xprintsolution, \xsimprint, \xsimxprint
2019/12/29 - bugfix in `xsimverb'
v0.16a 2020/01/16 - adapt to renaming of string case changing functions
v0.17 2020/02/?? - prefer lazy boolean evaluation if possible
v0.17 2020/02/21 - prefer lazy boolean evaluation if possible
- remove spurious \par at the beginning of typeset
exercises
- add `blank' option, implements issue #31
- add `solution' property, implements issue #33
- fix issue #27
- add `blank' option, implements issue #31
- add `solution' property, implements issue #33
- fix issue #27
- implement issue #2
- don't allow package options to be set with \xsimsetup
Binary file modified doc/xsim_manual.pdf
Binary file not shown.
Loading

0 comments on commit d6a1df9

Please sign in to comment.