Hello.
I want to create a quiz. The user will answer 52 multiple choice questions. The answers will be saved to the database and sent to an API for a response.
I want to fetch the quiz questions from an option set. The answers need to be Radio Buttons. I also want to use a repeating group.
In the workflow, there is nothing like each cell’s radio button’s value that I can use to save and to send to the API.
Any suggestions?
Thanks a lot.
In the repeating group as you said, you should put the quiz questions from the the option set and make sure the data type of the repeating group is the option set and not just text.
Put onto the option set of questions attributes for each questions set of potential responses.
In the repeating group of questions put a nested repeating group of the answers.
In the nested rg put the radio buttons.
Then when user clicks onto the radio button simply save the answer as current cells answer.
Thank you very much. I tried but failed.
I put a nested RG for answers in the RG for questions like this:
(I call questions reasons.)
Then, in the workflow, I was trying to find the value of each radio button to create a thing. There are 52 questions and I need to find the value of each to save the value of each.
I am looking for something like “Repeating Group’s Radio Button #1’s Value”
Does it even exist?
The value of a radio button can be retrieved in Javascript if the id of the radio button is available.
Radio buttons must be given unique_id.
JS code to get the value from the id of a radio button
const radioIds = [radio_button_id(list)];
const results = [];
radioIds.forEach(id => {
const container = document.getElementById(id);
if (container) {
const radios = container.querySelectorAll('input[type="radio"]');
radios.forEach(radio => {
if (radio.checked) {
results.push(radio.value);
}
});
}
});
bubble_fn_result(suffix)