Is it possible to use geogebra apps API in materials?

pfb shared this question 1 year ago
Answered

Hi,

I have recently completed my first project using geogebra apps API. I'm pretty happy about it.

I have used jsfiddle for the javascript/html5 integration.

I think it would be nice to be able to use the geogebra apps API in geogebra material. I have tried to look into it, with no success.

Was anybody able to do that?

Maybe that is not allowed due to security issues...

Thanks a lot for your help.

Francesco

Comments (4)

photo
1

Please explain precisely what you are trying to do

photo
1

Hi Michael,

and thanks for answering.

I am referring to the possibility of having the javascript in a html page interact with geogebra through geogebra apps API.

My goal is converting "static" textbook exercises into "dynamic" (possibly interactive) web exercises.

So far I was able to do that with a "graph reading" exercise. The idea is that the student is presented with two graphs describing a monochromatic wave, one in the time domain and one in the space domain. The task is to write down the mathematical representation of the wave, y = A sin(kx ± wt+q) and specify the parameters A, k, w, q by reading them from the graph.

I have done this as follows:

  • I have webpage with a geogebra applet in it;
  • I have some js code generating the parameters upon pressing a html button; the code also passes the parameters to the ggb applet through js+API
  • Another button reveals a kind of detailed discussion of the exercise, with results that are specific of the (kind of) randomly generated data.

As an alternative, the detailed discussion could be replaced by a validation of the student's responses. I have not done this part yet, but I do not think this is going to be hard.

For the moment being this works in jsfiddle. I was wondering if it's possible to do that in geogebra "materials" pages (which are webpages).


Thanks again for answering

Francesco

photo
1

if it's possible to do that in geogebra "materials"


Yes, but it's not as flexible. All the Buttons & JavaScript etc has to go inside the .ggb file (eg in Global JavaScript)

photo
1

Hi Michael

>> Yes, but it's not as flexible. All the Buttons & JavaScript etc has to go inside the .ggb file (eg in Global JavaScript)

Sure,

I use that. Usually I put the graphics stuff in one of the graphics windows, and the "controls" (buttons, sliders, text fields and so on) in the other.

For this project I needed both windows for graphics, so adding the controls too would have made my applet too "crowded".

Plus, as you mention, the webpage is more flexible: I was able to add a whole lot of information, such as a detailed discussion of the exercise, referring to the dynamically generated data.

Being able to do that in the materials webpages would be awesome, but I guess that it poses some security threats...

Maybe at some point the materials could offer some builtin "interfacing" between the applets and the webpage.

© 2020 International GeoGebra Institute