When and Why to Use
Use this to capture numeric or labeled ratings across multiple items in a structured format. It's useful for:
Performance, satisfaction, or quality ratings
Comparing several attributes on a common scale
Collecting fine-grained opinion data
Supports sliders, buttons, and star ratings with configurable point labels.
Portrait Experience
Each row is presented individually with a rating interface (slider, star, or button)
User can scroll vertically through rows
Labels and anchors are shown depending on the
labels
config
Landscape Experience
Grid layout with rows as items and ratings as columns
Ratings are input inline per row
Star and slider styles are fully supported
Configuration Options
Option | Type | Required | Default | Description |
|
| yes | - | The prompt shown to the user |
| `List[str | MediaItem]` | yes | - |
|
| yes | - | Used in reporting structure |
|
| no | - | Top-level image shown above the question |
|
| no | 5 | Number of rating points |
|
| no | 1 or first label | First point on the scale |
|
| no | - | Custom labels for scale points |
|
| no |
| One of "slider", "button", or "star" |
|
| no |
| Whether to randomize row order |
|
| no | - | Optional recoding of rating values |
|
| no | "" | Optional "Don't know" fallback |
|
| no |
| Skip question if no rows provided |
|
| no | random | Test data defaults per row |
| `Callable[[Dict[str, int]], str | None]` | no | - |
|
| no | - | Field used for row image labels |
|
| no |
| Show/hide row image labels |
|
| no | - | Size to render row images |
|
| no | - | For reporting and text substitution |
Example Code
Basic usage:
s.grid_rating_question( "Please rate the following aspects of the product", rows=["Quality", "Price", "Service", "Delivery"], row_name="Product Aspect", number_of_points=5 )
With custom labels and recodes:
s.grid_rating_question( "How would you rate these aspects?", rows=["Speed", "Design"], row_name="Attribute", number_of_points=5, labels={ 1: "Very Poor", 3: "Neutral", 5: "Excellent" }, recodes={ "1": "Low", "2": "Low", "3": "Mid", "4": "High", "5": "High" } )
With star style and default values:
s.grid_rating_question( "Please rate your satisfaction with each brand", rows=["Brand A", "Brand B"], row_name="Brand", style="star", number_of_points=5, default={"Brand A": 4, "Brand B": 5} )
Notes
style="slider"
shows an interactive scale; usebutton
for tap options orstar
for visual flairlabels
can help orient respondents, especially on non-obvious scalescustom_validator
can enforce variation or prevent straight-lining