GithubHelp home page GithubHelp logo

Comments (5)

mschneiderwng avatar mschneiderwng commented on June 3, 2024

Also \printsolutions does not show exercises with the property solution. This worked before upgrading to xsim v0.21.

from xsim.

cgnieder avatar cgnieder commented on June 3, 2024

Oh bugger. I don't know how this could happen :(

This is a bug in

\prg_new_conditional:Npnn \xsim_if_exchange:nnn #1#2#3 {T,F,TF}
  {
    \str_if_eq:nnTF {#3} {solution} % <<< this should be `exercise'
      {
        \xsim_if_boolean_property:nnnTF {#1} {#2} {solution}
          { \prg_return_true: }
          { \prg_return_false: }
      }
      { \prg_return_false: }
  }

Adding

\ExplSyntaxOn
\prg_set_conditional:Npnn \xsim_if_exchange:nnn #1#2#3 {T,F,TF}
  {
    \str_if_eq:nnTF {#3} {exercise}
      {
        \xsim_if_boolean_property:nnnTF {#1} {#2} {solution}
          { \prg_return_true: }
          { \prg_return_false: }
      }
      { \prg_return_false: }
  }
\ExplSyntaxOff

to your preamble should restore the behaviour till the next update is released.

Unrelated to the bug I'm not sure

\begin{exercise}[solution]
	algebra question 1
	\IfInsideSolutionT{Solution to algebra question 1}
\end{exercise}

should print anything with exercise/print=false.
I'd rather use

\begin{exercise}[solution=true,ID=one]
  algebra question 1
  \IfInsideSolutionT{Solution to algebra question 1}
\end{exercise}
\printsolution{exercise}{one}

from xsim.

mschneiderwng avatar mschneiderwng commented on June 3, 2024

Yes, I just tested commit 99d8b80 and it fixed the issue. Thanks a lot!

Is there a place for discussions? I understood, that (conceptually) the solution property creates a solution environment by "copying" the exercise. Hence, I expected that exercise/print=false does not print the exercise, but the copied solution.

I am using the solution property a lot and would like to print a sheet with solutions only. Using IDs and then iterate over them for \printsolution is okay, but I am not very happy with this.

from xsim.

cgnieder avatar cgnieder commented on June 3, 2024

We can discuss here.

I can imagine an option that enables the behaviour you want – maybe even as a default setting.

Maybe

\begin{exercise}[solution]
   xxx
\end{exercise}

should be the same as

\begin{exercise}
  xxx
\end{exercise}
\begin{solution}
  xxx
\end{solution}

at least in regard to global options...

from xsim.

mschneiderwng avatar mschneiderwng commented on June 3, 2024

Great! That is exactly the behavior I expected.

from xsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.