// Numbas version: exam_results_page_options {"name": "Fraction input with custom CSS", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"f": {"description": "", "group": "Ungrouped variables", "definition": "random(2..10)", "templateType": "anything", "name": "f"}, "b2": {"description": "", "group": "Ungrouped variables", "definition": "random(1..10)+a1", "templateType": "anything", "name": "b2"}, "a": {"description": "", "group": "Ungrouped variables", "definition": "a1*f/g", "templateType": "anything", "name": "a"}, "a1": {"description": "", "group": "Ungrouped variables", "definition": "random(1..13)", "templateType": "anything", "name": "a1"}, "g": {"description": "", "group": "Ungrouped variables", "definition": "gcd(a1,b2)", "templateType": "anything", "name": "g"}, "b": {"description": "", "group": "Ungrouped variables", "definition": "b2*f/g", "templateType": "anything", "name": "b"}}, "showQuestionGroupNames": false, "functions": {}, "advice": "", "variablesTest": {"condition": "", "maxRuns": 100}, "type": "question", "statement": "", "ungrouped_variables": ["f", "a1", "b2", "g", "a", "b"], "tags": [], "parts": [{"marks": 0, "prompt": "
This is a matrix input. The gapfill is wrapped in a tag with the class \"fraction\".
\n$\\displaystyle{\\frac{\\var{a}}{\\var{b}}} = $ [[0]]
", "showCorrectAnswer": true, "scripts": {}, "gaps": [{"showCorrectAnswer": true, "marks": "2", "allowFractions": false, "correctAnswer": "matrix([[a/f],[b/f]])", "allowResize": false, "scripts": {}, "type": "matrix", "markPerCell": true, "numRows": "2", "correctAnswerFractions": false, "tolerance": 0, "numColumns": 1}], "type": "gapfill"}], "rulesets": {}, "preamble": {"js": "", "css": ".fraction .matrix-input .matrix-wrapper .left-bracket, .fraction .matrix-input .matrix-wrapper .right-bracket {\n display: none;\n}\n.fraction .matrix-input .matrix td input {\n text-align: center;\n}\n.fraction .matrix-input .matrix tr:first-child td {\n padding-bottom: 5px !important;\n border-bottom: 1px solid black;\n}\n.fraction .matrix-input .matrix tr:last-child td {\n padding-top: 5px !important;\n}"}, "name": "Fraction input with custom CSS", "variable_groups": [], "question_groups": [{"pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [], "name": ""}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Some custom CSS restyles the matrix input so it looks like a fraction, with input boxes on top and bottom.
\nIdeally, there should be a fraction input part type, or an option for the number entry part to display a fraction input.
", "notes": ""}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}