WeBWorK Main Forum

Accessing HTML code block within GeoGebra applets for the "ggbBase64" snippet

Accessing HTML code block within GeoGebra applets for the "ggbBase64" snippet

by tim Payer -
Number of replies: 2

Thank you for all your help but I am still mired in this problem of how to access the html code block for embedding a GeoGebra applet into a WeBWorK problem.

I am using as a template the example shown on this site.
http://webwork.maa.org/wiki/GeoGebraWeb1#.WwsklarRWUk

I have loaded this example as a Webwork problem along with the half dozen accompanying graphs and they all work fine.

To learn how to create such applets I thought I would re-create the same GeoGebra applet, and place it into a WeBWork homework problem.

Both have been reproduced without much problem but merging the two has been the issue.

Specifically a snippet of code within the HTML block totaling over 2000 alpha and numeric characters that starts with "ggbBase64".
The instructions that I am working with state that I need this snippet of code so that the GeoGebra applet can be embedded within a WeBWorK homework platform.

I am assuming that I can NOT use my desktop copy of GeoGebra, because attempts to do so results in this error:
"Could not access GeoGebra. Abort upload. (Error code 500)".

The techs at our school says I might need a single-sign on/SPNEGO option.
But at this point I am not clear if this is the solution.

Then to access the html code block I am assuming I must sign into my GeoGebra account online and then upload the applet there.

So once I have either uploaded or created a GeoGebra applet in my online account, I need to see the HTML code for it to be able to find the ggbBase64 snippet.

To do this I click on the three horizontal line icon in the upper right corner of the GeoGebra screen, but in the Google Chrome browser there is no option to see the source code for the applet.

Using this path in the Google browser: More Tools> Developer tools > service worker already controlling the page, Which seems like this is off limits and the wrong path anyhow.

Instead I try using Fire-Fox portable and open the three horizontal line icon for the Fire-Fox browser and Find this path: Web-Developer > Page Source

Now this does take me to over 1000 lines of HTML code, with about a dozen references that look similar to what I want :

For Example...
<img src="data:image/svg+xml;base64,...
But I suspect that this too is wrong because there is only supposed to be one such  ggbBase64 snippet, it looks like nothing like the code above
Anyhow I was hoping you could help shed some light on my attempt to find this specific ggbBase64 code snippet.
Any help is most appreciated.
Sincerely, Tim
In reply to tim Payer

Re: Accessing HTML code block within GeoGebra applets for the "ggbBase64" snippet

by Sean Fitzpatrick -
To get GeoGebra material onto the web, you need an account with GeoGebra. If you've signed into that account on your desktop GeoGebra app, you can export to HTML from the menu (File --> Export... --> Dynamic web page) or by hitting <CTRL>-<SHIFT>-W.

But you don't need your material on the web to get the base64 blob: once you've completed your applet in GeoGebra (and centred the view where you want it), hit <CTRL>-<SHIFT>-B to generate the base64 string that encodes your applet. You can then copy this and paste it directly into your WeBWorK problem.

See the attached template from our local collection of programming templates for an example.
Our template also links to the web version. If I recall correctly this isn't 100% necessary but it adds some additional features. I'll check with my colleague who wrote the template when I see her.
In reply to Sean Fitzpatrick

Re: Accessing HTML code block within GeoGebra applets for the "ggbBase64" snippet

by Sean Fitzpatrick -
To clarify, the keyboard commands given above are run within the GeoGebra application, not the web browser. I am using GeoGebra Classic 5; I'm not certain if they kept the same commands in other versions.
(I find the input bar in GeoGebra 6 hard to use. In GeoGebra 5, I can enter a polynomial like x^2+3x+2 as you would in WeBWorK. In GeoGebra 6, once you've typed x^2, the cursor moves up to the exponent, and stays there until you use a right arrow key to move back down. I guess this is for students who don't believe in parentheses.)