// Numbas version: finer_feedback_settings {"name": "Write an upper triangular matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Write an upper triangular matrix", "tags": [], "metadata": {"description": "

The student is asked to enter a given matrix, but they're only required to fill in the upper triangle.

\n

A custom marking algorithm fills in any empty cells in the lower triangle of the student's answer with the corresponding cell in the upper triangle.

\n

The student is still warned if they leave any cells empty in the upper triangle.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"m": {"name": "m", "group": "Ungrouped variables", "definition": "upper_triangular(matrix(repeat(repeat(random(1..9),4),4)))", "description": "

Generate a random $4 \\times 4$ matrix and then copy the upper triangle into the lower triangle.

", "templateType": "anything", "can_override": false}, "q": {"name": "q", "group": "Ungrouped variables", "definition": "[r,i] for: r of: 0..3 for: i of: r..3", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["m", "q"], "variable_groups": [], "functions": {"upper_triangular": {"parameters": [["m", "matrix"]], "type": "matrix", "language": "jme", "definition": "matrix((if(ij, studentAnswer[j][i], studentAnswer[i][j]) for: j of: 0..3) for: i of: 0..3\n\nstudentNumbers:\n if(settings[\"allowFractions\"],\n map(map(parsenumber_or_fraction(c, allowedNotationStyles), c, row), row, symmetric_studentAnswer)\n ,\n map(map(parsenumber(c, allowedNotationStyles), c, row), row, symmetric_studentAnswer)\n )\n\nupper_cell_indexes: [r,c] for: r of: 0..3 for: c of: r..3\n\nempty_cells (The positions of the cells in the student's answer which have been left empty):\n filter(trim(studentAnswer[p[0]][p[1]])=\"\", p, upper_cell_indexes)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write this matrix:

\n

$\\var{m}$

\n

You only need to fill in the upper triangle.

", "correctAnswer": "m", "correctAnswerFractions": false, "numRows": "4", "numColumns": "4", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": "[[\"\",\"\",\"\",\"\"],[\" \",\"\",\"\",\"\"],[\" \",\" \",\"\",\"\"],[\" \",\" \",\" \",\"\"]]"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "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/"}]}