// Numbas version: exam_results_page_options
{"name": "Testing JSXGraph for a Hasse diagram", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["a", "b"], "functions": {"createNetwork": {"parameters": [], "language": "javascript", "type": "html", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n \n// The line is described by the equation \n// y = a*x + b\n\n// This function takes as its parameters the coefficients a and b,\n// and the coordinates (x2,y2) of a point on the line.\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('300px','400px',\n{boundingBox: [0,4.5,1,0.5],\n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\n\nvar redColor='#ff0000';\nvar blueColor='#0000ff';\nvar grayColor='#9b9b9b';\n\nvar PointStyle={face:'o', size:4, fixed:false,label:{fontSize:20}};\nvar LineStyle={fixed:true,straightFirst:false,straightLast:false,strokeWidth:2,dash:0,strokeColor:blueColor};\n\n\nquestion.parts[0].trueEdges=new Set([\"{1,2,4,5}gt{1,2,4}\", \"{1,2,3,5}gt{1,2}\", \"{1,2,3,5}gt{3}\", \"{1,3,4}gt{3,4}\", \"{1,3,4}gt{1}\", \"{1,2,4}gt{1,2}\", \"{1,2}gt{1}\", \"{1,2}gt{2}\", \"{3,4}gt{3}\"]);\n\nquestion.parts[0].allEdges = new Set([\"{1,2,4,5}gt{1,2,4}\", \"{1,2,4,5}gt{1,2}\", \"{1,2,4,5}gt{1}\", \"{1,2,4,5}gt{2}\", \"{1,2,3,5}gt{1,2}\", \"{1,2,3,5}gt{1}\", \"{1,2,3,5}gt{2}\", \"{1,2,3,5}gt{3}\", \"{1,3,4}gt{3,4}\", \"{1,3,4}gt{1}\", \"{1,3,4}gt{3}\", \"{1,2,4}gt{1,2}\", \"{1,2,4}gt{1}\", \"{1,2,4}gt{2}\", \"{1,2}gt{1}\", \"{1,2}gt{2}\", \"{3,4}gt{3}\"]);\n\nquestion.parts[0].removableEdges = new Set([\"{1,2,4,5}gt{1,2}\", \"{1,2,4,5}gt{1}\", \"{1,2,4,5}gt{2}\", \"{1,2,4,5}gt{1}\", \"{1,2,4,5}gt{2}\", \"{1,2,3,5}gt{1}\", \"{1,2,3,5}gt{2}\", \"{1,3,4}gt{3}\", \"{1,2,4}gt{1}\", \"{1,2,4}gt{2}\"]);\n\nquestion.parts[0].constructedEdges=new Set();\n\nvar lineDict={};\n\nvar point0selected=false\nvar point0\n\n\nfunction changePointStyle(){\n if(this.selected==true){\n this.selected=false;\n this.setAttribute({fillColor:redColor,strokeColor:redColor});\n \n point0selected=false\n \n } else {\n this.selected=true ;\n this.setAttribute({fillColor:blueColor,strokeColor:blueColor});\n \n if(point0selected==false){\n point0selected=true\n point0=this\n } else {\n if(point0.Y()>this.Y()){\n lineName=point0.name+\"gt\"+this.name;\n } else if (point0.Y()
{createNetwork()}
\nCreate a Hasse diagram for the subsets about under the poset relation $\\subseteq$.
", "variableReplacements": []}], "variablesTest": {"condition": "a<>b", "maxRuns": 100}, "type": "question", "contributors": [{"name": "Joshua Capel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1479/"}]}]}], "contributors": [{"name": "Joshua Capel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1479/"}]}