I have been tasked with investigating options for developing a Drupal module that would serve as a Wizard for helping users create a customized legal-agreement template based on a series of interview questions. Please note, I have had no experience with Drupal before last week, so I need specific answers that do not assume any knowledge on my part.

Essentially, this new tool would ask the user a series of questions on a variety of topics (and follow-up questions based on a decision tree), and when the interview is complete, the tool would produce a text document containing only those (pre-written) paragraphs relevant to the project. Alternatively, more experienced legal staff could bypass the interview and simply select the paragraphs desired by clicking on items in a list -- much like the way someone with tax experience can bypass the "Guided Tour" in TurboTax to select and manually complete the appropriate IRS forms. Other requirements: Our user interface for our interview must be intuitive to the average technophobe, and the user must be able to send the output into a MS-Word document (additional formats are a bonus). Our office is developing other web-based tools using Drupal 7; we have limited resources available for programming this tool, so simpler solutions are preferred.

Has anyone done anything like this, or know of tools/modules that we could adapt? What other advice do you have for us?

Thank you all in advance for your advice.

2 Answers 2


For the longer list, you can add a content type (Structure -> Content types) and add checkbox fields for each question, where the text of the question is the value displayed by the checkbox when it is selected (the "On" value). An alternative way would be to add a Checkbox field with multiple values. I suggest this because by default, just the value of the checkbox(es) is shown on the resulting content when you save and view it.

For the list of questions, it depends on how many questions we're talking about. A slightly tedious but straightforward way is to use the Rules module along with another content type that contains the questions.

This installs itself to Configuration -> Workflow -> Rules.

For each question, you add a triggered rule that checks the response and sets the value of the other content type (let's call it Template) to whatever it should be. You could probably do this one with one rule as well. In this case, I'd set the stored values in the database for the Questions type fields such that they match or somehow contain information about the names/values of the fields in the Template content type. It would basically be a mapping of sorts, and the rule could set the value of the Template based on this.

You may also need to store a reference to the Template content corresponding to the set of questions in the Questions type. The easiest way to do this is to install References and add a Node reference field to the Template content type. Then, you can have a rule that creates a new template and associates it with the Questions content when you save a new Questions content item, for example. The other rules would then have some saved content for which to set field values (otherwise, you'd wind up creating new Template content every time or something).

These are some thoughts on this. It's not the most elegant, but it might get you started or at least on the right track.

  • Thanks, wizonesolutions. Further info, relating to the interview: The agreements in question will enable collaborative scientific research, so the contract terms cover a wide range of issues. Accordingly, the interview must anticipate all types of research with all categories of collaborators. This means the interview must be highly detailed, with multiple levels of follow-up questions across several categories. Tedium of writing content is not an issue, but the practicality of implementing a complex decision tree is critical. Does this change your answer at all? Commented Nov 30, 2011 at 19:30
  • The basic setup remains the same, but depending on if you are planning to have multiple pages or not, you should either look into the form wizard API of ctools or into Conditional Fields, which is in development but might work. I'd recommend the form wizard approach; I've done similar with it. At the end of the flow, you can save content programatically, and Rules can still operate on that if necessary. Commented Nov 30, 2011 at 23:57

To address your question, I can only share my personal experience. I have a similar complex problem for a content rich website. I came to Drupal some programming experience including working with databases, but not in website applications. I could not find an out of the box system for developing my site. Drupal is very sophisticated and is probably the right tool for such a project, but it has a large learning curve and to do what you want will require knowledge of some of the more complex add-on modules and the ability to code in php for fancier requirements that are certain to pop up. Working daily for 4 months, I am just getting a handle on what is going on inside Drupal enough to plan the structure of the data and develop the content and User interface of the site. As you mentioned, generating the actual content is the simple part.

To do this project I would recommend that you have an experienced programming consultant that is knows how to structure the database keys (taxonomies in Drupal) and knows his/her way around Drupal programming.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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