Extracting data from multiple geogebra applets

311 views Asked by At

I am trying to build a webpage with multiple geogebra applets on the same page. This works, however, I am now not able to extract the data from all the independent applets.

When I only had one applet, I could simply call

ggbApplet.getBase64()

Now, however, I have two different applets and the API does not allow me to give an ID when calling getBase64(), is there still a way to extract this data when having multiple applets?

1

There are 1 answers

0
Zbynek On

I assume you are using the deployggb.js script for adding those applets. Please make sure you set different id parameters for both applets. This id corresponds to the name of global variable created by GeoGebra that you can use to access the applet API once it's loaded. See an example page with two applets in the GeoGebra example repository. If you create the applets like this:

var applet1 = new GGBApplet({"id":"app1", "width":600,
                     "height": 600, "showToolBar": true}, '5.0');
var applet1 = new GGBApplet({"id":"app1", "width":600,
                     "height": 600, "showToolBar": true}, '5.0');

then you can their contents using app1.getBase64() and app2.getBase64().