The Journal of Online Mathematics and Its Applications, Volume 7 (2007)
Creating Mathlets with Open Source Tools, Markus Hohenwarter and Judith Preinder
Advanced users who have a little experience with HTML and programming can use the JavaScript interface of GeoGebra applets to add interactive elements like text fields and buttons to their dynamic worksheets. GeoGebra's JavaScript interface provides methods both to observe and modify objects in a construction. You can use these methods for simple things like hiding or showing certain objects when a button is clicked, but also for using GeoGebra as a plug-in for other projects.
In the following example, you will learn how the JavaScript interface can be used to turn a dynamic worksheet into an interactive exercise. To illustrate this process we use our interactive exercise Derivative of a Polynomial.
Creating the Dynamic FigurePlease find information on how to create the dynamic figure for this example in the section Creating "Derivative of a Polynomial". Note: Although only the sliders a, b, c, and d as well as the polynomial function f are visible on the dynamic worksheet, you need to create some hidden objects for the exercise logic in JavaScript. Creating Interactive ExercisesIn order to extend an existing dynamic worksheet to become an interactive exercise you need to...
|
Please find a list of all available methods of GeoGebra's JavaScript interface at GeoGebra Applets and JavaScript. There are several example pages available that help you to get started: Basic JavaScript worksheet, Java to JavaScript communication and Applet to Applet communication.