When and Why to Use
Use this when you need a single-select multiple-choice question. It's suitable for:
Categorical data collection (e.g. gender, preferences, ratings)
Recoding responses into other groupings
Displaying image-based choices
Allowing "Other (please specify)" options
Supports randomization, disabling options, and custom input.
Portrait Experience
Options appear as buttons or image tiles depending on input.
If
specify_option
is set, an input field appears when selected.Disabled options appear greyed out and cannot be selected.
Landscape Experience
Layout may adjust to grid view or left-right image-plus-label design.
Keyboard/remote navigation highlights each choice.
Specify input field appears inline or in modal depending on UI.
Configuration Options
Option | Type | Required | Default | Description |
|
| yes | - | The prompt shown to the user |
| `List[str | MediaItem]` | yes | - |
|
| no | - | Image shown above the question |
|
| no |
| Shuffle options (except fixed ones) |
|
| no | - | Options that remain in place even when randomizing |
|
| no | - | Options to grey out/disable |
|
| no | - | Adds an "Other" option requiring input |
|
| no | "Please specify" | Prompt shown with specify_option |
|
| no | random choice | Test data default |
|
| no | - | Maps response(s) to grouped value(s) |
| `Callable[[str], str | None]` | no | - |
|
| no |
| If |
|
| no | - | Field used to label image options from media items |
|
| no |
| Whether to show labels with image tiles |
|
| no | - | Pixel bounding box for rendering image options |
|
| no | - | Replaces tokens in |
Example Code
Basic usage:
s.select_question("What is your gender?", options=["Male", "Female", "Non-Binary"])
With disabled and specify:
s.select_question( "What did you enjoy most?", options=["Service", "Price", "Speed"], disabled_options=["Speed"], specify_option="Other", specify_text="Tell us what else you enjoyed" )
With custom validator:
s.select_question( "Which brand do you trust the most?", options=["Brand A", "Brand B", "Brand C"], custom_validator=lambda x: "Are you sure you meant Sleepy Cows?" if x == "Sleepy Cows" else None )
Notes
randomize
helps reduce bias, especially in brand lists.Use
fixed_options
to keep options like "None of the above" in place.specify_option
is useful for letting users add their own answers.Recoding allows multiple options to be grouped into analysis buckets.