// Numbas version: exam_results_page_options {"name": "Minimal resume", "metadata": {"description": "

Different methods of loading a geogebra applet.

", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": [""], "questions": [{"name": "test ggb resume", "extensions": ["geogebra"], "custom_part_types": [], "resources": [["question-resources/material-S9Xk8AmF.ggb", "/srv/numbas/media/question-resources/material-S9Xk8AmF.ggb"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}], "tags": [], "metadata": {"description": "

Shows different ways to load a geogebra applet.

", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "

Method 1: This applet was loaded using {\"\\{geogebra_applet('S9Xk8AmF')\\}\"}, and  seems to work as expected

\n

\n

{geogebra_applet('S9Xk8AmF')}

\n

\n

Method 2:  This applet was loaded by creating avariable of type Geogebra applet with a value obtained by JME function geogebra_applet('S9Xk8AmF')

\n

and loading it with {\"\\{applet\\}\"}. This works initially, but there is no diagram after a resume.

\n

\n

{applet}

\n

\n

Method 3:  This applet was loaded from a .ggb files saved as a resource like this: [geogebra_file('material-S9Xk8AmF.ggb')]  The applet is initially there, but the frame has a 0px height, so it isn't visible.  Also, the grid and pan-and-zoom permission get turned on.  

\n

\n

{geogebra_file('material-S9Xk8AmF.ggb')}

\n

\n

Method 4:  This applet was loaded by defining a Javascript function (plus I moved a point) returning a GeoGebra object , and loading it by calling the function {\"\\{ geogebra_function()\\}\"}  This seems to work as expected.

\n

\n

{geogebra_function()}

\n

\n

Method 5:  load a variable of type Geogebra applet with a value obtained by calling javascirpt geogebra_function()  and loading it with {\"\\{applet2\\}\"} Same problem as Method 2.

\n

{applet2}

", "advice": "", "rulesets": {}, "variables": {"applet": {"name": "applet", "group": "Ungrouped variables", "definition": "geogebra_applet('S9Xk8AmF')", "description": "", "templateType": "anything"}, "applet2": {"name": "applet2", "group": "Ungrouped variables", "definition": "geogebra_function()", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["applet", "applet2"], "variable_groups": [], "functions": {"geogebra_function": {"parameters": [], "type": "ggbapplet", "language": "javascript", "definition": "// Create the worksheet. \n// This function returns an object with a container `element` and a `promise` resolving to a GeoGebra applet.\nvar result = Numbas.extensions.geogebra.createGeogebraApplet({material_id: 'S9Xk8AmF'});\n\n// Once the applet has loaded, run some commands to manipulate the worksheet.\nresult.promise.then(function(d) {\n var app = d.app;\n \n app.setCoords('B',-5,0);\n \n});\n\n// This function returns the result of `createGeogebraApplet` as an object with the JME data type 'ggbapplet', which can be substituted into the question's content.\nreturn new Numbas.jme.types.ggbapplet(result);"}}, "preamble": {"js": "", "css": ""}, "parts": [], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": false, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": []}, "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}], "extensions": ["geogebra"], "custom_part_types": [], "resources": [["question-resources/material-S9Xk8AmF.ggb", "/srv/numbas/media/question-resources/material-S9Xk8AmF.ggb"]]}