Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geogebra Block example for creating new objects not working #1167

Open
bgailer opened this issue Apr 12, 2024 · 1 comment
Open

Geogebra Block example for creating new objects not working #1167

bgailer opened this issue Apr 12, 2024 · 1 comment

Comments

@bgailer
Copy link
Contributor

bgailer commented Apr 12, 2024

Hello,
I recently started playing around with the new Geogebra Block. I wanted to try out an example from the docs on using commands inside [[geogebra]][[/geogebra]] blocks to define geogebra objects (https://docs.stack-assessment.org/en/Authoring/GeoGebra/#example-using-some-advanced-features). In the example, the following code is given:

[[geogebra]]
params["appletOnLoad"]=function(){appletObject.evalCommand("f(x):=x^3")}; 
[[/geogebra]]

However, this does not create the function in the Geogebra applet. I looked at the code for the Geogebra block and I think that the problem might be the variable appletObject but I could not figure out why. When I use applet.getAppletObject() in my code instead of the variable, the function gets plotted. Here is what works for me:

[[geogebra]]
params["appletOnLoad"]=function(){
//console.log(appletObject);
console.log(applet.getAppletObject());
applet.getAppletObject().evalCommand("f(x)=x^3");
}; 
[[/geogebra]]
@guidopinkernell
Copy link
Contributor

I can confirm this.

In corsscripts/geogebracore.js
appletObject does not exist, while applet.getAppletObject does and works.
So this seems a mistake in the docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants