{ "source": { "author": { "name": "Christian Lawson-Perfect" } }, "name": "Number entry modulo", "short_name": "number-entry-modulo", "description": "

The student's answer should be equivalent to the expected answer modulo the base set by the question author.

", "help_url": "", "input_widget": "number", "input_options": { "correctAnswer": "string(mod(settings[\"expected\"],settings[\"modulo\"]))", "hint": { "static": false, "value": "if(settings[\"show_hint\"], \"$\\\\pmod{\"+settings[\"modulo\"]+\"}$\", \"\")" }, "allowedNotationStyles": { "static": true, "value": [ "plain", "en", "si-en" ] }, "allowFractions": { "static": true, "value": true } }, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\ncorrectif(interpreted_answer = expected_modulo)\n\ninterpreted_answer:\nmod(studentanswer,settings[\"modulo\"])\n\nexpected_modulo:\nmod(settings[\"expected\"],settings[\"modulo\"])", "marking_notes": [ { "name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "correctif(interpreted_answer = expected_modulo)" }, { "name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "mod(studentanswer,settings[\"modulo\"])" }, { "name": "expected_modulo", "description": "

The expected answer, modulo the base.

", "definition": "mod(settings[\"expected\"],settings[\"modulo\"])" } ], "settings": [ { "name": "expected", "label": "Expected answer", "help_url": "", "hint": "

Answers congruent to this number, modulo the base defined below, will be marked correct.

", "input_type": "code", "default_value": "", "evaluate": true }, { "name": "modulo", "label": "Base", "help_url": "", "hint": "Answers are compared modulo this number.", "input_type": "code", "default_value": "10", "evaluate": true }, { "name": "show_hint", "label": "Show modulo hint?", "help_url": "", "hint": "If ticked, $\\pmod{\\texttt{base}}$ will be shown to the right of the input box.", "input_type": "checkbox", "default_value": true } ], "public_availability": "always", "published": true, "extensions": [] }