How to create a flexible abstraction for WP_Query?

My question is about php but it involves wordpress as i am creating a plugin. The case is that i have 5 questions, each question have 6 choices and one choice to choose from each. Now the person would select any choice from each or just few. I have created the if condition that is now making me mad, as it has gone too long and will do further, like nearly 100 combination will be made. I wouldn’t want that, i know there is a way of multidimensional array but in am not a plugin or php expert for wordpress. so if anyone can sort it for me.