This project is not covered by Drupal’s security advisory policy.
Introduction
Provides a new field for displaying and storing a rating based on questions and options that depends on the configuration of the field and will be offered to the user to submit in any entity form that uses this field.
Installation
As with many other modules, if your site is managed via Composer, use Composer to download the module:
composer require "drupal/rating_field ~1.0"
Then, enable it in the "Extend" page of your Drupal installation.
Once the module is enabled, the field will be available in the dropdown list, every time you manage the fields of your entity ("Manage fields" section) and you want to add a new field, this one will be available as "Rating field" under the Rating Field Module option in the dropdown list of field types.
Field possibilities
Once the rating_field has been added, first you have to configure the options in the storage settings (field settings) page.
There, you have to set the options for this field, that can be modified meanwhile the field has no value stored in the database:
Default likert-type scale
This option will add the default values: Strongly disagree,Disagree,Neutral, Agree and Strongly agree as available options.
Numeric rating scale
This option gives the user to choose a numeric value from a dropdown. The value chosen will be the max. value used to render the options, from 1 to that number included.
The user will have the option as well to include or not the value '0' by choosing a different option in a separate checkbox. If enabled, will add '0' before the value '1' of the different options.
Custom scale
The last option allows the user to set custom options as the possible options for the rating field. In the textarea you can introduce one option per line up to a maximum of five. If there is any duplicated line or more than 5, there will be an error displayed.
Add a 'N/A' option
The last checkbox available in the value settings adds an 'N/A' option to the list of options that previosly we have selected. This option will be rendered before any option.
Availble questions
This textarea will allow the user to introduce the questions will be rendered
later in the field in the form. One question per line with no limit.
Later, the form will show each question in the field followed by one or more
radio buttons for each value configured in the previous step.
Hide label and require field
The widget allows to configure basic settings about the label. There is a checkbox available to hide the label of the field when it is rendered in the form.
If this is the case, each row of the field will show instead the * that indicates the field is mandatory and each row needs to be filled before the form is submitted in case the field is required.
If the field is not required, the user can skip any or all of the questions.
Future work
Mostly all in the module is done. Some extra tests needs to be added for the cases the field is mandatory and not all the options have been selected.
A bit of css in the field for validating errors can be added as well.
Credits

This module is developed and maintained by the International HQ of the Erasmus Student Network located in Brussels, Belgium.
| Attachment | Size |
|---|---|
| ESN logo | 20.97 KB |
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Site structure
31 sites report using this module
- Created by gorkagr on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Development version: 8.x-1.x-dev updated 21 Nov 2023 at 08:14 UTC

