Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I want to be able to ask users a question, and, depending on their answer, go to some other question. Webforms does not handle this well, since it seems to assume that the user answers most of the questions. I'm looking for something like

What price range do you want?

  • If between $100 and $200, go to question 2
  • If between $200 and $300, go to question 3
  • If between $300 and $400, go to question 4

And so on.

At the end, I need to be able to see all of their answers in order to perform a DB query, so their responses will have to be "accumulated" as they go. I don't strictly need to have their answers stored in the DB, but it would be nice. I'm fine with programming in a hackish special case with hardcoded targets, but a clicky-button interface would be preferable, if such a module exists.

I feel like there should be some relatively-easy way of doing this, perhaps with the Form API and fields on nodes, but I can't quite put my finger on how it would be done.

share|improve this question
    
I'm evaluating the options. Don't worry, I'll accept an answer once I'm done. –  haxney Jan 14 '13 at 15:27

4 Answers 4

Look at webform conditional or update your webform to >4.0-alpha2.

I have done a 2-way or 3-way branch on a form with a few sub-pages of questions for each branch. It's kind of a pain but its very doable.

Webform results will show you only the answers they had to complete depending on conditions and validations.

share|improve this answer
    
I tried webform 4.0-alpha2, and the conditionals were too limited to solve my problem. –  haxney Jan 18 '13 at 6:37

You may take a look at the Field Conditional State module.

With field conditional state module you can set #state form field attribute based on value selected in other form fields.

share|improve this answer

Try this module dquarks. Using this you can create surveys and quiz. Hope this helps.

share|improve this answer
up vote 0 down vote accepted

I ended up going with the Mforms module. It has the flexibility to create more complicated flows beyond surveys and quizzes. Its included example module contains enough to get started.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.