// Numbas version: exam_results_page_options {"name": "Johan's copy of 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": [{"statement": "", "variables": {"b2": {"group": "Ungrouped variables", "name": "b2", "definition": "random(1..10)+a1", "templateType": "anything", "description": ""}, "b": {"group": "Ungrouped variables", "name": "b", "definition": "b2*f/g", "templateType": "anything", "description": ""}, "g": {"group": "Ungrouped variables", "name": "g", "definition": "gcd(a1,b2)", "templateType": "anything", "description": ""}, "a1": {"group": "Ungrouped variables", "name": "a1", "definition": "random(1..13)", "templateType": "anything", "description": ""}, "f": {"group": "Ungrouped variables", "name": "f", "definition": "random(2..10)", "templateType": "anything", "description": ""}, "a": {"group": "Ungrouped variables", "name": "a", "definition": "a1*f/g", "templateType": "anything", "description": ""}}, "question_groups": [{"pickQuestions": 0, "questions": [], "pickingStrategy": "all-ordered", "name": ""}], "tags": [], "metadata": {"notes": "", "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.

\n

Ideally, there should be a fraction input part type, or an option for the number entry part to display a fraction input.

"}, "variable_groups": [], "parts": [{"scripts": {}, "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]]

", "type": "gapfill", "marks": 0, "gaps": [{"scripts": {}, "allowResize": false, "marks": "2", "allowFractions": false, "numRows": "2", "correctAnswerFractions": false, "correctAnswer": "matrix([[a/f],[b/f]])", "tolerance": 0, "type": "matrix", "markPerCell": true, "numColumns": 1, "showCorrectAnswer": true}], "showCorrectAnswer": true}], "rulesets": {}, "type": "question", "showQuestionGroupNames": false, "functions": {}, "preamble": {"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}", "js": ""}, "ungrouped_variables": ["f", "a1", "b2", "g", "a", "b"], "advice": "", "variablesTest": {"maxRuns": 100, "condition": ""}, "name": "Johan's copy of Fraction input with custom CSS", "contributors": [{"name": "Johan Maertens", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1301/"}]}]}], "contributors": [{"name": "Johan Maertens", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1301/"}]}