New Geogebra plugin

Re: New Geogebra plugin

by Mauno Korpelainen -
Number of replies: 4

It might be possible to create such a fallback. I just need to change the filter to check first if java is enabled in browser (with javascript because server side php can't detect java) and if java is enabled output java applet and if not enabled use geogebrareader.js

The plugin saves a string anyway with delimiters. On the other hand it might be good to add some optional parameter to force a jsxgraph instead of geogebra applet because javascript based graphs are faster to render than applets.

I must test if it works during the weekend and send you the package for testing on Saturday or Sunday

In reply to Mauno Korpelainen

Re: New Geogebra plugin

by Daniel Thies -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I have played a little with the idea of having javascript translate all the embedded links to geobebra files into jsxgraphs only to find that javascript alone could not do this for security reasons (GeogebraReader loads files from the same directory).

I realized your initial question is not trivial.  There are different contexts that are appropriate for jsxgraph and geobebra. It might be good to have the extra functionality of geobebra available to teachers and as assignments for students. However, I question whether it may be appropriate to have geobebra easily accessible in a forum where a reader might have forty java applets on a page. Geobebra has a much higher perfomance cost than than jsxgraph.  The two buttons are not the same. Previously this sort of thing was controlled by the teacher/administrator through the enableing/disabling of filters (Dragmath/TeX filter). The buttons that you have are presumably controlled by an administrator by not installing the editor plugin, but it should be controlled also by the teacher enabling the student to see both, either or neither of the buttons.

In reply to Daniel Thies

Re: New Geogebra plugin

by Mauno Korpelainen -

It is possible to make the plugin either totally role based (so that students do not see the button in editor toolbar) or to enable the filter only context based (leave it available but not enabled site wide) so that all users of context (for example course where teacher has enabled the filter) can see the button in editor toolbar and filtered strings are changed to JSXGraphs with GeogebraReader.js

You are right - I too would not like to see 20 applets loading in forum big grin

The plugin is not using files at all - it is saving all data from Geogebra applet in plugin as a plain base64 string inside delimiters, a filter changes these strings to JSXGraph script tags and GeogebraReader.js is used to render the JSXGraphs. When you need to edit the graph, the plugin renders a Geogebra applet using the selected string - temporarely saved to a place holder (image) alt tag - and you are ready to use fully functional Geogebra applet to edit it. Or to open some external ggb file or save your content from plugin to a local ggb file, upload it as file to your site and use normal geogebra filter to render the file. But the plugin is not saving files to server - only strings to database.

Detection of Java in browser is as simple as

<script>
if (navigator.javaEnabled()) {do something};
</script>

but it may not be good enough because we need to detect also a proper version of Java ( Geogebra 4 requires Java 5+ ) and there are issues like https://addons.mozilla.org/en-US/firefox/blocked/p182 and finally we might need to use object tags with Geogebra... if possible.

Time-out required wink

In reply to Mauno Korpelainen

Re: New Geogebra plugin

by Daniel Thies -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

The navigator.javaEnabled() method should be all you need. I would not bother with checking the Java version.  Firefox disables Java automatically because of the vunerability so javaEnabled should be false in that case and using Geogebra with an outdated plugin or browser is probably not a security issue.  If Geogebra will not run because of Java, users should be prompted to upgrade Java or they can disable Java manually and go with Jsxgraph which may be good for them again for security reasons.

My question is if inserting a string is what you are doing for the editor plugin thus enabling support for mobile devices, couldn't this be done also by the geobebra filter. In which case the plugin does not need to distinguish between whether it outputs a jsxgraph string or a geobebra file. The filter would fix it.

 

In reply to Mauno Korpelainen

Re: New Geogebra plugin

by Daniel Thies -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I made a silly error yesterday.  It is indeed possible to load a Geogebra file with javascript from the same server into GeogebraReader.js which is what the Moodle geogebra filter does. I am attaching the script that I made.  It may be included in the footer or an html block, page, etc. where you want geobebra to display as jsxgraph on mobile or other non java devices.

I have tested it on Firefox(Linux/Windows 7) w/ and wo/ java, and Samsumg Galaxy 10.1 on which it works as expected.  It does not seem to work on Chrome/Chromnium browsers with Java disabled.  They just show panels complaining Java disabled. IE 9 seems to still run Geogebra even with java supposedly disabled.