I have hierarchy structure database to manage the previous answer based question. So when I create the child questions, I want to be stored previous question then only I can make the relationship in the table. So I am wondering how to create the form fields to add question and answer for test. I choose below test form structure for now. It's giving very bad user experience.

enter image description here

This is my hierarchy structure

enter image description here

  • If you have pre-defined answers and users should pick the right one (for him), then let him choose one, not type. Sep 26, 2013 at 22:53
  • No it's not predefined. I added to allow user to add the question/answer in above formate
    – Gowri
    Sep 27, 2013 at 6:00
  • @AlexeyKolchenko Please don't gender users. Jan 31, 2019 at 17:14

4 Answers 4


A solution is to ask for each answer one at a time. As the user answers, you can ask further questions based on the responses. From your point of view, you have a complex tree that is being navigated. But for the user, their journey is linear and simple.

This is what the "contact" form looks like for Google AdSense (you can't really contact them!):

AdSense Contact

Once the user answers the question, their journey continues on a branch of the tree. Here's two example journeys the user has followed:

AdSense Contact Questions Answered

Notice how the journey is linear from the user's point of view. If the user wants to go back and change an answer, they can simply click on a question. If they change their answer, then a new journey starts with the user being asked a new series of questions.


Not sure if I misinterpret the question, but for starters, ensure to utilize progressive disclosure to hide all form fields that aren't applicable for the user's context (similar to what Brendon has mentioned, i.e. ask for each answer one at a time).

Basically, ensure to focus it around the user's needs and make the user initiate the progressive disclosure by the user's own actions.

Progressive Disclosure of Categories

Progressive disclosure of categories

Progressive Disclosure of a Form

Progressive disclosure of a complete form


enter image description here

I think that you ll need some dynamically changing information structures. Questions can come to screen one by one. This is one of the safest way because each answer is a turning point in your node structure and user will not be flooded with a lot of information.

There are several front-end technologies for storing that information. But let's turn our point..

Each response of user will change which question is going to be appeared to the user.

In those cases, a few tricks can be implemented.

  • Refer the answer of user in the next question so that user will have a sight connection with the previous question. Like in uploaded image.

  • Breadcrumbs (show what was the previous question?) and if user want to change an answer, he does not have to start from beginning.

  • Data visualization methods - (ex: http://www.visualthesaurus.com/app/view), which is a bit experimental but promising.

In mentioned example, as you can see an object can be connected with other objects with a reasoning. If you want to show possible questions, you can do it and get an answer from your user. The good thing about this node structure, user can jump on complex tree while still able to continue his voyage linear.

There are several open source lib for that purpose, one example:


  • Thanks for the answer. but, question was all about adding the question in test. your answer is about answering form. Hope you understand what I am looking for
    – Gowri
    Oct 29, 2013 at 9:59
  • Each answer is changing upcoming question so you are highly depended on answer of user.
    – Abektes
    Oct 29, 2013 at 10:27

We have resolved this issue by storing our decision trees in a graph-db and just sending the next question to the front end.

  • Could you explain further on the UX aspect and remove the riskine.com. As it is it appears more like an ad than an answer.
    – Mayo
    Nov 20, 2017 at 13:44
  • might have to forward your question to our ux expert. But basically we store ale the required meta-data for each question (node) as properties (e.g. fetype - ddown,multi,..; grouping of questions, answer types,..) and send it via json to our frontend Nov 21, 2017 at 14:41

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.