When and Why to Use
Use this to capture how strongly a respondent feels about a given item or concept on a numeric scale. Ideal for:
- Measuring attitudes or satisfaction
- Capturing degrees of liking, agreement, or importance
- Top-box / bottom-box analysis with recodes
Other Names and Formats
A Rating Question is a rating scale, numeric rating scale, or numerical rating scale. Its input styles include slider rating, button rating, and star rating. With ordered agreement labels, it is an agreement scale or Likert-type item, often searched for as a Likert scale question. A single agreement item can form part of a multi-item Likert scale.
Chat Experience
- Slider, button, or star-style input depending on
style - Labels shown inline or at ends of the scale
- Optional "Don't know" button at the bottom if configured
| Button style with image | Slider style | Star style with image |
|---|---|---|
![]() | ![]() | ![]() |
Traditional Experience
- Input rendered more horizontally with larger interactive area
- Works well with remote or keyboard input
| Button style with an image | Slider style, mobile optimized | Star style with an image |
|---|---|---|
![]() | ![]() | ![]() |
Configuration Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
question | string | yes | - | Text prompt shown to respondent |
number_of_points | int | no | 5 or label count | Number of points on the scale |
first_point | int | no | 1 or first label | Starting value on the scale |
style | string | no | slider | "slider", "button", or "star" |
labels | Dict[int, str] | no | - | Labels for specific points on the scale |
image | MediaItem | no | - | Optional image shown above the question |
image_size | Tuple[int, int] | no | (600, 600) | Bounding box size for a displayed image |
default | int | List[int] | no | random | Default value used in test mode, or a list of candidate values — each simulated respondent picks one at random |
dont_know_option | str | no | - | Adds a "Don't know" option with this label |
recodes | Dict[str, str] | no | - | Map numeric responses into grouped outputs |
custom_validator | Callable[[int | str], str | None] | no | - | Called with the parsed integer (the "Don't know" option arrives as its text); return an error message to reject |
number_seconds | int | no | 0 | Seconds to wait before allowing the respondent to continue |
tags | s.tag() | no | - | For token substitution in text and grouped reporting |
id | str | None | no | None | Optional stable identifier for this question |
Example Code
Basic 5-point slider:
s.rating_question( "How much do you like this product?", number_of_points=5, style="slider", labels={ 1: "Dislike", 3: "Neutral", 5: "Like" } )
With recodes:
s.rating_question(
"How much do you like this product?",
number_of_points=5,
recodes={
"1": "dislike",
"2": "dislike",
"3": "neutral",
"4": "like",
"5": "like"
}
)
With "Don't know" and tag token:
s.rating_question(
"How do you rate {brand} cars?",
number_of_points=5,
labels={
1: "Dislike",
3: "Neutral",
5: "Like"
},
dont_know_option="Don't know",
tags=s.tag(brand="Ford")
)
Notes
- Returns an
IntResponse— the selected scale point behaves like a standard Python integer sliderandbuttonstyles include numeric values with labelsdont_know_optionresponses are recorded as -999 in the survey data and reported as the configured text- Use
recodesto collapse scale points for reporting custom_validatoris helpful for attention checks or edge case handling






