This is my first attempt at using App Script, but I want to create a form with 50 questions with the same two choices utilizing radio buttons.
I was hoping I could create an array with the questions and just iterate through each question in the array (with a for loop) to create the question items with the same choices, but not exactly clear on how to implement this perhaps via an index with the .setTitle(item) object.
Thank you and any guidance would be appreciated.
// radiobuttons
var items = ["Q1", "Q2", "Q3"];
var arrayLength = items.length;
var roundNumber = 0;
var choices = ["Successful", "Unsuccessful"];
for (i = 0; i < arrayLength; i++ { . // Incomplete
form.addMultipleChoiceItem()
.setTitle(item)
.setChoiceValues(choices)
.setRequired(true);
forloop is missing the closing)arrayLength, just do the standard way,i < items.Length. And woudn't a better name foritemsbetitles, seeing as that's what you're using it for?