summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-09-20 22:36:23 +0000
committerKarl Berry <karl@freefriends.org>2017-09-20 22:36:23 +0000
commitbaaddc3c242540fcc6eef178a4576c34df84c339 (patch)
tree3dd7e8072b95be228ebfff3acb9f40f0e7823b88 /Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
parent6fdb207f55c75b496f116c760eab2e1640de2b88 (diff)
xsim (20sep17)
git-svn-id: svn://tug.org/texlive/trunk@45355 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex65
1 files changed, 64 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
index b1006f49356..2c9f0c56449 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
@@ -53,6 +53,15 @@
% ----------------------------------------------------------------------------
+\ProvideDocumentCommand \IfExistSolutionTF {+m+m}
+ { \xsim_if_solution_exists:ooTF {\ExerciseType} {\ExerciseID} {#1} {#2} }
+
+\NewDocumentCommand \IfExistSolutionT {+m}
+ { \IfExistSolutionTF {#1} {} }
+
+\NewDocumentCommand \IfExistSolutionF {+m}
+ { \IfExistSolutionTF {} {#1} }
+
\NewExpandableDocumentCommand \IfInsideSolutionTF {+m+m}
{ \xsim_if_inside_solution:TF {#1} {#2} }
@@ -138,8 +147,17 @@
\@onlypreamble \DeclareExercisePropertyAlias
\NewDocumentCommand \SetExerciseProperty {mmm+m}
+ { \xsim_set_property:xxnn {\ExerciseType} {\ExerciseID} {#3} {#4} }
+
+\NewDocumentCommand \SetExpandedExerciseProperty {mmm+m}
+ { \xsim_set_property:xxnx {\ExerciseType} {\ExerciseID} {#3} {#4} }
+
+\NewDocumentCommand \ExerciseSetProperty {mmm+m}
{ \xsim_set_property:nnnn {#1} {#2} {#3} {#4} }
+\NewDocumentCommand \ExerciseSetExpandedProperty {mmm+m}
+ { \xsim_set_property:nnnx {#1} {#2} {#3} {#4} }
+
\NewExpandableDocumentCommand \IfExercisePropertyExistTF {+m+m+m}
{ \xsim_if_property_exist:nTF {#1} {#2} {#3} }
@@ -238,6 +256,36 @@
{ \GetExerciseParameter {exercise-name} }
}
+\NewDocumentCommand \GetExerciseBody {m}
+ { \xsim_input:oon { \ExerciseType } { \ExerciseID } {#1} }
+
+\NewExpandableDocumentCommand \IfExerciseParameterSetTF {+m+m+m}
+ { \xsim_if_parameter_set:nnTF {\ExerciseType} {#1} {#2} {#3} }
+
+\NewExpandableDocumentCommand \IfExerciseParameterSetT {+m+m}
+ { \IfExerciseParameterSetTF {#1} {#2} {} }
+
+\NewExpandableDocumentCommand \IfExerciseParameterSetF {+m+m}
+ { \IfExerciseParameterSetTF {#1} {} {#2} }
+
+\NewExpandableDocumentCommand \ExerciseParameterIfSetTF {+m+m+m+m}
+ { \xsim_if_parameter_set:nnTF {#1} {#2} {#3} {#4} }
+
+\NewExpandableDocumentCommand \ExerciseParameterIfSetT {+m+m+m}
+ { \ExerciseParameterIfSetTF {#1} {#2} {#3} {} }
+
+\NewExpandableDocumentCommand \ExerciseParameterIfSetF {+m+m+m}
+ { \ExerciseParameterIfSetTF {#1} {#2} {} {#3} }
+
+\NewDocumentCommand \GetExerciseParameterTF {m+m+m}
+ { \xsim_get_parameter_if_set:onTF {\ExerciseType} {#1} {#2} {#3} }
+
+\NewDocumentCommand \GetExerciseParameterT {m+m}
+ { \GetExerciseParameterTF {#1} {#2} {} }
+
+\NewDocumentCommand \GetExerciseParameterF {m+m+m}
+ { \GetExerciseParameterTF {#1} {} {#2} }
+
% ----------------------------------------------------------------------------
\NewDocumentCommand \ExercisePropertyIfSetTF {mmm+m+m}
@@ -548,6 +596,21 @@
% ----------------------------------------------------------------------------
+\NewDocumentCommand \printforexercises {sO{}+mO{}}
+ {
+ \IfBooleanTF {#1}
+ {
+ \xsim_foreach_exercise_type:n
+ { \xsim_print_type_code:nnnnn { \c_true_bool } {#2} {#4} {##1} {#3} }
+ }
+ {
+ \xsim_foreach_exercise_type:n
+ { \xsim_print_type_code:nnnnn { \c_false_bool } {#2} {#4} {##1} {#3} }
+ }
+ }
+
+% ----------------------------------------------------------------------------
+
\NewDocumentCommand \xsimsetup {m}
{ \xsim_setup:n {#1} }
@@ -562,4 +625,4 @@
{ \xsim_if_chapter:F {#1} }
% ----------------------------------------------------------------------------
-\tex_endinput:D
+\file_input_stop: