fillins in tables

17 views
Skip to first unread message

Teresa “Terri” Magnus

unread,
Aug 25, 2025, 11:34:31 AM (11 days ago) Aug 25
to PreTeXt support
I have a task in an exploration where I would like students to fill in a table with their computed values and then use this work to develop a general formula. I tried using fillins and there are now lines, but when I attempt to enter answers into the html nothing appears. 

a. Is this possible for html in the current PreTeXt version?
b. Will this work in Runestone even if it doesn't work in html?
c. Am I missing something in the code?
d. The last row asks for algebraic expressions, some of which could be written in multiple ways. Is there documentation to help me write this in a way that would be checkable.

My code follows. TIA!
    <task xml:id="regular-pentagon-table-task" label="regular-pentagon-table-label">
  <!-- Is there a way for students to fill in answers for this table? -->
      <statement>
        <p>
          Use your work from the previous task to complete the row for regular
          pentagon in the table below. Repeat this procedure for squares, regular
          hexagons, regular octagons, and regular decagons: First draw diagonals from
          a single vertex to dissect the polygon into triangles, next use the triangles  
          to determine the total vertex angle measure, and then determine the
          measure of each angle. In the final row, <m>n</m> is a variable representing
          the number of sides and the answers will be algebraic expressions involving the
          variable <m>n</m>.
        </p>
        <table xml:id="table-vertex-measure-regular-polygons-common">
          <title>Angles of Regular Polygons</title>
          <tabular halign="center" row-headers="yes">
            <col right="medium"/>
            <col right="minor"/>
            <col right="minor"/>
            <col right="minor"/>
            <col />
            <row bottom="medium" header="yes">
            <cell>shape</cell>
            <cell><line>number</line><line>of sides</line></cell>
            <cell><line>number of</line><line>triangles</line></cell>
            <cell><line>total angle</line><line>measure</line></cell>
            <cell><line>single vertex</line><line>measure</line></cell>
            </row>
            <row bottom="minor">
              <cell>triangle</cell>
              <cell>3</cell>
              <cell>1</cell>
              <cell>180</cell>
              <cell>60</cell>
            </row>
            <row bottom="minor">
              <cell>square</cell>
              <cell>4</cell>
              <cell><fillin mode="number" answer="2" /></cell>
              <cell><fillin mode="number" answer="360" /></cell>
              <cell><fillin mode="number" answer="90" /></cell>
            </row>
            <row bottom="minor">
              <cell>regular pentagon</cell>
              <cell>5</cell>
              <cell><fillin mode="number" answer="3" /></cell>
              <cell><fillin mode="number" answer="540" /></cell>
              <cell><fillin mode="number" answer="108" /></cell>
            </row>
            <row bottom="minor">
              <cell>regular hexagon</cell>
              <cell>6</cell>
              <cell><fillin mode="number" answer="4" /></cell>
              <cell><fillin mode="number" answer="720" /></cell>
              <cell><fillin mode="number" answer="120" /></cell>
            </row>
            <row bottom="minor">
              <cell>regular octagon</cell>
              <cell>8</cell>
              <cell><fillin mode="number" answer="6" /></cell>
              <cell><fillin mode="number" answer="1080" /></cell>
              <cell><fillin mode="number" answer="135" /></cell>
            </row>
            <row bottom="minor">
              <cell>regular decagon</cell>
              <cell>10</cell>
              <cell><fillin mode="number" answer="8" /></cell>
              <cell><fillin mode="number" answer="1440" /></cell>
              <cell><fillin mode="number" answer="144" /></cell>
            </row>
            <row>
              <cell>regular <m>n</m>-gon</cell>
              <cell><m>n</m></cell>
              <cell><fillin mode="math" answer="n-2" /></cell>
              <cell><fillin mode="math" answer="180(n-2)" /></cell>
              <cell><fillin mode="number" answer="180(n-2)/n" /></cell>
            </row>
          </tabular>
        </table>
<!--How do I fix the fillins in the above table so that answers can be inserted?
     What mode is needed for the last row?-->
      </statement>
    </task>

Andrew Scholer

unread,
Aug 25, 2025, 11:52:34 AM (11 days ago) Aug 25
to PreTeXt support
Terri - 

You will need an <evaluation> block in the task (after the statement) with an <evaluate> for each of the fillins.

D. Brian Walton

unread,
Aug 26, 2025, 10:47:54 AM (10 days ago) Aug 26
to pretext...@googlegroups.com
Terri,

To enable the math checking javascript, you need to have a <setup> block as well as the <evaluation> block. Formulas (at least currently) need to be defined in the setup.

<setup>
  <de-object name="formula1" context="formula">
    <de-expression>n-2</de-expression>
  </de-object>
  <de-object name="formula2" context="formula">
    <de-expression>180(n-2)</de-expression>
  </de-object>
  <de-object name="formula3" context="formula">
    <de-expression>180(n-2)/n</de-expression>
  </de-object>
</setup>

And then change your three <fillin> referring to the formulas from, for example, `answer = "n-2"` to `ansobj = "formula1"` (referring to the three formulas).
<cell><fillin mode="math" ansobj="formula1" /></cell>
<cell><fillin mode="math" ansobj="formula2" /></cell>
<cell><fillin mode="math" ansobj="formula3" /></cell>
Of course, you can choose more meaningful formula object names than just putting a number at the end.

The <evaluation> block needs to have <evaluate> entries for each <fillin> that you have used. Unless you want to add some custom feedback, I think you can get away with
<evaluation>
  <evaluate use-answer="yes" />
  <evaluate use-answer="yes" />
  ... repeat this for as many blanks you have (18 times?) ...
</evaluation>

Let me know if you have additional questions.

Brian


--
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/9a9e9cb3-16f8-4528-9a36-830af965d236n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages