cline formatting in Parsons problem HTML output

18 views
Skip to first unread message

Andrew Scholer

unread,
Nov 1, 2025, 12:13:34 PMNov 1
to prete...@googlegroups.com
Mostly for Rob and Brad...

While investigating a Parsons issue, I noticed that the behavior of a cline in Parsons problems is inconsistent between @language="natural" and not natural.

When language is specified as something like "cpp", the cline text is xeroxed into the HTML. This means that a block that looked like:

      <block>
        <cline> else {</cline>
      </block>

Ends up rendered as:

---
 else {
---

Where --- is the magic string specifying the extent of a block.

However, if language is "natural", the cline gets passed through the cline template which adds a newline resulting in:

---
 else {
   
---

That extra line ends up being interpreted as a real line in the Parsons js. However, it does not get rendered visibly. This is not actively causing any bugs that I can identify - each block just has one more line than is apparent to the user. But it feels like it could cause issues.


Andrew

Rob Beezer

unread,
Nov 1, 2025, 12:28:49 PMNov 1
to prete...@googlegroups.com
Thanks, Andrew. I think entirely for Rob.

Does the sample book have an example that would hit this?

Andrew Scholer

unread,
Nov 1, 2025, 12:33:55 PMNov 1
to prete...@googlegroups.com
If you remove the language="python" from prime-number-program-indent-yes you should see the output for the problem change.

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAwNy5iZWV6ZXI.1762014526%40pnsh.

Bradley Miller

unread,
Nov 5, 2025, 10:38:35 AMNov 5
to PreTeXt development
As we discussed in drop-in yesterday, Rob changed the output format for the runestone-manifest.xml file to be html.

I made an initial attempt to process that manifest this morning, and unsurprisingly it failed.

  File "/Users/bmiller/rs/components/rsptx/build_tools/core.py", line 548, in manifest_data_to_db
    db_context = _initialize_db_context(engine, sess, course_name, manifest_path)
  File "/Users/bmiller/rs/components/rsptx/build_tools/core.py", line 579, in _initialize_db_context
    tree = ET.parse(manifest_path)
  File "src/lxml/etree.pyx", line 3589, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1958, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1984, in lxml.etree._parseDocumentFromURL
  File "src/lxml/parser.pxi", line 1887, in lxml.etree._parseDocFromFile
  File "src/lxml/parser.pxi", line 1200, in lxml.etree._BaseParser._parseDocFromFile
  File "src/lxml/parser.pxi", line 633, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 743, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 672, in lxml.etree._raiseParseError
  File "./runestone-manifest-html.txt", line 2428
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: img line 2427 and div, line 2428, column 7

I have not looked at the code to see what my options are for parsing this to avoid the error.

Brad

Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.


Rob Beezer

unread,
Nov 5, 2025, 11:13:32 AMNov 5
to prete...@googlegroups.com
Dear Brad,

You saw that there is an #img (the Luther bell!) that is not formed as an empty
element, nor does it have a closing tag? So not strictly XML. No real surprise
there, and there will be more with other elements, I expect.

https://lxml.de/parsing.html

Scroll down to "Parsing HTML"

Rob
> Set up a time to meet <https://fantastical.app/bonelake-Gj2i/meet-with-
> brad> with me.
>
>
>> On Nov 1, 2025, at 9:33 AM, Andrew Scholer <andrew....@chemeketa.edu> wrote:
>>
>> If you remove the language="python" from prime-number-program-indent-yes you
>> should see the output for the problem change.
>>
>> On Sat, Nov 1, 2025 at 9:28 AM 'Rob Beezer' via PreTeXt development <pretext-
>> d...@googlegroups.com <mailto:prete...@googlegroups.com>> wrote:
>>
>> Thanks, Andrew.  I think entirely for Rob.
>>
>> Does the sample book have an example that would hit this?
>>
>> On November 1, 2025 9:12:57 AM PDT, Andrew Scholer
>> email to pretext-dev...@googlegroups.com <mailto:pretext-
>> dev%2Bunsu...@googlegroups.com>.
>> To view this discussion visit https://groups.google.com/d/msgid/pretext-
>> dev/MTAwMDAwNy5iZWV6ZXI.1762014526%40pnsh <https://groups.google.com/d/
>> msgid/pretext-dev/MTAwMDAwNy5iZWV6ZXI.1762014526%40pnsh>.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "PreTeXt development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pretext-dev...@googlegroups.com <mailto:pretext-
>> dev+uns...@googlegroups.com>.
>> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
>> CACm44N8ZszPNGKy%2BN-0ebg%2BDJi9HZPSr63GRkarnuLS_ikf%3DxQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pretext-dev/
>> CACm44N8ZszPNGKy%2BN-0ebg%2BDJi9HZPSr63GRkarnuLS_ikf%3DxQ%40mail.gmail.com?
>> utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-
> dev/1DB382CA-1025-4610-A0BD-0A6D20E72ADA%40runestone.academy <https://
> groups.google.com/d/msgid/pretext-dev/1DB382CA-1025-4610-
> A0BD-0A6D20E72ADA%40runestone.academy?utm_medium=email&utm_source=footer>.

Bradley Miller

unread,
Nov 5, 2025, 2:16:44 PMNov 5
to PreTeXt development
Thanks for the pointer.   It is going to take a bit of work, as I used find and findall extensively which do not work with html very well.  I will all need to be convert all of those to xpath queries.  

Brad


Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.


-- 
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com <mailto:pretext- dev+uns...@googlegroups.com>.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/1DB382CA-1025-4610-A0BD-0A6D20E72ADA%40runestone.academy <https:// groups.google.com/d/msgid/pretext-dev/1DB382CA-1025-4610- A0BD-0A6D20E72ADA%40runestone.academy?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxMS5iZWV6ZXI.1762359210%40pnsh.

Bradley Miller

unread,
Nov 5, 2025, 6:50:30 PMNov 5
to PreTeXt development
I may have hijacked the wrong thread.  OK, so I have converted the code so it reads/processes the manifest without crashing.

I looked at some assignments, and it seems we have some encoding issue to figure out.  In any case it would be great to have another set of eyes helping to test this out.  I made a CSV of relevant tables, but the diffs on the questions are impossible since the XML version formatted the htmlsrc column nicely and of course the html version of the manifest is kind of ugly.


Screenshot 2025-11-05 at 3.48.29 PM.png


Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.

Rob Beezer

unread,
Nov 5, 2025, 8:22:37 PMNov 5
to prete...@googlegroups.com
Thanks for the fast progress!

I'll checkout the encoding soon, or in the morning.

On November 5, 2025 3:50:12 PM PST, Bradley Miller <br...@runestone.academy> wrote:
>I may have hijacked the wrong thread. OK, so I have converted the code so it reads/processes the manifest without crashing.
>
>I looked at some assignments, and it seems we have some encoding issue to figure out. In any case it would be great to have another set of eyes helping to test this out. I made a CSV of relevant tables, but the diffs on the questions are impossible since the XML version formatted the htmlsrc column nicely and of course the html version of the manifest is kind of ugly.
>
>
>
>
>
>Brad Miller
>Professor Emeritus, Luther College
>Founder, Runestone Academy LTD
>Blog: http://reputablejournal.com
>
>Set up a time to meet <https://fantastical.app/bonelake-Gj2i/meet-with-brad> with me.
>
>
>> On Nov 5, 2025, at 11:16 AM, Bradley Miller <br...@runestone.academy> wrote:
>>
>> Thanks for the pointer. It is going to take a bit of work, as I used find and findall extensively which do not work with html very well. I will all need to be convert all of those to xpath queries.
>>
>> Brad
>>
>>
>> Brad Miller
>> Professor Emeritus, Luther College
>> Founder, Runestone Academy LTD
>> Blog: http://reputablejournal.com
>>
>> Set up a time to meet <https://fantastical.app/bonelake-Gj2i/meet-with-brad> with me.
>>>> Set up a time to meet <https://fantastical.app/bonelake-Gj2i/meet-with- brad <https://fantastical.app/bonelake-Gj2i/meet-with-%20brad>> with me.
>>>>> On Nov 1, 2025, at 9:33 AM, Andrew Scholer <andrew....@chemeketa.edu <mailto:andrew....@chemeketa.edu>> wrote:
>>>>>
>>>>> If you remove the language="python" from prime-number-program-indent-yes you should see the output for the problem change.
>>>>>
>>>>> On Sat, Nov 1, 2025 at 9:28 AM 'Rob Beezer' via PreTeXt development <pretext- d...@googlegroups.com <mailto:d...@googlegroups.com> <mailto:prete...@googlegroups.com>> wrote:
>>>>>
>>>>> Thanks, Andrew. I think entirely for Rob.
>>>>>
>>>>> Does the sample book have an example that would hit this?
>>>>>
>>>>> On November 1, 2025 9:12:57 AM PDT, Andrew Scholer
>>>>> email to pretext-dev...@googlegroups.com <mailto:pretext-dev...@googlegroups.com> <mailto:pretext-
>>>>> dev%2Bunsu...@googlegroups.com <mailto:dev+uns...@googlegroups.com>>.
>>>>> To view this discussion visit https://groups.google.com/d/msgid/pretext-
>>>>> dev/MTAwMDAwNy5iZWV6ZXI.1762014526%40pnsh <https://groups.google.com/d/
>>>>> msgid/pretext-dev/MTAwMDAwNy5iZWV6ZXI.1762014526%40pnsh>.
>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com <mailto:pretext-dev...@googlegroups.com> <mailto:pretext- dev+uns...@googlegroups.com <mailto:dev+uns...@googlegroups.com>>.
>>>>> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/CACm44N8ZszPNGKy%2BN-0ebg%2BDJi9HZPSr63GRkarnuLS_ikf%3DxQ%40mail.gmail.com <http://40mail.gmail.com/><https://groups.google.com/d/msgid/pretext-dev/ CACm44N8ZszPNGKy%2BN-0ebg%2BDJi9HZPSr63GRkarnuLS_ikf%3DxQ%40mail.gmail.com? utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/pretext-dev/%20CACm44N8ZszPNGKy%2BN-0ebg%2BDJi9HZPSr63GRkarnuLS_ikf%3DxQ%40mail.gmail.com?%20utm_medium=email&utm_source=footer>>.
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com <mailto:pretext-dev...@googlegroups.com> <mailto:pretext- dev+uns...@googlegroups.com <mailto:dev+uns...@googlegroups.com>>.
>>>> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/1DB382CA-1025-4610-A0BD-0A6D20E72ADA%40runestone.academy <https:// groups.google.com/d/msgid/pretext-dev/1DB382CA-1025-4610- <http://groups.google.com/d/msgid/pretext-dev/1DB382CA-1025-4610-> A0BD-0A6D20E72ADA%40runestone.academy?utm_medium=email&utm_source=footer>.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com <mailto:pretext-dev...@googlegroups.com>.
>>> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxMS5iZWV6ZXI.1762359210%40pnsh.
>>
>

Andrew Scholer

unread,
Nov 5, 2025, 8:26:18 PMNov 5
to prete...@googlegroups.com
This feels worth some effort to automate.

Maybe run both versions through a tidy tool so they are better diffable?

If you have a csv or db with xml formatted and html formatted versions, you could use something like PyTidyLib to do something like this for each version:
make output file
for each question:
    grab htmlsource
    tidy it up
    append to output file

Then you could diff the files produced from the xml formatted source and the html formatted source.

If you get a mostly automated process set up, I would be happy to diff a few books and submit things that look broken.


Rob Beezer

unread,
Nov 5, 2025, 9:47:00 PMNov 5
to prete...@googlegroups.com
On 11/5/25 15:50, Bradley Miller wrote:
> it seems we have some encoding issue to figure out

Those problem characters are Unicode apostrophes and "smart quotes", and are
identical in the XML version (old) and the HTML version (new).

But the XML version has a first line like:

<?xml version="1.0" encoding="UTF-8"?>

while the HTML version has *nothing*.

I'll see if I can change a couple of things to make the right stuff come out (or
at least something better), or you can add something by hand if you want to make
progress right now.

Rob

Bradley Miller

unread,
Nov 6, 2025, 10:37:59 AMNov 6
to PreTeXt development
Yeah,

I solved the encoding problems and it looks good now.

Is there an exercise that was exhibiting the problem Sean was having so that we can verify whether or not all of these changes have made a difference.

I do think this needs more careful scrutiny before merging any of this. We have had years of stability in the manifest and I would hate to throw courses into chaos over a bad xpath query!

Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.

Andrew Scholer

unread,
Nov 6, 2025, 11:10:14 AMNov 6
to prete...@googlegroups.com

Bradley Miller

unread,
Nov 6, 2025, 4:27:54 PMNov 6
to PreTeXt development
So, it would be good to get that question into the sample book so we can test and make sure this is solving the problem.

I’m surprised we are not seeing this problem more?  Maybe because this isn’t a programming problem.

Brad

Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.

Andrew Scholer

unread,
Nov 6, 2025, 4:42:12 PMNov 6
to prete...@googlegroups.com
The key features that I think are necessary to trigger this:
* It is natural language, not programming.
* It has embedded math (or some other markup that introduces newline characters as it is rendered as XML).

The existing `number-theory-proof` already meets those criteria and displays the issue.

But... you only see evidence of the issue when you try to solve it on a book page and then go look at your solution on a DB driven page (assignment page or grading page). It works fine in either context, but it is different in the two contexts so your saved solution from one does not make sense in the other.

That combination of factors is why we aren't seeing it more. Sean did his thing and found the edge case no one else was using. :)

Bradley Miller

unread,
Nov 6, 2025, 5:44:03 PMNov 6
to PreTeXt development
Rob, Andrew

OK, I checked the number-theory-proof question.  #6 on the parsons page.

Still broken even with the html based manifest, comparing the second block

MANIFEST
---
<div class="para" id="number-theory-proof-numbered-left-4-2-1-1">Then <span class="process-math">\(n\)</span> is a prime number.</div> #paired
---

HTML
---
<div class="para" id="number-theory-proof-numbered-left-4-2-1-1">Then <span class="process-math">\(n\)</span> is a prime number.<div class="autopermalink" data-description="Paragraph"><a href="#number-theory-proof-numbered-left-4-2-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
</div> #paired
---

There seems to be some extra stuff in my html about permalinks….. I wonder if that is what is injecting the newline.   Read on!

— time passes —

OK, updated to 2.30.0 — Thanks Oscar!

Rebuilt, deleted old answers from the database, cleared localstorage.

Solved the problem in context on the first try!  I have it memorized now.

Went to the assignment page, and Tada there it is!

OK, this still seems somewhat bad that we have some closing divs on their own lines (after a span with a class of process-math) But at least the manifest and the html are consistent.

Brad

Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.

Rob Beezer

unread,
Nov 7, 2025, 10:36:16 AMNov 7
to prete...@googlegroups.com
Good work, Brad.

Yes, we thought putting permalinks onto the page was a good idea, rather than
having Javascript find gthe right places and add them in. We (Andrew, Oscar)
have been finding places where they are too much and killing them. For me, I
think children of divisions (including #paragraphs) might be enough? A
#theorem, but not every #p within it? I'm sure some will think that leans too
far the other way.

OK, having said that, how about an even bigger suggestion. I've learned the
harway that copies of content are fraught. Knowls, WW, manifest, and probably more.

What if the manifest's #htmsrc element just held a *pointer* into the HTML? Go
grab the original, don't just make a copy? Something like

<htmlsrc the-file="sec-number-theory.html" id="ANT_3_number-theory-proof"/>

(Then the manifest could go back to XML!)

Rob
> Set up a time to meet <https://fantastical.app/bonelake-Gj2i/meet-with-
> brad> with me.
>
>
>> On Nov 6, 2025, at 1:41 PM, Andrew Scholer <andrew....@chemeketa.edu> wrote:
>>
>> The key features that I think are necessary to trigger this:
>> * It is natural language, not programming.
>> * It has embedded math (or some other markup that introduces newline
>> characters as it is rendered as XML).
>>
>> The existing `number-theory-proof` already meets those criteria and displays
>> the issue.
>>
>> But... you only see evidence of the issue when you try to solve it on a book
>> page and then go look at your solution on a DB driven page (assignment page or
>> grading page). It works fine in either context, but it is different in the two
>> contexts so your saved solution from one does not make sense in the other.
>>
>> That combination of factors is why we aren't seeing it more. Sean did his
>> thing and found the edge case no one else was using. :)
>>
>> On Thu, Nov 6, 2025 at 1:27 PM Bradley Miller <br...@runestone.academy> wrote:
>>
>> So, it would be good to get that question into the sample book so we can
>> test and make sure this is solving the problem.
>>
>> I’m surprised we are not seeing this problem more?  Maybe because this
>> isn’t a programming problem.
>>
>> Brad
>>
>> Brad Miller
>> Professor Emeritus, Luther College
>> Founder, Runestone Academy LTD
>> Blog: http://reputablejournal.com <http://reputablejournal.com/>
>>
>> Set up a time to meet <https://fantastical.app/bonelake-Gj2i/meet-with-
>> brad> with me.
>>
>>
>>> On Nov 6, 2025, at 8:09 AM, Andrew Scholer <andrew....@chemeketa.edu
>>> <mailto:andrew....@chemeketa.edu>> wrote:
>>>
>>> Brad -
>>>
>>> This Parsons problem was the instigator:
>>> https://github.com/sean-fitzpatrick/APEXCalculusPTX/blob/
>>> f21d5dcf98a6ff0868519f25f8633ecfe7fa7291/ptx/sec_optimization.ptx#L585
>>> <https://github.com/sean-fitzpatrick/APEXCalculusPTX/blob/
>>> f21d5dcf98a6ff0868519f25f8633ecfe7fa7291/ptx/sec_optimization.ptx#L585>
>>>
>>> On Thu, Nov 6, 2025 at 7:38 AM Bradley Miller <br...@runestone.academy> wrote:
>>>
>>> Yeah,
>>>
>>> I solved the encoding problems and it looks good now.
>>>
>>> Is there an exercise that was exhibiting the problem Sean was having
>>> so that we can verify whether or not all of these changes have made a
>>> difference.
>>>
>>> I do think this needs more careful scrutiny before merging any of
>>> this. We have had years of stability in the manifest and I would hate
>>> to throw courses into chaos over a bad xpath query!
>>>
>>> Brad Miller
>>> Professor Emeritus, Luther College
>>> Founder, Runestone Academy LTD
>>> Blog: http://reputablejournal.com <http://reputablejournal.com/>
>>>
>>> Set up a time to meet <https://fantastical.app/bonelake-Gj2i/meet-
>>> with-brad> with me.
>>>
>>>
>>>> On Nov 5, 2025, at 6:46 PM, 'Rob Beezer' via PreTeXt development
>>>> <prete...@googlegroups.com <mailto:prete...@googlegroups.com>>
>>>> wrote:
>>>>
>>>> On 11/5/25 15:50, Bradley Miller wrote:
>>>>> it seems we have some encoding issue to figure out
>>>>
>>>> Those problem characters are Unicode apostrophes and "smart quotes",
>>>> and are identical in the XML version (old) and the HTML version (new).
>>>>
>>>> But the XML version has a first line like:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>
>>>> while the HTML version has *nothing*.
>>>>
>>>> I'll see if I can change a couple of things to make the right stuff
>>>> come out (or at least something better), or you can add something by
>>>> hand if you want to make progress right now.
>>>>
>>>> Rob
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "PreTeXt development" group.
>>>> To unsubscribe from this group and stop receiving emails from it,
>>>> send an email to pretext-dev...@googlegroups.com
>>>> <mailto:pretext-dev%2Bunsu...@googlegroups.com>.
>>>> To view this discussion visit https://groups.google.com/d/msgid/
>>>> pretext-dev/MTAwMDAyNy5iZWV6ZXI.1762397218%40pnsh <https://
>>>> groups.google.com/d/msgid/pretext-dev/
>>>> MTAwMDAyNy5iZWV6ZXI.1762397218%40pnsh>.
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "PreTeXt development" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to pretext-dev...@googlegroups.com
>>> <mailto:pretext-dev...@googlegroups.com>.
>>> To view this discussion visit https://groups.google.com/d/msgid/
>>> pretext-dev/317A6740-3832-4F5F-9029-2EC47EC2D737%40runestone.academy
>>> <https://groups.google.com/d/msgid/pretext-
>>> dev/317A6740-3832-4F5F-9029-2EC47EC2D737%40runestone.academy?
>>> utm_medium=email&utm_source=footer>.
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "PreTeXt development" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to pretext-dev...@googlegroups.com <mailto:pretext-
>>> dev+uns...@googlegroups.com>.
>>> To view this discussion visit https://groups.google.com/d/msgid/pretext-
>>> dev/
>>> CACm44N8Vwdv6kanaTfxgh7SrV3JkWdXDdbj8%2BJv7nbj7P2YfrQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/pretext-dev/
>>> CACm44N8Vwdv6kanaTfxgh7SrV3JkWdXDdbj8%2BJv7nbj7P2YfrQ%40mail.gmail.com?
>>> utm_medium=email&utm_source=footer>.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "PreTeXt development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pretext-dev...@googlegroups.com <mailto:pretext-
>> dev+uns...@googlegroups.com>.
>> To view this discussion visit https://groups.google.com/d/msgid/pretext-
>> dev/D9111BD4-B689-4F04-9287-97920D2DA0C0%40runestone.academy <https://
>> groups.google.com/d/msgid/pretext-dev/D9111BD4-
>> B689-4F04-9287-97920D2DA0C0%40runestone.academy?
>> utm_medium=email&utm_source=footer>.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "PreTeXt development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pretext-dev...@googlegroups.com <mailto:pretext-
>> dev+uns...@googlegroups.com>.
>> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
>> CACm44N8CkbK_Ne3rqzFDqaoTNcxqngJ6BGvzq20WiBi_PHwFiA%40mail.gmail.com <https://
>> groups.google.com/d/msgid/pretext-dev/
>> CACm44N8CkbK_Ne3rqzFDqaoTNcxqngJ6BGvzq20WiBi_PHwFiA%40mail.gmail.com?
>> utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-
> dev/632DDC3D-CEC7-462C-953C-677BF2C2C575%40runestone.academy <https://
> groups.google.com/d/msgid/pretext-dev/632DDC3D-
> CEC7-462C-953C-677BF2C2C575%40runestone.academy?utm_medium=email&utm_source=footer>.

Bradley Miller

unread,
Nov 7, 2025, 1:42:37 PMNov 7
to PreTeXt development
That sounds like a big lift!  

It would further complicate things by having the html for exercises in two places.  In the html for the book which would need to be parsed and extracted, and in the database for questions written in the assignment builder.

I’m open to discussing more, but it feels like a lot of work for minimal benefit.

Brad

Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.


To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/CACm44N8CkbK_Ne3rqzFDqaoTNcxqngJ6BGvzq20WiBi_PHwFiA%40mail.gmail.com <https:// groups.google.com/d/msgid/pretext-dev/CACm44N8CkbK_Ne3rqzFDqaoTNcxqngJ6BGvzq20WiBi_PHwFiA%40mail.gmail.com? utm_medium=email&utm_source=footer>.
-- 
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com <mailto:pretext- dev+uns...@googlegroups.com>.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/632DDC3D-CEC7-462C-953C-677BF2C2C575%40runestone.academy <https:// groups.google.com/d/msgid/pretext-dev/632DDC3D- CEC7-462C-953C-677BF2C2C575%40runestone.academy?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxMC5iZWV6ZXI.1762529773%40pnsh.

Andrew Scholer

unread,
Nov 7, 2025, 1:53:22 PMNov 7
to prete...@googlegroups.com
I think only having one render path is a big win. I don't see a non-kludgey way to fix the current cline issue without that. And I would not be surprised if we see another issue down the line related to rendering differences between the two outputs.

The htmlsrc would not have to be grabbed at page render time. Instead, the process-manifest function could be responsible for using the manifest to grab the right html chunk from the html file as it is being processed. So the htmlsrc would still go in the DB and no other logic would change.

This would mean that the manifest file would no longer be standalone. I'm not sure that is a deal breaker, but does make "send me your manifest" a less useful debugging tool.

Rob Beezer

unread,
Nov 7, 2025, 2:02:03 PMNov 7
to prete...@googlegroups.com
On 11/7/25 10:52, Andrew Scholer wrote:
> The htmlsrc would not have to be grabbed at page render time. Instead, the
> process-manifest function could be responsible for using the manifest to grab
> the right html chunk from the html file as it is being processed. So the htmlsrc
> would still go in the DB and no other logic would change.

I didn't really say it, but that was what I was imagining. Copy the HTML out of
the served pages into the DB. Once.

> This would mean that the manifest file would no longer be standalone. I'm not
> sure that is a deal breaker, but does make "send me your manifest" a less useful
> debugging tool.
Ash, "self-contained". Wasn't sure at first what you meant by standalone.

Rob

Bradley Miller

unread,
Nov 7, 2025, 2:39:30 PMNov 7
to prete...@googlegroups.com
Ok sounds better.
The manifest file lives with the html files after the build, and my runestone build script processes the manifest immediately after the pretext build finishes.

Its not quite as simple as searching the html file for the label as often PTXSB_2_xyz  is a descendant of a <div class=“ptx-runestone-container”><div class=“runestone multiplechoice_section”> and may have a sibling of a <div class=“exercise-statement”>

probably finding the label and working back to the nearest ptx-runestone-container will work… Or do we want to construct and id for the outermost div?

Brad

Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.

Bradley Miller

unread,
Nov 7, 2025, 4:06:16 PMNov 7
to prete...@googlegroups.com
I don’t think in xpath!! 

Clearly this can be done with a single xpath query and no need for any additional attributes.


Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.

Rob Beezer

unread,
Nov 7, 2025, 4:31:17 PMNov 7
to prete...@googlegroups.com
On 11/7/25 13:06, Bradley Miller wrote:
> I don’t think in xpath!!

Well, get with the program!!! ;-)

> Clearly this can be done with a single xpath query and no need for any
> additional attributes.
And I shouldn't have suggested the @id look like the Runestone version of the
@label. The outermost #div of a Runestone-thing on its served page can have a
unique #id and then that string can be replicated in an attribute of the
#htmlsrc. "find()" might even be enough.

And we could even phase it in. Want me to make a test version, maybe for our
friend, the Parsons problems?

Rob

Bradley Miller

unread,
Nov 7, 2025, 4:34:31 PMNov 7
to prete...@googlegroups.com
Here is another thing I found while thinking about this puzzle.

It looks to me as though we have a mismatch in our assumptions about the default language.  In the parsons javascript we look for a data-language attribute, it it is not there we look for eBookConfig.language and if neither are there we assume the language to be “python”

The number theory proof question does not specify the language.

Brad

Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.

Andrew Scholer

unread,
Nov 7, 2025, 5:10:51 PMNov 7
to prete...@googlegroups.com
AFAIK every Parson problem should end up with a @data-language on the <pre>. The XSL for them checks to see if there is a programming language defined. That value can be an attribute in the exercise or a book-level default specified in docinfo. If no language is found, 'natural' is used.

The manifest for the problem you mention shows:
                                <pre class="parsonsblocks"
                                     data-question_label=""
                                     style="visibility: hidden;"
                                     data-language="natural"
                                    ...

So whatever the JS is doing other than looking at data-language should never come into play for PTX authored problems.

Bradley Miller

unread,
Nov 7, 2025, 5:18:08 PMNov 7
to prete...@googlegroups.com
Ugh, I missed it.  That is good.

Brad

Brad Miller
Professor Emeritus, Luther College
Founder, Runestone Academy LTD
Blog: http://reputablejournal.com

Set up a time to meet with me.

Reply all
Reply to author
Forward
0 new messages