I’m working on a web app where the user fills a form to get recommendations of product categories, actual products and product instructions (that differ depending on category and product and answer data). The form consists of 10 questions and the answers are either 1-value (radio buttons) or multiple-value (check boxes).
The problem is that despite the form having only 10 questions, the logic can become complex considering the many valid combinations (“recommend product category a if x or y or z are selected for answer a but not g or h for answer b…” or “if product category b recommended, add product instruction c1 but only if…or…or…but not…”).
I’m having trouble coding the logic using if/then statements, so I’m wondering what other approaches there are? Ideally I would like to enter the logic rules outside of the code in as near natural language as possible. Also, are there any tools to diagram the logic/rules?
Certainly does sound complex. It makes me think of using a bayesian system of some sort. Google finds a few promising links such as http://phpir.com/bayesian-opinion-mining or http://www.devshed.com/c/a/PHP/Implement-Bayesian-inference-using-PHP-Part-1/