geogebra_file() not loading.

44 views
Skip to first unread message

William Haynes

unread,
Feb 25, 2025, 9:18:48 AMFeb 25
to Numbas Users
Most of my problems use geogebra_applet() with a material ID to load the ggb applet, but I have a few where I have saved the .ggb file as a resource and load it with geogebra_file() instead.

These seem to have stopped working.  Now they all hang with "Geogebra applet loading...", even in the editor, and the console shows: TypeError: null is not an object (evaluating 'd.app.exists').


Thanks for looking into this.

Will

Christian Lawson-Perfect

unread,
Feb 26, 2025, 4:08:58 AMFeb 26
to numbas...@googlegroups.com
Oh, sorry about that. I've probably broken something and not tested geogebra_file. I'll have a look now.

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/numbas-users/b1401f8f-6ebb-4710-ad67-10885081d4d1n%40googlegroups.com.

Christian Lawson-Perfect

unread,
Feb 26, 2025, 4:54:26 AMFeb 26
to numbas...@googlegroups.com
Actually, I think there's an error when loading this file in Numbas. I'm not sure why - it works when I embed it in a standalone page.
Turning on logging, I get an error message "error in <spreadsheetView>: prefCellSize".
So there are two things for me to do: make sure those errors get logged in normal use, and work out what's causing that error.

Christian Lawson-Perfect

unread,
Feb 26, 2025, 6:38:44 AMFeb 26
to numbas...@googlegroups.com
I was wrong - it doesn't load properly standalone, it's just that the error happens after the point where the applet becomes visible and interactive.
I'm going to chase this up with GeoGebra, I think. Here's a minimal example, using your file: https://geogebra-load-file-error-2025-02.think.somethingorotherwhatever.com/index.html

Christian Lawson-Perfect

unread,
Feb 26, 2025, 8:38:18 AMFeb 26
to numbas...@googlegroups.com
OK, I think this will be my last addition to this thread: the problem is that the `prefCellSize` element in the geogebra XML has a `height` attribute but not `width`.
Did you make this file with the GeoGebra desktop app? If you didn't edit it by hand, then I think this is a bug in either the GeoGebra desktop app or the JS loader. If you want to follow this up, you could report it to GeoGebra.

William Haynes

unread,
Feb 26, 2025, 8:57:04 AMFeb 26
to 'guillaume theo' via Numbas Users
Christian,

Thank you for looking into this.    Yes, I made this file in the desktop app, maybe five years ago. 

I don't know if this is relevant or not, but this commit made yesterday might mean that  a fix is on the way. 

8744ffee45970e78bfc907adb47f6f11d813e398.png

Will




William Haynes

unread,
Feb 26, 2025, 8:59:42 AMFeb 26
to 'guillaume theo' via Numbas Users
On Feb 26, 2025, at 8:56 AM, William Haynes <wha...@maritime.edu> wrote:

Christian,

Thank you for looking into this.    Yes, I made this file in the desktop app, maybe five years ago. 

I don't know if this is relevant or not, but this commit made yesterday might mean that  a fix is on the way. 

Christian Lawson-Perfect

unread,
Feb 26, 2025, 9:00:46 AMFeb 26
to numbas...@googlegroups.com

William Haynes

unread,
Mar 30, 2025, 11:38:24 AMMar 30
to Numbas Users

Christian,

I followed up on this problem here: https://www.reddit.com/r/geogebra/comments/1jn0439/spreadsheetview_prefcellsize_no_width/, and mike_geogebra suggested the fix is to change

options.appletOnLoad = function() { var app = applet.getAppletObject();

To

options.appletOnLoad = function(api) var app = api;

These are lines 142-143 in the geogebra.js. I tried it locally, and it worked for me.

Will

Christian Lawson-Perfect

unread,
Apr 1, 2025, 9:51:34 AMApr 1
to numbas...@googlegroups.com
Thanks, Will!
I don't know how that fixes the problem, but I can't argue with the fact that it does. I've updated the extension as suggested.

William Haynes

unread,
Apr 3, 2025, 9:26:48 AMApr 3
to Numbas Users
Christian,

Thanks.  Questions are working for me again, however the "GeoGebra applet loading..."   message is still showing up in the editor when inspecting variables, so I suppose a similar fix is needed there.

Will

Christian Lawson-Perfect

unread,
Apr 22, 2025, 3:38:03 AMApr 22
to numbas...@googlegroups.com
Sorry it's taken me a while to get back to this!
I think that you must have still had the old version of the extension cached in your browser for the editor. It looks to me like it's working now.

William Haynes

unread,
Apr 23, 2025, 6:51:26 PMApr 23
to 'guillaume theo' via Numbas Users
Thanks,  it's working for me now too.  I'm glad to have geogebra_file() function working again!

Will

Reply all
Reply to author
Forward
0 new messages