Search code examples
drupalhtml-selectdrupal-webform

Drupal Webform : set SCORE on each SELECT Options?


I have webforms on drupal with multiple select options (radio). And in my select, I want to say option 1 : gives 2 points, option 2 : give 1 point, etc... For after display on a webpage : your score is 12/20 points.

example : A bear can be ... ?

  • 0|White <- response give 2 points
  • 1|Yellow <- response give 0 point
  • 2|Brown <- response give 2 points
  • 3|Dark <- response give 1 points

The question is : how to store the point of select options because there is only key|value in the admin interface? In fact : how to add infos each select option row?


Solution

  • Finally, that I do :

    I fill the option list with :

    key_score|description

    And i use explode function with _ seprator.