webwork exercises inside <reading-questions> env.

16 views
Skip to first unread message

Geoffrey Cox

unread,
Sep 7, 2023, 4:37:50 PM9/7/23
to PreTeXt support
Is there a trick to get a <webwork> exercise to be interactive and display the "Activate" button when the exercise is within a <reading-questions> environment?

The exercise works as intended if it is moved outside this environment. Below is a snippet of the code that I am testing.

<subsection xml:id="interactive-exercises">
  <title>Test your Understanding</title>  

  <reading-questions>
    <title> Some Questions </title>

    <exercise>
      <webwork>
        <statement>
          <p><m>1+2=</m><var name="'3'" width="5" /></p>
        </statement>
      </webwork>
    </exercise>

  </reading-questions>

  <exercise>
    <webwork>
      <statement>
        <p><m>1+2=</m><var name="'3'" width="5" /></p>
      </statement>
    </webwork>
  </exercise>

</subsection>

Here is the output. Note that the 2nd exercise has the "Activate" button.

Capture.JPG

Rob Beezer

unread,
Sep 7, 2023, 7:32:53 PM9/7/23
to pretext...@googlegroups.com
I've got a suspicion - let me check in a bit.
> Capture.JPG
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/6be80886-8b39-4a9a-8e10-a959c96b69b9n%40googlegroups.com <https://groups.google.com/d/msgid/pretext-support/6be80886-8b39-4a9a-8e10-a959c96b69b9n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Rob Beezer

unread,
Sep 8, 2023, 11:21:24 AM9/8/23
to pretext...@googlegroups.com
Not a trick - fully documented. ;-)

Read:

Subsection 38.4.2: HTML output
https://pretextbook.org/doc/guide/html/webwork-processing.html#webwork-html-output

First few lines are stale, then it becomes interesting reading.

Short answer: WW problems in HTML can be "static" or "dynamic", based on
location. Defaults are partly one way, partly the other, and can be overruled
in the publisher file.

Rob

On 9/7/23 13:37, Geoffrey Cox wrote:

Geoffrey Cox

unread,
Sep 8, 2023, 11:36:33 AM9/8/23
to PreTeXt support
Great, thanks! I knew it had to be something I was missing.
Reply all
Reply to author
Forward
0 new messages