Geogebra jumps

49 views
Skip to first unread message

Rob Beezer

unread,
Sep 15, 2023, 12:46:04 PM9/15/23
to prete...@googlegroups.com
Seen in testing, but it is present in current sample article, so not a
consequence of a PR. On Firefox.

Click anywhere in the left triangle and the whole material seems to jump up
halfway and stay that way, obscuring half of the interactive.

Figure 14.1
https://pretextbook.org/examples/sample-article/html/section-interactive-server.html#figure-54

Seems OK at the site proper.

https://www.geogebra.org/m/KGn2d4Qd

Anybody with GeoGebra experience know what might be going on?

Rob

Andrew Scholer

unread,
Sep 15, 2023, 1:06:48 PM9/15/23
to prete...@googlegroups.com
A minimal test of the iframe in a standalone page reveals it has nothing to do with Runestone.

Here is iframe - key bits highhlighted:
        <iframe src="https://www.geogebra.org/material/iframe/id/KGn2d4Qd/width/800/height/450/border/888888/smb/false/stb/false/stbh/false/ai/false/asb/false/sri/false/rc/false/ld/false/sdz/false/ctl/false" id="geogebra-right-triangle" width="420" height="233"></iframe>

The combination of geogebra/firefox is rebelling against the disconnect between iframe dimensions and the dimensions being passed to geogebra in the request. If you change the iframe dimensions to 800/450 all is good. Or change the dimensions in the URL string to 420/233.

I did notice that GeoGebra appears to recommend embedding via div as opposed to iframe:

This kind of issue, where the content in a frame is only loosely connected to the page geometry surrounding it, is a classic source of iframe headaches.

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


--
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 on the web visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAzMi5iZWV6ZXI.1694796362%40quikprotect.

D. Brian Walton

unread,
Sep 15, 2023, 1:34:40 PM9/15/23
to prete...@googlegroups.com
I believe that the same methodology for dealing with javascript encapsulation that is being used in the pending Runestone PR for dynamic fill-in-the-blank exercises would allow us to break Geogebra interactive completely out of iframes and use a native div approach. We could move away from the iframe inclusion of material to the javascript approach without much hassle by simply implementing the GGB loading script with no modifications.

- Brian

Alex Jordan

unread,
Sep 15, 2023, 2:02:01 PM9/15/23
to prete...@googlegroups.com
Iirc (and it has been a long time) we do use divs for ggb when they are coded "from scratch" in PTX source. There we felt could control the names of certain js variables to avoid a clash. We did not understand well what the potential for clashing could be with ggb from a file or from the materials library, so we stuck those in an iframe. 

Then I started to think that all we need to control was the name of the applet instance, which we can, and we could drop iframe for ggb. But we pushed pause until interactive schema could be more established. Now it's 4+ years later...

D. Brian Walton

unread,
Sep 15, 2023, 2:24:52 PM9/15/23
to prete...@googlegroups.com
We do use a div in those cases, but it is buried inside of a separate html file that the main document pulls in through an iframe. The complications for doing it all in the main html source is that there can be name collisions related to Javascript variables as well as with slate div names.

My proposal for working around this is to encapsulate all of the Javascript inside of a function so that all names are constrained to a local namespace and can't conflict, and to introduce the idea of concatenating a parent's id/label with a child element suffix in order to generate unique ids. That way, even if you were to copy and paste the identical XML to get the same interactive element twice in a row, because the neighboring parent elements have separate ids, the dependent children elements have unique ids even though they have the same coded partial names.

- Brian

Reply all
Reply to author
Forward
0 new messages