Multiple-choice question..

14 views
Skip to first unread message

Murali Mani

unread,
Jul 11, 2025, 4:19:53 PM7/11/25
to PreTeXt support
I am trying to include a multiple-choice question.. I have the following code right now.. I would prefer the following: (a) Not highlight the correct answer when the page loads (b) Can I change the display of the choices to be aligned (c) I think the display of options like A can be avoided.. This is the code I have right now..  appreciate your suggestions.. thanks, murali.

    <exercise>
      <statement>
        <p>What is printed by the C++ program (lines 13, 14)</p>
      </statement>
      <choices>
        <choice correct="no">
          <statement>
<line><code>s1 ID = 101</code></line>
<line><code>s2 ID = 101</code></line>
            </statement>
          </choice>
        <choice correct="yes">
          <statement>
<line><code>s1 ID = 101</code></line>
<line><code>s2 ID = 202</code></line>
            </statement>
          </choice>
        <choice correct="no">
          <statement>
<line><code>s1 ID = 202</code></line>
<line><code>s2 ID = 101</code></line>
            </statement>
          </choice>
        <choice correct="no">
          <statement>
<line><code>s1 ID = 202</code></line>
<line><code>s2 ID = 202</code></line>
            </statement>
          </choice>
      </choices>
    </exercise>

Andrew Scholer

unread,
Jul 11, 2025, 7:07:44 PM7/11/25
to pretext...@googlegroups.com
a) I see no sign of correct answer being highlighted. If you have answered the question before and reload the page, your previous answer is restored - is that what you see?

b) I don't believe line is valid there. To render console output, you probably want something like:
          <statement>
            <console>
              <output>
                s1 ID = 101asdf
                s1 ID = 101
              </output>
            </console>
          </statement>



Andrew Scholer (he/him/his)
Computer Science Instructor
Chemeketa Community College


--
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.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/62843328-33d5-4aa0-b231-f08a6523a3d7n%40googlegroups.com.

Murali Mani

unread,
Jul 11, 2025, 7:25:23 PM7/11/25
to PreTeXt support
Thank you, Andrew..
(a) -- you are absolutely correct.. that was what was happening..
(b) that does work as I expected.. I also found <cd> to give the same look and feel.. Probably there are some subtle distinctions regarding when to use one over the other..

again, thank you.. I believe my question (c) is not significant -- it is ok to have the choices be explicitly labeled as "A", etc.. (works fine with <console><output>

thanks and best, murali.

Reply all
Reply to author
Forward
0 new messages