// Numbas version: exam_results_page_options {"name": "Simon's copy of Construct an equilateral triangle - GeoGebra", "extensions": ["oldgeogebra"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": [], "name": "Simon's copy of Construct an equilateral triangle - GeoGebra", "tags": ["demo"], "type": "question", "advice": "", "rulesets": {}, "parts": [{"prompt": "

Create an equilateral triangle. Note that it's not sufficient just to make a shape which looks equilateral - you must construct a triangle which is provably equilateral.

\n
Applet goes here
", "marks": 0, "gaps": [{"expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "scripts": {}, "answer": "1", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": "question.signals.on('HTMLAttached',function() {\n var html = $(question.display.html);\n var url = 'https://www.geogebratube.org/material/iframe/id/103442/width/800/height/430/border/888888/rc/false/ai/false/sdz/true/smb/false/stb/true/stbh/true/ld/false/sri/true/at/preferhtml5';\n \n var applet = window.applet = new Numbas.extensions.geogebra.GeoGebraApplet(url, {width: '800px', height: '430px'});\n \n html.find('#geogebra-applet').html('').append(applet.html);\n \n applet.geogebra_ready.done(function() {\n function checkType(name) {\n applet.getObjectType(name).done(function(type) {\n if(!(type=='triangle' || type=='polygon'))\n return;\n \n applet.evalCommand('verts = Length[{Vertex['+name+']}]');\n applet.getValue('verts').done(function(verts) {\n if(verts!=3)\n return;\n applet.evalCommand('l_1 = Distance[Vertex['+name+',1],Vertex['+name+',2]]');\n applet.evalCommand('l_2 = Distance[Vertex['+name+',1],Vertex['+name+',3]]');\n applet.evalCommand('l_3 = Distance[Vertex['+name+',3],Vertex['+name+',2]]');\n $.when(applet.getValue('l_1'),applet.getValue('l_2'),applet.getValue('l_3')).done(function(l1,l2,l3) {\n var precround = Numbas.math.precround;\n l1 = precround(l1,6);\n l2 = precround(l2,6);\n l3 = precround(l3,6);\n var equilateral = l1 == l2 && l2 == l3;\n question.parts[0].equilateral = equilateral;\n question.parts[0].setDirty(true);\n })\n applet.deleteObject('verts');\n applet.deleteObject('l_1');\n applet.deleteObject('l_2');\n applet.deleteObject('l_3');\n });\n console.log(name,type);\n });\n }\n \n applet.onUpdate(checkType);\n applet.onAdd(checkType);\n });\n \n question.parts[0].mark = function() {\n if(this.equilateral)\n this.setCredit(1);\n else\n this.setCredit(0);\n }\n question.parts[0].validate = function() {\n return true;\n }\n});"}, "variables": {}, "metadata": {"notes": "", "description": "

This question uses the GeoGebra extension so it can ask the student to create an equilateral triangle. It doesn't matter how they do it, as long as they end up with a polygon with three vertices whose sides are all the same length.

", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Simon Goodchild", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/483/"}]}]}], "contributors": [{"name": "Simon Goodchild", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/483/"}]}