// Numbas version: finer_feedback_settings {"name": "Diagram showing a division of a negative number", "extensions": ["eukleides"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Diagram showing a division of a negative number", "tags": [], "metadata": {"description": "

A Eukleides diagram showing a list of numbers, each in their own box, with the sum drawn above.

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

{max_height(10, diagram)}

", "advice": "", "rulesets": {}, "extensions": ["eukleides"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"diagram": {"name": "diagram", "group": "Ungrouped variables", "definition": "let(\n nb, num_boxes,\n nn, n,\n total, nn*nb,\n w, 1.5, // the width of a box\n h, 1, // the height of a box\n gap, 0.2,\neukleides(\"\"\"{nb} boxes labelled {nn}, summing to {total}\"\"\",\n [ map(\n let(p, point(w*i,0),\n [\n polygon(rectangle(p,w,h)) filled color1 opacity(0.5),\n polygon(rectangle(p,w,h)),\n (p+vector(w/2,h/2)) text(string(nn)) description(string(nn))\n ]\n ),\n i,\n 0..nb-1\n )\n , point(0,h+0.1)..point(0,h+gap)..point(w*nb,h+gap)..point(w*nb,h+0.1) open\n , point(w*nb/2, h+gap)..point(w*nb/2, h+2*gap)\n , point(w*nb/2, h+3*gap) text(string(total)) description(\"Sum {total}\")\n ]\n)\n)", "description": "

A diagram showing the list of numbers and their sum. Negative numbers are shown in a different colour to positive numbers.

", "templateType": "anything", "can_override": false}, "num_boxes": {"name": "num_boxes", "group": "Ungrouped variables", "definition": "random(3..6)", "description": "

The number of boxes to show.

", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(-6..-3)", "description": "

The number in each box.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["num_boxes", "n", "diagram"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "resources": []}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}