// Numbas version: exam_results_page_options {"name": "Caesar cipher", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Caesar cipher", "tags": [], "metadata": {"description": "
This question asks students to decrypt a message using a simple Caesar cipher, without giving them the key.
", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "statement": "Caesar wants to organise a secret meeting with Marc Anthony. He sends Marc-Antony the secret message {ciphertext} using a shift cipher. Where do Caesar and Marc Anthony meet (enter your answer in capital letters)?
", "advice": "We do not have the key to decrypt the message, so we need to try every possible key and choose the answer that is intelligible.
\nTo apply a key $k$ to the string, each letter $x$ is substituted with $x+k\\pmod{26}$, where $x$ is the place of the letter in the alphabet. This gives us the strings {advice}
\nOf those the only one that makes sense is the one for $k=\\var{26-shift}$, {plaintext}. Therefore this is where Caesar and Marc-Anthony will meet.
", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"cipher": {"name": "cipher", "group": "Ungrouped variables", "definition": "map(mod(x+shift,26),x,ordinalfromletter(plaintext))", "description": "", "templateType": "anything", "can_override": false}, "shift": {"name": "shift", "group": "Ungrouped variables", "definition": "random(1 .. 25#1)", "description": "", "templateType": "randrange", "can_override": false}, "shifts": {"name": "shifts", "group": "Ungrouped variables", "definition": "map(map(mod(x+j,26),x,cipher),j,1..26)", "description": "", "templateType": "anything", "can_override": false}, "translations": {"name": "translations", "group": "Ungrouped variables", "definition": "map(join(map(upper(letterordinal(x)),x,v),\"\"),v,shifts)", "description": "", "templateType": "anything", "can_override": false}, "plaintext": {"name": "plaintext", "group": "Ungrouped variables", "definition": "random([\"FORUM\",\"AGORA\",\"BATHS\",\"TIBER\",\"HOUSE\"])", "description": "", "templateType": "anything", "can_override": false}, "ciphertext": {"name": "ciphertext", "group": "Ungrouped variables", "definition": "join(map(upper(letterordinal(n)),n,cipher),\"\")", "description": "", "templateType": "anything", "can_override": false}, "advice": {"name": "advice", "group": "Ungrouped variables", "definition": "html(\"