Shuffle answer properties

Issuetracker:

This isn’t currently possible. Consider adding a star (on top left) to the following feature requests for Google to prioritize the issue:

Partial worksround:

Partial Workaround as already mentioned in this answer is to shuffle the array creating options and setback the array using setChoiceValues(). The drawback of such server side randomizing is

  • It can only be done whenever the server script runs and not when client opens the form

  • Even if you randomize each minute, it is possible that users opening the form simultaneously will see the same order of options

Sample script:

const form = FormApp.openById('/*form id*/');
const item = form.addMultipleChoiceItem();
item.setTitle('Car or truck?');
const options = ['Truck', 'Car'];
//Durstenfeld algo
for (let i = options.length - 1; i > 0; i--) {
  let rand = Math.floor(Math.random() * i);
  [options[i], options[rand]] = [options[rand], options[i]];
}
item.setChoiceValues(options);

Leave a Comment