====== starRating - Add rating descriptions to Stars slider ======
The **starRating** function adds ratings descriptions (e.g, Very Poor, Poor, Average, Good, Excellent) to a Stars Rating question.
Functionality includes:
* Displays rating description interactively (i.e., on hover)
* Works with any number of stars
* Supports both full star and half-star ratings
* Flexible and translation-friendly specification of ratings labels
Here is a quick video demonstration:\\
{{ ::starRating.mp4?650 |starRating Demonstration}}
This function is available for a reasonable fee. Contact **[[https://community.qualtrics.com/XMcommunity/messages/add/TomG|TomG]]** on the Qualtrics Community to learn more.
===== Set-up Instructions =====
==== Survey Header ====
Add the starRating function to the survey header to make it available to any question in the survey. Go to Look & Feel -> General -> Header edit -> {{::icon_source.jpg?20|}} and paste the provided starRating function JS:
Alternatively, paste the starRating function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.
==== Slider Question ====
=== Question Settings ===
* Slider type: Stars
* Star interaction: Discrete or Half Step
=== Question JavaScript ===
Add JS to call the **starRating** function to apply it to the Slider question as follows:
Qualtrics.SurveyEngine.addOnload(function() {
starRating(this);
});
To change the default options, specify the desired **[[starrating#options|options]]** as an object. For example:
Qualtrics.SurveyEngine.addOnload(function() {
starRating(this,{ratings:"starRatings"});
});
===== Options =====
==== ratings ====
**ratings** is used to specify the rating descriptions (aka labels). It is either an array or a string. If **ratings** is an array, it contains the rating label text strings. If **ratings** is a string, it specifies the html class of a hidden, unordered list in the question text that contains the rating labels. For example:
- Very Poor
- Poor
- Average
- Good
- Excellent
The number of ratings labels must be appropriate for the number of stars. If the number of stars is //n// and the star interaction is ''Discrete'', the number of rating labels must be //n// or //n+1//. If the number of ratings labels is //n+1//, the first string will be displayed when zero stars are selected. If star interaction is ''Half Step'', the number of rating labels must be //n*2// or //(n*2)+1//.
Default: %%["Very Poor","Poor","Average","Good","Excellent"]%%
====== Qualtrics Wiki ======
[[start|Qualtrics Wiki]]