summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
diff options
context:
space:
mode:
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: