Random questionnaire questions

I am currently working on a questionnaire page where questions need to be shown to users in random order.

The questions are structured differently, some with 3-5 multiple choice, some with True/False selections, and some with written answers, so I have opted to not use a data structure to store the questions, but rather have created a series of forms in groups name Group Q1, Group Q2, Group Q3 etc. I hide all groups on page load with the idea of showing them individually when I needed to.

The challenge I can’t wrap my head around is how to select them randomly and keep displaying them in random order until all are shown without repeating a question.

I have tried using the Random Number Generator and have successfully used it show random questions on page load but I can’t figure out how to use it to show new random questions without repeating a question.

I have tried creating a data type called “Question Order” with the question numbers as a field. I have used this as a data source for a repeating group using a search with a random order, but I can’t figure out how to read the numbers from the repeating group to select a question to show, and I can’t figure out how to get the repeating group to step to the next cell.

I’m a little stuck.

Any help would be appreciated.

https://bubble.io/page?type=page&name=ind_mod1&id=testtasklabour&tab=tabs-1

1 Like

Ended up resolving with three custom states and the Question Order table.

Custom states:

  1. questions - list of numbers set to “Do a search for Question Orders in random order: Question number” on page load
  2. question - single number set to the first item in the questions list state on page load.
  3. current question - single number tracking the index in the questions list state. Initially set to 1 on page load

A next button increments the current question index state …


…and then sets question to the the questions state index #: current state.

All the group boxes have a condition to become visible when question = their corresponding number.

Works a charm. No repeating group required.

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.