Embedded applet no longer working

Richard Brown shared this question 2 months ago
Answered

Hi there

I built some applets to embed into Moodle last year, and a year ago they worked perfectly when embedded. But this year, they only half work - some elements function correctly, and some don't. The applets themselves are still fine when opened in geogebra online.

Here's an example:

This applet: dot product 2d – GeoGebra

Only half works (the number doesn't update, but the vectors can be dragged) when embedded using code below

Any idea what's happened?

(NB: code edited slightly from the embed code produced from geogebra so I can have multiple applets on the same page)

<div id="qnsbfbh8"></div>
<script>
    var parametersqnsbfbh8 = {
        "id": "qnsbfbh8",
        "width": 600,
        "height": 400,
        "showMenuBar": false,
        "showAlgebraInput": false,
        "showToolBar": false,
        "showToolBarHelp": true,
        "showResetIcon": true,
        "enableLabelDrags": false,
        "enableShiftDragZoom": true,
        "enableRightClick": false,
        "errorDialogsActive": false,
        "useBrowserForJS": false,
        "allowStyleBar": false,
        "preventFocus": false,
        "showZoomButtons": true,
        "capturingThreshold": 3,
        // add code here to run when the applet starts
        "appletOnLoad": function(api) { /* api.evalCommand('Segment((1,2),(3,4))');*/ },
        "showFullscreenButton": true,
        "scale": 1,
        "disableAutoScale": false,
        "allowUpscale": false,
        "clickToLoad": false,
        "appName": "graphing",
        "showSuggestionButtons": true,
        "buttonRounding": 0.7,
        "buttonShadows": false,
        "language": "en",
        "material_id": "qnsbfbh8",
    };
    // is3D=is 3D applet using 3D view, AV=Algebra View, SV=Spreadsheet View, CV=CAS View, EV2=Graphics View 2, CP=Construction Protocol, PC=Probability Calculator DA=Data Analysis, FI=Function Inspector, macro=Macros
    var viewsqnsbfbh8 = {
        'is3D': 0,
        'AV': 1,
        'SV': 0,
        'CV': 0,
        'EV2': 0,
        'CP': 0,
        'PC': 0,
        'DA': 0,
        'FI': 0,
        'macro': 0
    };
</script>
<script src="https://cdn.geogebra.org/ap...;
<script>
    var appletqnsbfbh8 = new GGBApplet(parametersqnsbfbh8, '5.0', viewsqnsbfbh8);
    appletqnsbfbh8.setPreviewImage('data:image/gif;base64,R0lGODlhAQABAAAAADs=', 'https://www.geogebra.org/images/GeoGebra_loading.png', 'https://www.geogebra.org/images/applet_play.png');
    window.addEventListener('load', function() {
        appletqnsbfbh8.inject('qnsbfbh8');
    }, false);
</script>

Comments (4)

photo
1

Your code works OK for me: https://test.geogebra.org/~...

photo
1

Thanks! But does the black number update for you as you move the vectors around? It doesn't for me when I follow your link (or use my embed), but does from the applet itself.

photo
2

Ah, I see the problem. You need to use

        "appName": "classic",

(dot product is disabled in "graphing")

photo
1

Thank you so much! I thought it would be something simple, but didn't know where to look. That worked perfectly. Really appreciate the quick response.

photo
© 2021 International GeoGebra Institute