I am trying to create a quiz with options to click. I have a database with a custom data type with fields for the question text and options I created for each question. For each question, I have say 2-6 options. What I want to do is to display a random question along with buttons for options. If I have less than 4 populated options, I would display every populated option. If it is more than 4 options populated, I want to display the correct option along with 3 other options. The options would have to be in random order of display and also random order of selection among the false options. I managed to get the question chosen randomly in a repeating group but have these questions:
I only managed to “hardcode” option 1 or option 2 or so on. How can I get it to choose the correct answer for the randomly selected question along with 3 additional random options, shuffle the order of display and then populate the buttons. That way I will have 4 options chosen randomly among the six and order in which those four options are displayed would be random as well.
Thank you for anyone’s help with this one!