PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
266 stars 208 forks source link

WeBWorK with lonely GeoGebra child #607

Open Alex-Jordan opened 7 years ago

Alex-Jordan commented 7 years ago

If you have a webwork with a statement, and the only child of the statement is something like a geogebra (which has attributes but is an empty element) then there is an XSL test in mathbook-html.xsl that comes up false but you'd want it to be true. I think the test needs to be written differently.

The place where the faulty test is, is here in mathbook-html.xsl, where I've commented:

2826 <xsl:template match="webwork" mode="body">
2827     <xsl:comment>use 'format=debug' on 'webwork' tag to debug problem</xsl:comment>
2828     <xsl:element name="iframe">
2829         <xsl:attribute name="width">100%</xsl:attribute> <!-- MBX specific -->
2830         <xsl:attribute name="src">
2831             <xsl:value-of select="concat($webwork-server,'/webwork2/html2xml?')"/>
2832             <xsl:text>&amp;answersSubmitted=0</xsl:text>
2833             <xsl:choose>
2834                 <xsl:when test="@source">
2835                     <xsl:text>&amp;sourceFilePath=</xsl:text>
2836                     <xsl:value-of select="@source" />
2837                 </xsl:when>
2838                 <!-- The following fails to match a webwork that ONLY has a geogebra child -->
2839                 <xsl:when test="not(. = '')">
2840                     <xsl:text>&amp;problemSource=</xsl:text>

I can think of a few tests that would get the behavior we want, but I'm unsure which would be "best". Any reason not to make it <xsl:when test="not(@source)">?

rbeezer commented 7 years ago

The "geogebra" will need to be housed in some sort of container, even if we just rip it out. But that is not decided yet.

But that test could improve. Probably trying to avoid the empty "webwork" element (which was a fiddle once summer work got added in). Revent work probably isolates us from that problem.

I'll look later at current code/schema to see what needs to be there.

On 07/02/2017 08:07 PM, Alex Jordan wrote:

If you have a |webwork| with a |statement|, and the only child of the |statement| is something like a |geogebra| (which has attributes but is an empty element) then there is an XSL test in |mathbook-html.xsl| that comes up false but you'd want it to be true. I think the test needs to be written differently.

The place where the faulty test is, is here in |mathbook-html.xsl|, where I've commented:

|2826 2827 use 'format=debug' on 'webwork' tag to debug problem</xsl:comment> 2828 <xsl:element name="iframe"> 2829 100%</xsl:attribute> 2830 2831 <xsl:value-of select="concat($webwork-server,'/webwork2/html2xml?')"/> 2832

&answersSubmitted=0 2833 2834 2835 &sourceFilePath= 2836 2837 2838 2839 2840 &problemSource= | I can think of a few tests that would get the behavior we want, but I'm unsure which would be "best". Any reason not to make it ||? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .