Drupal Webform : set SCORE on each SELECT Options?

210 views Asked by At

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?

2

There are 2 answers

0
NIF On BEST ANSWER

Finally, that I do :

I fill the option list with :

key_score|description

And i use explode function with _ seprator.

0
pal4life On

The way to do this would be to associate key with points. Thus 0 corresponds to 2 points, 1 to 0 point, 2 to 2 points and 3 to 1 point. Thus on submission you would look at user responses and then calculate based on the responses to those particular question.

Thus under form settings would set the redirection location to a page where you process this logic and then redirect from there or show the output on the same page.