A web-based tool in Microsoft 365 that enables users to quickly create surveys, quizzes, polls, and feedback forms.
Microsoft Forms does not support true multiline answer options for choice questions, so code snippets cannot be entered as formatted, multi-line blocks directly in the options.
A practical workaround is to:
- Put the code snippet in the question body (which supports up to 4,000 characters per question and basic formatting such as bold, italic, underline, font color, font size, numbering, and bullets).
- Use short, single-line answer options (e.g., “Option A”, “Option B”, or short descriptions of what the code does) as the choices.
- If different code snippets must be selectable as answers, create separate questions, each showing one snippet in the question text, and ask the respondent to choose something about it (e.g., “Which snippet produces this output?”), or use a Text question type and have respondents type the correct option.
This stays within Forms’ limits: each question and each response can have up to 4,000 characters, and a form title and options have their own character limits.
Basic formatting for emphasis (e.g., bolding keywords or using bullets to mimic structure) can be applied by highlighting text in the question and using the formatting options described for Microsoft Forms.
References: