0
votes

I have been tasked with building multiple questionnaire forms which have the following charateristics:

  1. 50-100 questions for each questionnaire
  2. Mix of single and multiple option questions
  3. Configurable answer(s) for each question
  4. 5 options per question

Using webforms, can anyone tell me how I might create such questions from code rather than manually create each form with it's multiples of questions?

PS: Can anyone tell me if a Drupal Form API based solution will be better than using webforms?

1

1 Answers

3
votes

Webforms are stored inside nodes so that an actual form is a node, and then all of the data submissions reside in the webform module's custom database tables and refer to the node ID. Its very possible to build webform nodes programatically and there is a great reference here to learn to do so:

https://drupal.org/node/2030697

Going with a Drupal Form API based solution is only better or worse depending on the specific requirements of what you are trying to do. If the webform module's methods of browsing and storing the data is sufficient, then it will likely be quicker and easier to develop using the webform module. If you want to store the data in some sort of custom method or do something unique with it, then you may want to build these forms using the form API and your own custom data handling procedures.